Hi - can you please tell me the average room count of all Provisional bookings?
select avg ( room_count ) from apartment_bookings as t1 join apartments as t2 on t1.apt_id = t2.apt_id where t1.booking_status_code = "Provisional"
Great - can you list all apartments with more than one bathroom and more than three bedrooms?
select * from apartments where bathroom_count > 1 and bedroom_count > 3
Which apartment has the most bedrooms?
select * from apartments order by bedroom_count desc limit 1
OK - what was the total number of bookings in 2016?
select count ( * ) from apartment_bookings where booking_start_date like "%2016%"
How many of those bookings were studio apartments?
select count ( * ) from apartment_bookings as t1 join apartments as t2 on t1.apt_id = t2.apt_id where t1.booking_start_date like "%2016%" and t2.apt_type_code = "Studio"