AnalystPath

Matching Rental Property Pairs

SQLHardSenior levelAirbnb~15 min

Problem

**[Asked at Airbnb]**

Two rental properties are **potential substitutes** if they offer the exact same set
of amenities — nothing more, nothing less.

Count the number of such matching property pairs.

Return a single value `matching_pairs`.

Tables

Example rows — the live problem includes the full dataset.

property_amenities
row_idproperty_idamenity

Expected output

Your answer should return 1 row with the columns matching_pairs.

Starter code (SQL)

SELECT *
FROM property_amenities;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions