CREATE TABLE Apartment_Buildings (
    building_id NUMBER PRIMARY KEY,
    building_short_name TEXT,
    building_full_name TEXT,
    building_description TEXT,
    building_address TEXT,
    building_manager TEXT,
    building_phone TEXT
);
CREATE TABLE Apartments (
    apt_id NUMBER PRIMARY KEY,
    building_id NUMBER,
    apt_type_code TEXT,
    apt_number TEXT,
    bathroom_count NUMBER,
    bedroom_count NUMBER,
    room_count TEXT,
    FOREIGN KEY ("building_id") REFERENCES Apartment_Buildings("building_id")
);
CREATE TABLE Apartment_Facilities (
    apt_id NUMBER PRIMARY KEY,
    facility_code TEXT,
    FOREIGN KEY ("apt_id") REFERENCES Apartments("apt_id")
);
CREATE TABLE Guests (
    guest_id NUMBER PRIMARY KEY,
    gender_code TEXT,
    guest_first_name TEXT,
    guest_last_name TEXT,
    date_of_birth TIME
);
CREATE TABLE Apartment_Bookings (
    apt_booking_id NUMBER PRIMARY KEY,
    apt_id NUMBER,
    guest_id NUMBER,
    booking_status_code TEXT,
    booking_start_date TIME,
    booking_end_date TIME,
    FOREIGN KEY ("guest_id") REFERENCES Guests("guest_id"),
    FOREIGN KEY ("apt_id") REFERENCES Apartments("apt_id")
);
CREATE TABLE View_Unit_Status (
    apt_id NUMBER,
    apt_booking_id NUMBER,
    status_date TIME PRIMARY KEY,
    available_yn OTHERS,
    FOREIGN KEY ("apt_booking_id") REFERENCES Apartment_Bookings("apt_booking_id"),
    FOREIGN KEY ("apt_id") REFERENCES Apartments("apt_id")
);

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

Question: Count the total number of apartment bookings.
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: What are the start date and end date of each apartment booking?
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: Give me a list of all the 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: Which buildings does "Emma" manage? Give me the short names of the buildings.
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 address and phone number of 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: Find all the building full names containing 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: Give me the minimum and maximum bathroom count among 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: Find the average number of bedrooms of all the 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 are the apartment number and the room count of 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: Find the average room count of the apartments that have the "Studio" type code.
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: Which apartments have type code "Flat"? Give me their apartment numbers.
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: What are the first names and last names of all the 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: What are dates of birth of all the guests whose gender is "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 apartment number, start date, and end date of each apartment booking?
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: Return the booking start date and end date for the apartments that have 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: Find the booking start date and end date for the apartments that have more than two 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"

Question: Tell me the booking status code for the apartment with 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"

Question: Show the distinct apartment numbers of the apartments that have bookings with status code "Confirmed".
SQL: 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"

Question: Which apartments have bookings with status code "Confirmed"? Return their apartment numbers.
SQL: 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"