Database: apartment_rentals

Question: How many apartment bookings are there in total?
SQL: SELECT count(*) FROM Apartment_Bookings

Question: Show the start dates and end dates of all the apartment bookings.
SQL: SELECT booking_start_date ,  booking_end_date FROM Apartment_Bookings

Question: Show all distinct building descriptions.
SQL: SELECT DISTINCT building_description FROM Apartment_Buildings

Question: Show the short names of the buildings managed by "Emma".
SQL: SELECT building_short_name FROM Apartment_Buildings WHERE building_manager	 =  "Emma"

Question: Show the addresses and phones of all the buildings managed by "Brenden".
SQL: SELECT building_address ,  building_phone FROM Apartment_Buildings WHERE building_manager	 =  "Brenden"

Question: What are the building full names that contain the word "court"?
SQL: SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%"

Question: What is the minimum and maximum number of bathrooms of all the apartments?
SQL: SELECT min(bathroom_count) ,  max(bathroom_count) FROM Apartments

Question: What is the average number of bedrooms of all apartments?
SQL: SELECT avg(bedroom_count) FROM Apartments

Question: Return the apartment number and the number of rooms for each apartment.
SQL: SELECT apt_number ,  room_count FROM Apartments

Question: What is the average number of rooms of apartments with type code "Studio"?
SQL: SELECT avg(room_count) FROM Apartments WHERE apt_type_code  =  "Studio"

Question: Return the apartment numbers of the apartments with type code "Flat".
SQL: SELECT apt_number FROM Apartments WHERE apt_type_code  =  "Flat"

Question: Return the first names and last names of all guests
SQL: SELECT guest_first_name ,  guest_last_name FROM Guests

Question: Return the date of birth for all the guests with gender code "Male".
SQL: SELECT date_of_birth FROM Guests WHERE gender_code  =  "Male"

Question: Show the apartment numbers, start dates, and end dates of all the apartment bookings.
SQL: SELECT T2.apt_number ,  T1.booking_start_date ,  T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id

Question: What are the booking start and end dates of the apartments with type code "Duplex"?
SQL: SELECT T1.booking_start_date ,  T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.apt_type_code  =  "Duplex"

Question: What are the booking start and end dates of the apartments with more than 2 bedrooms?
SQL: SELECT T1.booking_start_date ,  T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.bedroom_count  >  2

Question: What is the booking status code of the apartment with apartment number "Suite 634"?
SQL: SELECT T1.booking_status_code FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id  =  T2.apt_id WHERE T2.apt_number  =  "Suite 634"