db_id stringclasses 140
values | question stringlengths 16 224 | query stringlengths 18 577 | db_schema stringclasses 140
values | question_toks listlengths 4 44 |
|---|---|---|---|---|
apartment_rentals | Show the short names of the buildings managed by "Emma". | SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"short",
"names",
"of",
"the",
"buildings",
"managed",
"by",
"``",
"Emma",
"''",
"."
] |
apartment_rentals | Which buildings does "Emma" manage? Give me the short names of the buildings. | SELECT building_short_name FROM Apartment_Buildings WHERE building_manager = "Emma" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"buildings",
"does",
"``",
"Emma",
"''",
"manage",
"?",
"Give",
"me",
"the",
"short",
"names",
"of",
"the",
"buildings",
"."
] |
apartment_rentals | Show the addresses and phones of all the buildings managed by "Brenden". | SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_manager = "Brenden" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"addresses",
"and",
"phones",
"of",
"all",
"the",
"buildings",
"managed",
"by",
"``",
"Brenden",
"''",
"."
] |
apartment_rentals | What are the address and phone number of the buildings managed by "Brenden"? | SELECT building_address , building_phone FROM Apartment_Buildings WHERE building_manager = "Brenden" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"address",
"and",
"phone",
"number",
"of",
"the",
"buildings",
"managed",
"by",
"``",
"Brenden",
"''",
"?"
] |
apartment_rentals | What are the building full names that contain the word "court"? | SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"building",
"full",
"names",
"that",
"contain",
"the",
"word",
"``",
"court",
"''",
"?"
] |
apartment_rentals | Find all the building full names containing the word "court". | SELECT building_full_name FROM Apartment_Buildings WHERE building_full_name LIKE "%court%" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Find",
"all",
"the",
"building",
"full",
"names",
"containing",
"the",
"word",
"``",
"court",
"''",
"."
] |
apartment_rentals | What is the minimum and maximum number of bathrooms of all the apartments? | SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"is",
"the",
"minimum",
"and",
"maximum",
"number",
"of",
"bathrooms",
"of",
"all",
"the",
"apartments",
"?"
] |
apartment_rentals | Give me the minimum and maximum bathroom count among all the apartments. | SELECT min(bathroom_count) , max(bathroom_count) FROM Apartments | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Give",
"me",
"the",
"minimum",
"and",
"maximum",
"bathroom",
"count",
"among",
"all",
"the",
"apartments",
"."
] |
apartment_rentals | What is the average number of bedrooms of all apartments? | SELECT avg(bedroom_count) FROM Apartments | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"is",
"the",
"average",
"number",
"of",
"bedrooms",
"of",
"all",
"apartments",
"?"
] |
apartment_rentals | Find the average number of bedrooms of all the apartments. | SELECT avg(bedroom_count) FROM Apartments | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Find",
"the",
"average",
"number",
"of",
"bedrooms",
"of",
"all",
"the",
"apartments",
"."
] |
apartment_rentals | Return the apartment number and the number of rooms for each apartment. | SELECT apt_number , room_count FROM Apartments | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"the",
"apartment",
"number",
"and",
"the",
"number",
"of",
"rooms",
"for",
"each",
"apartment",
"."
] |
apartment_rentals | What are the apartment number and the room count of each apartment? | SELECT apt_number , room_count FROM Apartments | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"apartment",
"number",
"and",
"the",
"room",
"count",
"of",
"each",
"apartment",
"?"
] |
apartment_rentals | What is the average number of rooms of apartments with type code "Studio"? | SELECT avg(room_count) FROM Apartments WHERE apt_type_code = "Studio" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"is",
"the",
"average",
"number",
"of",
"rooms",
"of",
"apartments",
"with",
"type",
"code",
"``",
"Studio",
"''",
"?"
] |
apartment_rentals | Find the average room count of the apartments that have the "Studio" type code. | SELECT avg(room_count) FROM Apartments WHERE apt_type_code = "Studio" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Find",
"the",
"average",
"room",
"count",
"of",
"the",
"apartments",
"that",
"have",
"the",
"``",
"Studio",
"''",
"type",
"code",
"."
] |
apartment_rentals | Return the apartment numbers of the apartments with type code "Flat". | SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"the",
"apartment",
"numbers",
"of",
"the",
"apartments",
"with",
"type",
"code",
"``",
"Flat",
"''",
"."
] |
apartment_rentals | Which apartments have type code "Flat"? Give me their apartment numbers. | SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartments",
"have",
"type",
"code",
"``",
"Flat",
"''",
"?",
"Give",
"me",
"their",
"apartment",
"numbers",
"."
] |
apartment_rentals | Return the first names and last names of all guests | SELECT guest_first_name , guest_last_name FROM Guests | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"the",
"first",
"names",
"and",
"last",
"names",
"of",
"all",
"guests"
] |
apartment_rentals | What are the first names and last names of all the guests? | SELECT guest_first_name , guest_last_name FROM Guests | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"first",
"names",
"and",
"last",
"names",
"of",
"all",
"the",
"guests",
"?"
] |
apartment_rentals | Return the date of birth for all the guests with gender code "Male". | SELECT date_of_birth FROM Guests WHERE gender_code = "Male" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"the",
"date",
"of",
"birth",
"for",
"all",
"the",
"guests",
"with",
"gender",
"code",
"``",
"Male",
"''",
"."
] |
apartment_rentals | What are dates of birth of all the guests whose gender is "Male"? | SELECT date_of_birth FROM Guests WHERE gender_code = "Male" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"dates",
"of",
"birth",
"of",
"all",
"the",
"guests",
"whose",
"gender",
"is",
"``",
"Male",
"''",
"?"
] |
apartment_rentals | Show the apartment numbers, start dates, and end dates of all the apartment bookings. | 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 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"apartment",
"numbers",
",",
"start",
"dates",
",",
"and",
"end",
"dates",
"of",
"all",
"the",
"apartment",
"bookings",
"."
] |
apartment_rentals | What are the apartment number, start date, and end date of each apartment booking? | 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 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"apartment",
"number",
",",
"start",
"date",
",",
"and",
"end",
"date",
"of",
"each",
"apartment",
"booking",
"?"
] |
apartment_rentals | What are the booking start and end dates of the apartments with type code "Duplex"? | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"booking",
"start",
"and",
"end",
"dates",
"of",
"the",
"apartments",
"with",
"type",
"code",
"``",
"Duplex",
"''",
"?"
] |
apartment_rentals | Return the booking start date and end date for the apartments that have type code "Duplex". | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"the",
"booking",
"start",
"date",
"and",
"end",
"date",
"for",
"the",
"apartments",
"that",
"have",
"type",
"code",
"``",
"Duplex",
"''",
"."
] |
apartment_rentals | What are the booking start and end dates of the apartments with more than 2 bedrooms? | 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 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"booking",
"start",
"and",
"end",
"dates",
"of",
"the",
"apartments",
"with",
"more",
"than",
"2",
"bedrooms",
"?"
] |
apartment_rentals | Find the booking start date and end date for the apartments that have more than two bedrooms. | 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 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Find",
"the",
"booking",
"start",
"date",
"and",
"end",
"date",
"for",
"the",
"apartments",
"that",
"have",
"more",
"than",
"two",
"bedrooms",
"."
] |
apartment_rentals | What is the booking status code of the apartment with apartment number "Suite 634"? | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"is",
"the",
"booking",
"status",
"code",
"of",
"the",
"apartment",
"with",
"apartment",
"number",
"``",
"Suite",
"634",
"''",
"?"
] |
apartment_rentals | Tell me the booking status code for the apartment with number "Suite 634". | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Tell",
"me",
"the",
"booking",
"status",
"code",
"for",
"the",
"apartment",
"with",
"number",
"``",
"Suite",
"634",
"''",
"."
] |
apartment_rentals | Show the distinct apartment numbers of the apartments that have bookings with status code "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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"distinct",
"apartment",
"numbers",
"of",
"the",
"apartments",
"that",
"have",
"bookings",
"with",
"status",
"code",
"``",
"Confirmed",
"''",
"."
] |
apartment_rentals | Which apartments have bookings with status code "Confirmed"? Return their apartment numbers. | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartments",
"have",
"bookings",
"with",
"status",
"code",
"``",
"Confirmed",
"''",
"?",
"Return",
"their",
"apartment",
"numbers",
"."
] |
apartment_rentals | Show the average room count of the apartments that have booking status code "Provisional". | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"average",
"room",
"count",
"of",
"the",
"apartments",
"that",
"have",
"booking",
"status",
"code",
"``",
"Provisional",
"''",
"."
] |
apartment_rentals | What is the average room count of the apartments whose booking status code is "Provisional"? | 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" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"is",
"the",
"average",
"room",
"count",
"of",
"the",
"apartments",
"whose",
"booking",
"status",
"code",
"is",
"``",
"Provisional",
"''",
"?"
] |
apartment_rentals | Show the guest first names, start dates, and end dates of all the apartment bookings. | SELECT T2.guest_first_name , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"guest",
"first",
"names",
",",
"start",
"dates",
",",
"and",
"end",
"dates",
"of",
"all",
"the",
"apartment",
"bookings",
"."
] |
apartment_rentals | What are the guest first name, start date, and end date of each apartment booking? | SELECT T2.guest_first_name , T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"guest",
"first",
"name",
",",
"start",
"date",
",",
"and",
"end",
"date",
"of",
"each",
"apartment",
"booking",
"?"
] |
apartment_rentals | Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female". | SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"start",
"dates",
"and",
"end",
"dates",
"of",
"all",
"the",
"apartment",
"bookings",
"made",
"by",
"guests",
"with",
"gender",
"code",
"``",
"Female",
"''",
"."
] |
apartment_rentals | What are the start date and end date of the apartment bookings made by female guests (gender code "Female")? | SELECT T1.booking_start_date , T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"start",
"date",
"and",
"end",
"date",
"of",
"the",
"apartment",
"bookings",
"made",
"by",
"female",
"guests",
"(",
"gender",
"code",
"``",
"Female",
"''",
")",
"?"
] |
apartment_rentals | Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed". | SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"first",
"names",
"and",
"last",
"names",
"of",
"all",
"the",
"guests",
"that",
"have",
"apartment",
"bookings",
"with",
"status",
"code",
"``",
"Confirmed",
"''",
"."
] |
apartment_rentals | Which guests have apartment bookings with status code "Confirmed"? Return their first names and last names. | SELECT T2.guest_first_name , T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"guests",
"have",
"apartment",
"bookings",
"with",
"status",
"code",
"``",
"Confirmed",
"''",
"?",
"Return",
"their",
"first",
"names",
"and",
"last",
"names",
"."
] |
apartment_rentals | Show the facility codes of apartments with more than 4 bedrooms. | SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"facility",
"codes",
"of",
"apartments",
"with",
"more",
"than",
"4",
"bedrooms",
"."
] |
apartment_rentals | What are the facility codes of the apartments with more than four bedrooms? | SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"facility",
"codes",
"of",
"the",
"apartments",
"with",
"more",
"than",
"four",
"bedrooms",
"?"
] |
apartment_rentals | Show the total number of rooms of all apartments with facility code "Gym". | SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"total",
"number",
"of",
"rooms",
"of",
"all",
"apartments",
"with",
"facility",
"code",
"``",
"Gym",
"''",
"."
] |
apartment_rentals | Find the total number of rooms in the apartments that have facility code "Gym". | SELECT sum(T2.room_count) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.facility_code = "Gym" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Find",
"the",
"total",
"number",
"of",
"rooms",
"in",
"the",
"apartments",
"that",
"have",
"facility",
"code",
"``",
"Gym",
"''",
"."
] |
apartment_rentals | Show the total number of rooms of the apartments in the building with short name "Columbus Square". | SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"total",
"number",
"of",
"rooms",
"of",
"the",
"apartments",
"in",
"the",
"building",
"with",
"short",
"name",
"``",
"Columbus",
"Square",
"''",
"."
] |
apartment_rentals | How many rooms in total are there in the apartments in the building with short name "Columbus Square"? | SELECT sum(T2.room_count) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_short_name = "Columbus Square" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"How",
"many",
"rooms",
"in",
"total",
"are",
"there",
"in",
"the",
"apartments",
"in",
"the",
"building",
"with",
"short",
"name",
"``",
"Columbus",
"Square",
"''",
"?"
] |
apartment_rentals | Show the addresses of the buildings that have apartments with more than 2 bathrooms. | SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"addresses",
"of",
"the",
"buildings",
"that",
"have",
"apartments",
"with",
"more",
"than",
"2",
"bathrooms",
"."
] |
apartment_rentals | Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings. | SELECT T1.building_address FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T2.bathroom_count > 2 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"buildings",
"have",
"apartments",
"that",
"have",
"more",
"than",
"two",
"bathrooms",
"?",
"Give",
"me",
"the",
"addresses",
"of",
"the",
"buildings",
"."
] |
apartment_rentals | Show the apartment type codes and apartment numbers in the buildings managed by "Kyle". | SELECT T2.apt_type_code , T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"apartment",
"type",
"codes",
"and",
"apartment",
"numbers",
"in",
"the",
"buildings",
"managed",
"by",
"``",
"Kyle",
"''",
"."
] |
apartment_rentals | What apartment type codes and apartment numbers do the buildings managed by "Kyle" have? | SELECT T2.apt_type_code , T2.apt_number FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"apartment",
"type",
"codes",
"and",
"apartment",
"numbers",
"do",
"the",
"buildings",
"managed",
"by",
"``",
"Kyle",
"''",
"have",
"?"
] |
apartment_rentals | Show the booking status code and the corresponding number of bookings. | SELECT booking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"booking",
"status",
"code",
"and",
"the",
"corresponding",
"number",
"of",
"bookings",
"."
] |
apartment_rentals | How many bookings does each booking status have? List the booking status code and the number of corresponding bookings. | SELECT booking_status_code , COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"How",
"many",
"bookings",
"does",
"each",
"booking",
"status",
"have",
"?",
"List",
"the",
"booking",
"status",
"code",
"and",
"the",
"number",
"of",
"corresponding",
"bookings",
"."
] |
apartment_rentals | Return all the apartment numbers sorted by the room count in ascending order. | SELECT apt_number FROM Apartments ORDER BY room_count ASC | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"all",
"the",
"apartment",
"numbers",
"sorted",
"by",
"the",
"room",
"count",
"in",
"ascending",
"order",
"."
] |
apartment_rentals | Sort the apartment numbers in ascending order of room count. | SELECT apt_number FROM Apartments ORDER BY room_count ASC | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Sort",
"the",
"apartment",
"numbers",
"in",
"ascending",
"order",
"of",
"room",
"count",
"."
] |
apartment_rentals | Return the apartment number with the largest number of bedrooms. | SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"the",
"apartment",
"number",
"with",
"the",
"largest",
"number",
"of",
"bedrooms",
"."
] |
apartment_rentals | What is the apartment number of the apartment with the most beds? | SELECT apt_number FROM Apartments ORDER BY bedroom_count DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"is",
"the",
"apartment",
"number",
"of",
"the",
"apartment",
"with",
"the",
"most",
"beds",
"?"
] |
apartment_rentals | Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. | SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"apartment",
"type",
"codes",
"and",
"the",
"corresponding",
"number",
"of",
"apartments",
"sorted",
"by",
"the",
"number",
"of",
"apartments",
"in",
"ascending",
"order",
"."
] |
apartment_rentals | Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments. | SELECT apt_type_code , COUNT(*) FROM Apartments GROUP BY apt_type_code ORDER BY COUNT(*) ASC | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"each",
"apartment",
"type",
"code",
"with",
"the",
"number",
"of",
"apartments",
"having",
"that",
"apartment",
"type",
",",
"in",
"ascending",
"order",
"of",
"the",
"number",
"of",
"apartments",
"."
] |
apartment_rentals | Show the top 3 apartment type codes sorted by the average number of rooms in descending order. | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"top",
"3",
"apartment",
"type",
"codes",
"sorted",
"by",
"the",
"average",
"number",
"of",
"rooms",
"in",
"descending",
"order",
"."
] |
apartment_rentals | What are the top three apartment types in terms of the average room count? Give me the | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"What",
"are",
"the",
"top",
"three",
"apartment",
"types",
"in",
"terms",
"of",
"the",
"average",
"room",
"count",
"?",
"Give",
"me",
"the"
] |
apartment_rentals | Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms. | SELECT apt_type_code , bathroom_count , bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"apartment",
"type",
"code",
"that",
"has",
"the",
"largest",
"number",
"of",
"total",
"rooms",
",",
"together",
"with",
"the",
"number",
"of",
"bathrooms",
"and",
"number",
"of",
"bedrooms",
"."
] |
apartment_rentals | Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms. | SELECT apt_type_code , bathroom_count , bedroom_count FROM Apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartment",
"type",
"has",
"the",
"largest",
"number",
"of",
"total",
"rooms",
"?",
"Return",
"the",
"apartment",
"type",
"code",
",",
"its",
"number",
"of",
"bathrooms",
"and",
"number",
"of",
"bedrooms",
"."
] |
apartment_rentals | Show the most common apartment type code. | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"most",
"common",
"apartment",
"type",
"code",
"."
] |
apartment_rentals | Which apartment type code appears the most often? | SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartment",
"type",
"code",
"appears",
"the",
"most",
"often",
"?"
] |
apartment_rentals | Show the most common apartment type code among apartments with more than 1 bathroom. | SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"most",
"common",
"apartment",
"type",
"code",
"among",
"apartments",
"with",
"more",
"than",
"1",
"bathroom",
"."
] |
apartment_rentals | Which apartment type code is the most common among apartments with more than one bathroom? | SELECT apt_type_code FROM Apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartment",
"type",
"code",
"is",
"the",
"most",
"common",
"among",
"apartments",
"with",
"more",
"than",
"one",
"bathroom",
"?"
] |
apartment_rentals | Show each apartment type code, and the maximum and minimum number of rooms for each type. | SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"each",
"apartment",
"type",
"code",
",",
"and",
"the",
"maximum",
"and",
"minimum",
"number",
"of",
"rooms",
"for",
"each",
"type",
"."
] |
apartment_rentals | Return each apartment type code along with the maximum and minimum number of rooms among each type. | SELECT apt_type_code , max(room_count) , min(room_count) FROM Apartments GROUP BY apt_type_code | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Return",
"each",
"apartment",
"type",
"code",
"along",
"with",
"the",
"maximum",
"and",
"minimum",
"number",
"of",
"rooms",
"among",
"each",
"type",
"."
] |
apartment_rentals | Show each gender code and the corresponding count of guests sorted by the count in descending order. | SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"each",
"gender",
"code",
"and",
"the",
"corresponding",
"count",
"of",
"guests",
"sorted",
"by",
"the",
"count",
"in",
"descending",
"order",
"."
] |
apartment_rentals | Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts. | SELECT gender_code , COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Sort",
"the",
"gender",
"codes",
"in",
"descending",
"order",
"of",
"their",
"corresponding",
"number",
"of",
"guests",
".",
"Return",
"both",
"the",
"gender",
"codes",
"and",
"counts",
"."
] |
apartment_rentals | How many apartments do not have any facility? | SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities) | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"How",
"many",
"apartments",
"do",
"not",
"have",
"any",
"facility",
"?"
] |
apartment_rentals | Find the number of apartments that have no facility. | SELECT count(*) FROM Apartments WHERE apt_id NOT IN (SELECT apt_id FROM Apartment_Facilities) | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Find",
"the",
"number",
"of",
"apartments",
"that",
"have",
"no",
"facility",
"."
] |
apartment_rentals | Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed" | SELECT 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" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"apartment",
"numbers",
"of",
"apartments",
"with",
"bookings",
"that",
"have",
"status",
"code",
"both",
"``",
"Provisional",
"''",
"and",
"``",
"Confirmed",
"''"
] |
apartment_rentals | Which apartments have bookings with both status codes "Provisional" and "Confirmed"? Give me the apartment numbers. | SELECT 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" INTERSECT SELECT T2.apt_number FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional" | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartments",
"have",
"bookings",
"with",
"both",
"status",
"codes",
"``",
"Provisional",
"''",
"and",
"``",
"Confirmed",
"''",
"?",
"Give",
"me",
"the",
"apartment",
"numbers",
"."
] |
apartment_rentals | Show the apartment numbers of apartments with unit status availability of both 0 and 1. | SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Show",
"the",
"apartment",
"numbers",
"of",
"apartments",
"with",
"unit",
"status",
"availability",
"of",
"both",
"0",
"and",
"1",
"."
] |
apartment_rentals | Which apartments have unit status availability of both 0 and 1? Return their apartment numbers. | SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM Apartments AS T1 JOIN View_Unit_Status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1 | Apartment_Buildings: building_id (number), building_short_name (text), building_full_name (text), building_description (text), building_address (text), building_manager (text), building_phone (text) | Apartments: apt_id (number), building_id (number), apt_type_code (text), apt_number (text), bathroom_count (number), be... | [
"Which",
"apartments",
"have",
"unit",
"status",
"availability",
"of",
"both",
"0",
"and",
"1",
"?",
"Return",
"their",
"apartment",
"numbers",
"."
] |
game_injury | How many games are held after season 2007? | SELECT count(*) FROM game WHERE season > 2007 | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"How",
"many",
"games",
"are",
"held",
"after",
"season",
"2007",
"?"
] |
game_injury | List the dates of games by the home team name in descending order. | SELECT Date FROM game ORDER BY home_team DESC | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"List",
"the",
"dates",
"of",
"games",
"by",
"the",
"home",
"team",
"name",
"in",
"descending",
"order",
"."
] |
game_injury | List the season, home team, away team of all the games. | SELECT season , home_team , away_team FROM game | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"List",
"the",
"season",
",",
"home",
"team",
",",
"away",
"team",
"of",
"all",
"the",
"games",
"."
] |
game_injury | What are the maximum, minimum and average home games each stadium held? | SELECT max(home_games) , min(home_games) , avg(home_games) FROM stadium | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"What",
"are",
"the",
"maximum",
",",
"minimum",
"and",
"average",
"home",
"games",
"each",
"stadium",
"held",
"?"
] |
game_injury | What is the average attendance of stadiums with capacity percentage higher than 100%? | SELECT average_attendance FROM stadium WHERE capacity_percentage > 100 | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"What",
"is",
"the",
"average",
"attendance",
"of",
"stadiums",
"with",
"capacity",
"percentage",
"higher",
"than",
"100",
"%",
"?"
] |
game_injury | What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'? | SELECT player , number_of_matches , SOURCE FROM injury_accident WHERE injury != 'Knee problem' | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"What",
"are",
"the",
"player",
"name",
",",
"number",
"of",
"matches",
",",
"and",
"information",
"source",
"for",
"players",
"who",
"do",
"not",
"suffer",
"from",
"injury",
"of",
"'Knee",
"problem",
"'",
"?"
] |
game_injury | What is the season of the game which causes the player 'Walter Samuel' to get injured? | SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel' | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"What",
"is",
"the",
"season",
"of",
"the",
"game",
"which",
"causes",
"the",
"player",
"'Walter",
"Samuel",
"'",
"to",
"get",
"injured",
"?"
] |
game_injury | What are the ids, scores, and dates of the games which caused at least two injury accidents? | SELECT T1.id , T1.score , T1.date FROM game AS T1 JOIN injury_accident AS T2 ON T2.game_id = T1.id GROUP BY T1.id HAVING count(*) >= 2 | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"What",
"are",
"the",
"ids",
",",
"scores",
",",
"and",
"dates",
"of",
"the",
"games",
"which",
"caused",
"at",
"least",
"two",
"injury",
"accidents",
"?"
] |
game_injury | What are the id and name of the stadium where the most injury accidents happened? | SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"What",
"are",
"the",
"id",
"and",
"name",
"of",
"the",
"stadium",
"where",
"the",
"most",
"injury",
"accidents",
"happened",
"?"
] |
game_injury | Find the id and name of the stadium where the largest number of injury accidents occurred. | SELECT T1.id , T1.name FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id JOIN injury_accident AS T3 ON T2.id = T3.game_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"Find",
"the",
"id",
"and",
"name",
"of",
"the",
"stadium",
"where",
"the",
"largest",
"number",
"of",
"injury",
"accidents",
"occurred",
"."
] |
game_injury | In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'? | SELECT T1.season , T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.injury = 'Foot injury' OR T3.injury = 'Knee problem' | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"In",
"which",
"season",
"and",
"which",
"stadium",
"did",
"any",
"player",
"have",
"an",
"injury",
"of",
"'Foot",
"injury",
"'",
"or",
"'Knee",
"problem",
"'",
"?"
] |
game_injury | How many different kinds of information sources are there for injury accidents? | SELECT count(DISTINCT SOURCE) FROM injury_accident | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"How",
"many",
"different",
"kinds",
"of",
"information",
"sources",
"are",
"there",
"for",
"injury",
"accidents",
"?"
] |
game_injury | How many games are free of injury accidents? | SELECT count(*) FROM game WHERE id NOT IN ( SELECT game_id FROM injury_accident ) | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"How",
"many",
"games",
"are",
"free",
"of",
"injury",
"accidents",
"?"
] |
game_injury | How many distinct kinds of injuries happened after season 2010? | SELECT count(DISTINCT T1.injury) FROM injury_accident AS T1 JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.season > 2010 | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"How",
"many",
"distinct",
"kinds",
"of",
"injuries",
"happened",
"after",
"season",
"2010",
"?"
] |
game_injury | List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured. | SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player = 'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id WHERE T3.player =... | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"List",
"the",
"name",
"of",
"the",
"stadium",
"where",
"both",
"the",
"player",
"'Walter",
"Samuel",
"'",
"and",
"the",
"player",
"'Thiago",
"Motta",
"'",
"got",
"injured",
"."
] |
game_injury | Show the name, average attendance, total attendance for stadiums where no accidents happened. | SELECT name , average_attendance , total_attendance FROM stadium EXCEPT SELECT T2.name , T2.average_attendance , T2.total_attendance FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.id JOIN injury_accident AS T3 ON T1.id = T3.game_id | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"Show",
"the",
"name",
",",
"average",
"attendance",
",",
"total",
"attendance",
"for",
"stadiums",
"where",
"no",
"accidents",
"happened",
"."
] |
game_injury | Which stadium name contains the substring "Bank"? | SELECT name FROM stadium WHERE name LIKE "%Bank%" | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"Which",
"stadium",
"name",
"contains",
"the",
"substring",
"``",
"Bank",
"''",
"?"
] |
game_injury | How many games has each stadium held? | SELECT T1.id , count(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"How",
"many",
"games",
"has",
"each",
"stadium",
"held",
"?"
] |
game_injury | For each injury accident, find the date of the game and the name of the injured player in the game, and sort the results in descending order of game season. | SELECT T1.date , T2.player FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id ORDER BY T1.season DESC | stadium: id (number), name (text), Home_Games (number), Average_Attendance (number), Total_Attendance (number), Capacity_Percentage (number) | game: stadium_id (number), id (number), Season (number), Date (text), Home_team (text), Away_team (text), Score (text), Competition (text) | injury_accident: game_id (number), i... | [
"For",
"each",
"injury",
"accident",
",",
"find",
"the",
"date",
"of",
"the",
"game",
"and",
"the",
"name",
"of",
"the",
"injured",
"player",
"in",
"the",
"game",
",",
"and",
"sort",
"the",
"results",
"in",
"descending",
"order",
"of",
"game",
"season",
... |
soccer_1 | List all country and league names. | SELECT T1.name , T2.name FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"List",
"all",
"country",
"and",
"league",
"names",
"."
] |
soccer_1 | How many leagues are there in England? | SELECT count(*) FROM Country AS T1 JOIN League AS T2 ON T1.id = T2.country_id WHERE T1.name = "England" | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"How",
"many",
"leagues",
"are",
"there",
"in",
"England",
"?"
] |
soccer_1 | What is the average weight of all players? | SELECT avg(weight) FROM Player | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"What",
"is",
"the",
"average",
"weight",
"of",
"all",
"players",
"?"
] |
soccer_1 | What is the maximum and minimum height of all players? | SELECT max(weight) , min(weight) FROM Player | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"What",
"is",
"the",
"maximum",
"and",
"minimum",
"height",
"of",
"all",
"players",
"?"
] |
soccer_1 | List all player names who have an overall rating higher than the average. | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.overall_rating > ( SELECT avg(overall_rating) FROM Player_Attributes ) | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"List",
"all",
"player",
"names",
"who",
"have",
"an",
"overall",
"rating",
"higher",
"than",
"the",
"average",
"."
] |
soccer_1 | What are the names of players who have the best dribbling? | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.dribbling = ( SELECT max(overall_rating) FROM Player_Attributes) | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"What",
"are",
"the",
"names",
"of",
"players",
"who",
"have",
"the",
"best",
"dribbling",
"?"
] |
soccer_1 | List the names of all players who have a crossing score higher than 90 and prefer their right foot. | SELECT DISTINCT T1.player_name FROM Player AS T1 JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T2.crossing > 90 AND T2.preferred_foot = "right" | Player_Attributes: id (number), player_fifa_api_id (number), player_api_id (number), date (text), overall_rating (number), potential (number), preferred_foot (text), attacking_work_rate (text), defensive_work_rate (text), crossing (number), finishing (number), heading_accuracy (number), short_passing (number), volleys ... | [
"List",
"the",
"names",
"of",
"all",
"players",
"who",
"have",
"a",
"crossing",
"score",
"higher",
"than",
"90",
"and",
"prefer",
"their",
"right",
"foot",
"."
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.