Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1 What's the most expensive listing? What else can you tell me about the listing?
- SELECT
- *
- FROM
- sfo_listings l
- JOIN
- sfo_calendar c
- ON l.id = c.listing_id
- ORDER BY l.price DESC
- LIMIT 1
- #A: listing_id = 24650875, its $10K a night, the Host is name Sarah, its and Entire Home, Min stay is 2 nights
- the Neighborhood is 'Western Addition'
- #2 What neighborhoods seem to be the most popular?
- SELECT
- neighbourhood,
- COUNT(*)
- FROM
- sfo_listings
- GROUP BY 1
- ORDER BY 2 DESC
- #A: Mission, Western Addition, South of Market, Downtown, Castro
- #3
- SELECT
- l.id,
- c.calender_date,
- c.available,
- c.price
- FROM
- sfo_listings l
- JOIN
- sfo_calendar c
- ON
- l.id = c.listing_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement