How many rooms are there in total?
select sum(room_count) from apartments
What about apartments?
select count(*) from apartments
Show all the apartment numbers and the status code for each one.
select t2.apt_number, t1.booking_status_code from apartment_bookings as t1 join apartments as t2 on t1.apt_id = t2.apt_id
Show the distinct apartment numbers of the apartments where the status code is not "Confirmed".
select distinct t2.apt_number from apartment_bookings as t1 join apartments as t2 on t1.apt_id = t2.apt_id where t1.booking_status_code != "Confirmed"
How about the status code is "Confirmed".
select distinct t2.apt_number from apartment_bookings as t1 join apartments as t2 on t1.apt_id = t2.apt_id where t1.booking_status_code = "Confirmed"