db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
apartment_rentals | select building_short_name from apartment_buildings where building_manager = 'emma' | Question: show the short names of the buildings managed by 'emma'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count,... | show the short names of the buildings managed by 'emma'. |
apartment_rentals | 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. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_... | which buildings does 'emma' manage? give me the short names of the buildings. |
apartment_rentals | select building_address , building_phone from apartment_buildings where building_manager = 'brenden' | Question: show the addresses and phones of all the buildings managed by 'brenden'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count... | show the addresses and phones of all the buildings managed by 'brenden'. |
apartment_rentals | 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'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_c... | what are the address and phone number of the buildings managed by 'brenden'? |
apartment_rentals | select building_full_name from apartment_buildings where building_full_name like '%court%' | Question: what are the building full names that contain the word 'court'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom... | what are the building full names that contain the word 'court'? |
apartment_rentals | select building_full_name from apartment_buildings where building_full_name like '%court%' | Question: find all the building full names containing the word 'court'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_c... | find all the building full names containing the word 'court'. |
apartment_rentals | select min(bathroom_count) , max(bathroom_count) from apartments | Question: what is the minimum and maximum number of bathrooms of all the apartments? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_cou... | what is the minimum and maximum number of bathrooms of all the apartments? |
apartment_rentals | select min(bathroom_count) , max(bathroom_count) from apartments | Question: give me the minimum and maximum bathroom count among all the apartments. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count... | give me the minimum and maximum bathroom count among all the apartments. |
apartment_rentals | select avg(bedroom_count) from apartments | Question: what is the average number of bedrooms of all apartments? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count... | what is the average number of bedrooms of all apartments? |
apartment_rentals | select avg(bedroom_count) from apartments | Question: find the average number of bedrooms of all the apartments. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_coun... | find the average number of bedrooms of all the apartments. |
apartment_rentals | select apt_number , room_count from apartments | Question: return the apartment number and the number of rooms for each apartment. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count,... | return the apartment number and the number of rooms for each apartment. |
apartment_rentals | select apt_number , room_count from apartments | Question: what are the apartment number and the room count of each apartment? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bed... | what are the apartment number and the room count of each apartment? |
apartment_rentals | select avg(room_count) from apartments where apt_type_code = 'studio' | Question: what is the average number of rooms of apartments with type code 'studio'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_cou... | what is the average number of rooms of apartments with type code 'studio'? |
apartment_rentals | 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. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroo... | find the average room count of the apartments that have the 'studio' type code. |
apartment_rentals | select apt_number from apartments where apt_type_code = 'flat' | Question: return the apartment numbers of the apartments with type code 'flat'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, b... | return the apartment numbers of the apartments with type code 'flat'. |
apartment_rentals | select apt_number from apartments where apt_type_code = 'flat' | Question: which apartments have type code 'flat'? give me their apartment numbers. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count... | which apartments have type code 'flat'? give me their apartment numbers. |
apartment_rentals | select guest_first_name , guest_last_name from guests | Question: return the first names and last names of all guests | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room... | return the first names and last names of all guests |
apartment_rentals | select guest_first_name , guest_last_name from guests | Question: what are the first names and last names of all the guests? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_coun... | what are the first names and last names of all the guests? |
apartment_rentals | select date_of_birth from guests where gender_code = 'male' | Question: return the date of birth for all the guests with gender code 'male'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, be... | return the date of birth for all the guests with gender code 'male'. |
apartment_rentals | select date_of_birth from guests where gender_code = 'male' | Question: what are dates of birth of all the guests whose gender is 'male'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedro... | what are dates of birth of all the guests whose gender is 'male'? |
apartment_rentals | 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: show the apartment numbers, start dates, and end dates of all the apartment bookings. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, b... | show the apartment numbers, start dates, and end dates of all the apartment bookings. |
apartment_rentals | 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? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bath... | what are the apartment number, start date, and end date of each apartment booking? |
apartment_rentals | 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 type code 'duplex'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bat... | what are the booking start and end dates of the apartments with type code 'duplex'? |
apartment_rentals | 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'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_num... | return the booking start date and end date for the apartments that have type code 'duplex'. |
apartment_rentals | 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 are the booking start and end dates of the apartments with more than 2 bedrooms? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, b... | what are the booking start and end dates of the apartments with more than 2 bedrooms? |
apartment_rentals | 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. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_n... | find the booking start date and end date for the apartments that have more than two bedrooms. |
apartment_rentals | 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: what is the booking status code of the apartment with apartment number 'suite 634'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bat... | what is the booking status code of the apartment with apartment number 'suite 634'? |
apartment_rentals | 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'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_cou... | tell me the booking status code for the apartment with number 'suite 634'. |
apartment_rentals | 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: show the distinct apartment numbers of the apartments that have bookings with status code 'confirmed'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_co... | show the distinct apartment numbers of the apartments that have bookings with status code 'confirmed'. |
apartment_rentals | 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. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_nu... | which apartments have bookings with status code 'confirmed'? return their apartment numbers. |
apartment_rentals | 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' | Question: show the average room count of the apartments that have booking status code 'provisional'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_numb... | show the average room count of the apartments that have booking status code 'provisional'. |
apartment_rentals | 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' | Question: what is the average room count of the apartments whose booking status code is 'provisional'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_nu... | what is the average room count of the apartments whose booking status code is 'provisional'? |
apartment_rentals | 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 | Question: show the guest first names, start dates, and end dates of all the apartment bookings. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, b... | show the guest first names, start dates, and end dates of all the apartment bookings. |
apartment_rentals | 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 | Question: what are the guest first name, start date, and end date of each apartment booking? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bath... | what are the guest first name, start date, and end date of each apartment booking? |
apartment_rentals | 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' | Question: show the start dates and end dates of all the apartment bookings made by guests with gender code 'female'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_typ... | show the start dates and end dates of all the apartment bookings made by guests with gender code 'female'. |
apartment_rentals | 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' | Question: what are the start date and end date of the apartment bookings made by female guests (gender code 'female')? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_t... | what are the start date and end date of the apartment bookings made by female guests (gender code 'female')? |
apartment_rentals | 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' | Question: show the first names and last names of all the guests that have apartment bookings with status code 'confirmed'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, a... | show the first names and last names of all the guests that have apartment bookings with status code 'confirmed'. |
apartment_rentals | 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' | Question: which guests have apartment bookings with status code 'confirmed'? return their first names and last names. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_ty... | which guests have apartment bookings with status code 'confirmed'? return their first names and last names. |
apartment_rentals | 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 | Question: show the facility codes of apartments with more than 4 bedrooms. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroo... | show the facility codes of apartments with more than 4 bedrooms. |
apartment_rentals | 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 | Question: what are the facility codes of the apartments with more than four bedrooms? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_co... | what are the facility codes of the apartments with more than four bedrooms? |
apartment_rentals | 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' | Question: show the total number of rooms of all apartments with facility code 'gym'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_cou... | show the total number of rooms of all apartments with facility code 'gym'. |
apartment_rentals | 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' | Question: find the total number of rooms in the apartments that have facility code 'gym'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroo... | find the total number of rooms in the apartments that have facility code 'gym'. |
apartment_rentals | 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' | Question: show the total number of rooms of the apartments in the building with short name 'columbus square'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code,... | show the total number of rooms of the apartments in the building with short name 'columbus square'. |
apartment_rentals | 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' | Question: how many rooms in total are there in the apartments in the building with short name 'columbus square'? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_co... | how many rooms in total are there in the apartments in the building with short name 'columbus square'? |
apartment_rentals | 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 | Question: show the addresses of the buildings that have apartments with more than 2 bathrooms. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, ba... | show the addresses of the buildings that have apartments with more than 2 bathrooms. |
apartment_rentals | 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 | Question: which buildings have apartments that have more than two bathrooms? give me the addresses of the buildings. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_typ... | which buildings have apartments that have more than two bathrooms? give me the addresses of the buildings. |
apartment_rentals | 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' | Question: show the apartment type codes and apartment numbers in the buildings managed by 'kyle'. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number,... | show the apartment type codes and apartment numbers in the buildings managed by 'kyle'. |
apartment_rentals | 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' | Question: what apartment type codes and apartment numbers do the buildings managed by 'kyle' have? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number... | what apartment type codes and apartment numbers do the buildings managed by 'kyle' have? |
apartment_rentals | select booking_status_code , count(*) from apartment_bookings group by booking_status_code | Question: show the booking status code and the corresponding number of bookings. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, ... | show the booking status code and the corresponding number of bookings. |
apartment_rentals | select booking_status_code , count(*) from apartment_bookings group by booking_status_code | Question: how many bookings does each booking status have? list the booking status code and the number of corresponding bookings. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, buildin... | how many bookings does each booking status have? list the booking status code and the number of corresponding bookings. |
apartment_rentals | select apt_number from apartments order by room_count asc | Question: return all the apartment numbers sorted by the room count in ascending order. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_... | return all the apartment numbers sorted by the room count in ascending order. |
apartment_rentals | select apt_number from apartments order by room_count asc | Question: sort the apartment numbers in ascending order of room count. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_co... | sort the apartment numbers in ascending order of room count. |
apartment_rentals | select apt_number from apartments order by bedroom_count desc limit 1 | Question: return the apartment number with the largest number of bedrooms. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroo... | return the apartment number with the largest number of bedrooms. |
apartment_rentals | select apt_number from apartments order by bedroom_count desc limit 1 | Question: what is the apartment number of the apartment with the most beds? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedro... | what is the apartment number of the apartment with the most beds? |
apartment_rentals | select apt_type_code , count(*) from apartments group by apt_type_code order by count(*) asc | Question: show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id,... | show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. |
apartment_rentals | select apt_type_code , count(*) from apartments group by apt_type_code order by count(*) asc | Question: return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments ... | return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments. |
apartment_rentals | select apt_type_code from apartments group by apt_type_code order by avg(room_count) desc limit 3 | Question: show the top 3 apartment type codes sorted by the average number of rooms in descending order. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_... | show the top 3 apartment type codes sorted by the average number of rooms in descending order. |
apartment_rentals | select apt_type_code from apartments group by apt_type_code order by avg(room_count) desc limit 3 | Question: what are the top three apartment types in terms of the average room count? give me the | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, ... | what are the top three apartment types in terms of the average room count? give me the |
apartment_rentals | select apt_type_code , bathroom_count , bedroom_count from apartments group by apt_type_code order by sum(room_count) desc limit 1 | Question: show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> ... | 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 | select apt_type_code , bathroom_count , bedroom_count from apartments group by apt_type_code order by sum(room_count) desc limit 1 | Question: which apartment type has the largest number of total rooms? return the apartment type code, its number of bathrooms and number of bedrooms. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartment... | 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 | select apt_type_code from apartments group by apt_type_code order by count(*) desc limit 1 | Question: show the most common apartment type code. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count. Ap... | show the most common apartment type code. |
apartment_rentals | select apt_type_code from apartments group by apt_type_code order by count(*) desc limit 1 | Question: which apartment type code appears the most often? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_c... | which apartment type code appears the most often? |
apartment_rentals | select apt_type_code from apartments where bathroom_count > 1 group by apt_type_code order by count(*) desc limit 1 | Question: show the most common apartment type code among apartments with more than 1 bathroom. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, ba... | show the most common apartment type code among apartments with more than 1 bathroom. |
apartment_rentals | select apt_type_code from apartments where bathroom_count > 1 group by apt_type_code order by count(*) desc limit 1 | Question: which apartment type code is the most common among apartments with more than one bathroom? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_numb... | which apartment type code is the most common among apartments with more than one bathroom? |
apartment_rentals | select apt_type_code , max(room_count) , min(room_count) from apartments group by apt_type_code | Question: show each apartment type code, and the maximum and minimum number of rooms for each type. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_numbe... | show each apartment type code, and the maximum and minimum number of rooms for each type. |
apartment_rentals | select apt_type_code , max(room_count) , min(room_count) from apartments group by apt_type_code | Question: return each apartment type code along with the maximum and minimum number of rooms among each type. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code,... | return each apartment type code along with the maximum and minimum number of rooms among each type. |
apartment_rentals | select gender_code , count(*) from guests group by gender_code order by count(*) desc | Question: show each gender code and the corresponding count of guests sorted by the count in descending order. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code... | show each gender code and the corresponding count of guests sorted by the count in descending order. |
apartment_rentals | select gender_code , count(*) from guests group by gender_code order by count(*) desc | Question: sort the gender codes in descending order of their corresponding number of guests. return both the gender codes and counts. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, bui... | sort the gender codes in descending order of their corresponding number of guests. return both the gender codes and counts. |
apartment_rentals | select count(*) from apartments where apt_id not in (select apt_id from apartment_facilities) | Question: how many apartments do not have any facility? | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count... | how many apartments do not have any facility? |
apartment_rentals | select count(*) from apartments where apt_id not in (select apt_id from apartment_facilities) | Question: find the number of apartments that have no facility. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, roo... | find the number of apartments that have no facility. |
apartment_rentals | 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' | Question: show the apartment numbers of apartments with bookings that have status code both 'provisional' and 'confirmed' | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, ap... | show the apartment numbers of apartments with bookings that have status code both 'provisional' and 'confirmed' |
apartment_rentals | 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' | Question: which apartments have bookings with both status codes 'provisional' and 'confirmed'? give me the apartment numbers. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id... | which apartments have bookings with both status codes 'provisional' and 'confirmed'? give me the apartment numbers. |
apartment_rentals | 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 | Question: show the apartment numbers of apartments with unit status availability of both 0 and 1. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt_number,... | show the apartment numbers of apartments with unit status availability of both 0 and 1. |
apartment_rentals | 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 | Question: which apartments have unit status availability of both 0 and 1? return their apartment numbers. | Tables: Apartment_Buildings -> building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone. Apartments -> apt_id, building_id, apt_type_code, apt... | which apartments have unit status availability of both 0 and 1? return their apartment numbers. |
game_injury | select count(*) from game where season > 2007 | Question: how many games are held after season 2007? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_matches, Source. | Joins: g... | how many games are held after season 2007? |
game_injury | select date from game order by home_team desc | Question: list the dates of games by the home team name in descending order. | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_mat... | list the dates of games by the home team name in descending order. |
game_injury | select season , home_team , away_team from game | Question: list the season, home team, away team of all the games. | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_matches, Sourc... | list the season, home team, away team of all the games. |
game_injury | select max(home_games) , min(home_games) , avg(home_games) from stadium | Question: what are the maximum, minimum and average home games each stadium held? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_o... | what are the maximum, minimum and average home games each stadium held? |
game_injury | select average_attendance from stadium where capacity_percentage > 100 | Question: what is the average attendance of stadiums with capacity percentage higher than 100%? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, In... | what is the average attendance of stadiums with capacity percentage higher than 100%? |
game_injury | select player , number_of_matches , source from injury_accident where injury != 'knee problem' | Question: what are the player name, number of matches, and information source for players who do not suffer from injury of 'knee problem'? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition.... | what are the player name, number of matches, and information source for players who do not suffer from injury of 'knee problem'? |
game_injury | select t1.season from game as t1 join injury_accident as t2 on t1.id = t2.game_id where t2.player = 'walter samuel' | Question: what is the season of the game which causes the player 'walter samuel' to get injured? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, I... | what is the season of the game which causes the player 'walter samuel' to get injured? |
game_injury | 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 | Question: what are the ids, scores, and dates of the games which caused at least two injury accidents? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Pla... | what are the ids, scores, and dates of the games which caused at least two injury accidents? |
game_injury | 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 | Question: what are the id and name of the stadium where the most injury accidents happened? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury... | what are the id and name of the stadium where the most injury accidents happened? |
game_injury | 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 | Question: find the id and name of the stadium where the largest number of injury accidents occurred. | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Playe... | find the id and name of the stadium where the largest number of injury accidents occurred. |
game_injury | 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' | Question: in which season and which stadium did any player have an injury of 'foot injury' or 'knee problem'? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, ... | in which season and which stadium did any player have an injury of 'foot injury' or 'knee problem'? |
game_injury | select count(distinct source) from injury_accident | Question: how many different kinds of information sources are there for injury accidents? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, ... | how many different kinds of information sources are there for injury accidents? |
game_injury | select count(*) from game where id not in ( select game_id from injury_accident ) | Question: how many games are free of injury accidents? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_matches, Source. | Joins:... | how many games are free of injury accidents? |
game_injury | select count(distinct t1.injury) from injury_accident as t1 join game as t2 on t1.game_id = t2.id where t2.season > 2010 | Question: how many distinct kinds of injuries happened after season 2010? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_matche... | how many distinct kinds of injuries happened after season 2010? |
game_injury | 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 =... | Question: list the name of the stadium where both the player 'walter samuel' and the player 'thiago motta' got injured. | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident ->... | list the name of the stadium where both the player 'walter samuel' and the player 'thiago motta' got injured. |
game_injury | 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 | Question: show the name, average attendance, total attendance for stadiums where no accidents happened. | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Pl... | show the name, average attendance, total attendance for stadiums where no accidents happened. |
game_injury | select name from stadium where name like '%bank%' | Question: which stadium name contains the substring 'bank'? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_matches, Source. | J... | which stadium name contains the substring 'bank'? |
game_injury | select t1.id , count(*) from stadium as t1 join game as t2 on t1.id = t2.stadium_id group by t1.id | Question: how many games has each stadium held? | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Away_team, Score, Competition. injury_accident -> game_id, id, Player, Injury, Number_of_matches, Source. | Joins: game.s... | how many games has each stadium held? |
game_injury | 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 | Question: 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. | Tables: stadium -> id, name, Home_Games, Average_Attendance, Total_Attendance, Capacity_Percentage. game -> stadium_id, id, Season, Date, Home_team, Aw... | 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 | select t1.name , t2.name from country as t1 join league as t2 on t1.id = t2.country_id | Question: list all country and league names. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, curve, free_kick_accuracy, long_passing,... | list all country and league names. |
soccer_1 | select count(*) from country as t1 join league as t2 on t1.id = t2.country_id where t1.name = 'england' | Question: how many leagues are there in england? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, curve, free_kick_accuracy, long_pass... | how many leagues are there in england? |
soccer_1 | select avg(weight) from player | Question: what is the average weight of all players? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, curve, free_kick_accuracy, long_... | what is the average weight of all players? |
soccer_1 | select max(weight) , min(weight) from player | Question: what is the maximum and minimum height of all players? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, curve, free_kick_acc... | what is the maximum and minimum height of all players? |
soccer_1 | 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 ) | Question: list all player names who have an overall rating higher than the average. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, c... | list all player names who have an overall rating higher than the average. |
soccer_1 | 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) | Question: what are the names of players who have the best dribbling? | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_passing, volleys, dribbling, curve, free_kick... | what are the names of players who have the best dribbling? |
soccer_1 | 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' | Question: list the names of all players who have a crossing score higher than 90 and prefer their right foot. | Tables: Player_Attributes -> id, player_fifa_api_id, player_api_id, date, overall_rating, potential, preferred_foot, attacking_work_rate, defensive_work_rate, crossing, finishing, heading_accuracy, short_pass... | 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.