Instant Bookings

ASKED IN INTERVIEW
2pts
Airbnb

Problem Statement

Airbnb users often look for convenience and low additional costs. The marketing team wants to highlight properties that allow Instant Book (no host approval required) and have a cleaning fee of less than $50.

Write an SQL query to retrieve these specific listings.

Rules:

  • The property must have instant_book set to TRUE.
  • The cleaning_fee must be strictly less than 50.
  • Output columns: property_id, property_name, cleaning_fee.
  • Sort the results by cleaning_fee in ascending order.

Table Schema:

  • Listings: property_id, property_name, property_type, instant_book (BOOLEAN), cleaning_fee (DECIMAL).
Tests your understanding of
Basic SQL, Filtering and Logical Operators

Input Tables

Listings
property_id(INTEGER)property_name(VARCHAR)instant_book(BOOLEAN)cleaning_fee(DECIMAL)
1Cozy Studiotrue25
2Beachfront Villafalse150
3Modern Lofttrue49.99
4Shared Roomtrue10
5Mountain Cabintrue50
6Downtown Condofalse40

Expected Output

property_id(INTEGER)property_name(VARCHAR)cleaning_fee(DECIMAL)
4Shared Room10
1Cozy Studio25
3Modern Loft49.99

Tags

EasyASKED IN INTERVIEWBasic SQLFilteringLogical Operators
5 min
92%

Hints