db_id
stringlengths
4
31
text
stringlengths
398
4.9k
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the short names of the buildings managed by "Emma". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select building_short_name from apartment_buildings where building_manager = 'Emma'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which buildings does "Emma" manage? Give me the short names of the buildings. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select building_short_name from apartment_buildings where building_manager = 'Emma'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the addresses and phones of all the buildings managed by "Brenden". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select building_address , building_phone from apartment_buildings where building_manager = 'Brenden'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the address and phone number of the buildings managed by "Brenden"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select building_address , building_phone from apartment_buildings where building_manager = 'Brenden'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the building full names that contain the word "court"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ like _ | select building_full_name from apartment_buildings where building_full_name like '%court%'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find all the building full names containing the word "court". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ like _ | select building_full_name from apartment_buildings where building_full_name like '%court%'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the minimum and maximum number of bathrooms of all the apartments? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select min ( _ ) , max ( _ ) from _ | select min ( bathroom_count ) , max ( bathroom_count ) from apartments
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Give me the minimum and maximum bathroom count among all the apartments. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select min ( _ ) , max ( _ ) from _ | select min ( bathroom_count ) , max ( bathroom_count ) from apartments
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average number of bedrooms of all apartments? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select avg ( _ ) from _ | select avg ( bedroom_count ) from apartments
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the average number of bedrooms of all the apartments. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select avg ( _ ) from _ | select avg ( bedroom_count ) from apartments
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the apartment number and the number of rooms for each apartment. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select apt_number , room_count from apartments
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the apartment number and the room count of each apartment? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select apt_number , room_count from apartments
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average number of rooms of apartments with type code "Studio"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select avg ( _ ) from _ where _ | select avg ( room_count ) from apartments where apt_type_code = 'Studio'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the average room count of the apartments that have the "Studio" type code. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select avg ( _ ) from _ where _ | select avg ( room_count ) from apartments where apt_type_code = 'Studio'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the apartment numbers of the apartments with type code "Flat". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apt_number from apartments where apt_type_code = 'Flat'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartments have type code "Flat"? Give me their apartment numbers. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apt_number from apartments where apt_type_code = 'Flat'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the first names and last names of all guests | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select guest_first_name , guest_last_name from guests
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the first names and last names of all the guests? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select guest_first_name , guest_last_name from guests
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the date of birth for all the guests with gender code "Male". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select date_of_birth from guests where gender_code = 'Male'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are dates of birth of all the guests whose gender is "Male"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select date_of_birth from guests where gender_code = 'Male'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the apartment numbers, start dates, and end dates of all the apartment bookings. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select apartments.apt_number , apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the apartment number, start date, and end date of each apartment booking? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select apartments.apt_number , apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the booking start and end dates of the apartments with type code "Duplex"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartments.apt_type_code = 'Duplex'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the booking start date and end date for the apartments that have type code "Duplex". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartments.apt_type_code = 'Duplex'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the booking start and end dates of the apartments with more than 2 bedrooms? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartments.bedroom_count > 2
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the booking start date and end date for the apartments that have more than two bedrooms. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartments.bedroom_count > 2
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the booking status code of the apartment with apartment number "Suite 634"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_status_code from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartments.apt_number = 'Suite 634'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Tell me the booking status code for the apartment with number "Suite 634". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_status_code from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartments.apt_number = 'Suite 634'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the distinct apartment numbers of the apartments that have bookings with status code "Confirmed". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select distinct _ from _ where _ | select distinct apartments.apt_number from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Confirmed'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartments have bookings with status code "Confirmed"? Return their apartment numbers. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select distinct _ from _ where _ | select distinct apartments.apt_number from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Confirmed'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the average room count of the apartments that have booking status code "Provisional". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select avg ( _ ) from _ where _ | select avg ( room_count ) from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Provisional'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average room count of the apartments whose booking status code is "Provisional"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select avg ( _ ) from _ where _ | select avg ( room_count ) from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Provisional'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the guest first names, start dates, and end dates of all the apartment bookings. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select guests.guest_first_name , apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join guests on apartment_bookings.guest_id = guests.guest_id
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the guest first name, start date, and end date of each apartment booking? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ | select guests.guest_first_name , apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join guests on apartment_bookings.guest_id = guests.guest_id
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the start dates and end dates of all the apartment bookings made by guests with gender code "Female". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join guests on apartment_bookings.guest_id = guests.guest_id where guests.gender_code = 'Female'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the start date and end date of the apartment bookings made by female guests (gender code "Female")? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_bookings.booking_start_date , apartment_bookings.booking_start_date from apartment_bookings join guests on apartment_bookings.guest_id = guests.guest_id where guests.gender_code = 'Female'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the first names and last names of all the guests that have apartment bookings with status code "Confirmed". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select guests.guest_first_name , guests.guest_last_name from apartment_bookings join guests on apartment_bookings.guest_id = guests.guest_id where apartment_bookings.booking_status_code = 'Confirmed'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which guests have apartment bookings with status code "Confirmed"? Return their first names and last names. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select guests.guest_first_name , guests.guest_last_name from apartment_bookings join guests on apartment_bookings.guest_id = guests.guest_id where apartment_bookings.booking_status_code = 'Confirmed'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the facility codes of apartments with more than 4 bedrooms. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_facilities.facility_code from apartment_facilities join apartments on apartment_facilities.apt_id = apartments.apt_id where apartments.bedroom_count > 4
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the facility codes of the apartments with more than four bedrooms? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_facilities.facility_code from apartment_facilities join apartments on apartment_facilities.apt_id = apartments.apt_id where apartments.bedroom_count > 4
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the total number of rooms of all apartments with facility code "Gym". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select sum ( _ ) from _ where _ | select sum ( apartments.room_count ) from apartment_facilities join apartments on apartment_facilities.apt_id = apartments.apt_id where apartment_facilities.facility_code = 'Gym'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the total number of rooms in the apartments that have facility code "Gym". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select sum ( _ ) from _ where _ | select sum ( apartments.room_count ) from apartment_facilities join apartments on apartment_facilities.apt_id = apartments.apt_id where apartment_facilities.facility_code = 'Gym'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the total number of rooms of the apartments in the building with short name "Columbus Square". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select sum ( _ ) from _ where _ | select sum ( apartments.room_count ) from apartment_buildings join apartments on apartment_buildings.building_id = apartments.building_id where apartment_buildings.building_short_name = 'Columbus Square'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many rooms in total are there in the apartments in the building with short name "Columbus Square"? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select sum ( _ ) from _ where _ | select sum ( apartments.room_count ) from apartment_buildings join apartments on apartment_buildings.building_id = apartments.building_id where apartment_buildings.building_short_name = 'Columbus Square'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the addresses of the buildings that have apartments with more than 2 bathrooms. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_buildings.building_address from apartment_buildings join apartments on apartment_buildings.building_id = apartments.building_id where apartments.bathroom_count > 2
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which buildings have apartments that have more than two bathrooms? Give me the addresses of the buildings. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartment_buildings.building_address from apartment_buildings join apartments on apartment_buildings.building_id = apartments.building_id where apartments.bathroom_count > 2
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the apartment type codes and apartment numbers in the buildings managed by "Kyle". | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartments.apt_type_code , apartments.apt_number from apartment_buildings join apartments on apartment_buildings.building_id = apartments.building_id where apartment_buildings.building_manager = 'Kyle'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What apartment type codes and apartment numbers do the buildings managed by "Kyle" have? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ | select apartments.apt_type_code , apartments.apt_number from apartment_buildings join apartments on apartment_buildings.building_id = apartments.building_id where apartment_buildings.building_manager = 'Kyle'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the booking status code and the corresponding number of bookings. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , count ( _ ) from _ group by _ | select booking_status_code , count ( * ) from apartment_bookings group by booking_status_code
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many bookings does each booking status have? List the booking status code and the number of corresponding bookings. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , count ( _ ) from _ group by _ | select booking_status_code , count ( * ) from apartment_bookings group by booking_status_code
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return all the apartment numbers sorted by the room count in ascending order. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ order by _ asc | select apt_number from apartments order by room_count asc
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Sort the apartment numbers in ascending order of room count. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ order by _ asc | select apt_number from apartments order by room_count asc
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return the apartment number with the largest number of bedrooms. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ order by _ desc limit _ | select apt_number from apartments order by bedroom_count desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the apartment number of the apartment with the most beds? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ order by _ desc limit _ | select apt_number from apartments order by bedroom_count desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the apartment type codes and the corresponding number of apartments sorted by the number of apartments in ascending order. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , count ( _ ) from _ group by _ order by count ( _ ) asc | select apt_type_code , count ( * ) from apartments group by apt_type_code order by count ( * ) asc
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return each apartment type code with the number of apartments having that apartment type, in ascending order of the number of apartments. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , count ( _ ) from _ group by _ order by count ( _ ) asc | select apt_type_code , count ( * ) from apartments group by apt_type_code order by count ( * ) asc
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the top 3 apartment type codes sorted by the average number of rooms in descending order. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ group by _ order by avg ( _ ) desc limit _ | select apt_type_code from apartments group by apt_type_code order by avg ( room_count ) desc limit 3
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the top three apartment types in terms of the average room count? Give me the | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ group by _ order by avg ( _ ) desc limit _ | select apt_type_code from apartments group by apt_type_code order by avg ( room_count ) desc limit 3
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the apartment type code that has the largest number of total rooms, together with the number of bathrooms and number of bedrooms. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ group by _ order by sum ( _ ) desc limit _ | select apt_type_code , bathroom_count , bedroom_count from apartments group by apt_type_code order by sum ( room_count ) desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartment type has the largest number of total rooms? Return the apartment type code, its number of bathrooms and number of bedrooms. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ group by _ order by sum ( _ ) desc limit _ | select apt_type_code , bathroom_count , bedroom_count from apartments group by apt_type_code order by sum ( room_count ) desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the most common apartment type code. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ group by _ order by count ( _ ) desc limit _ | select apt_type_code from apartments group by apt_type_code order by count ( * ) desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartment type code appears the most often? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ group by _ order by count ( _ ) desc limit _ | select apt_type_code from apartments group by apt_type_code order by count ( * ) desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the most common apartment type code among apartments with more than 1 bathroom. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ group by _ order by count ( _ ) desc limit _ | select apt_type_code from apartments where bathroom_count > 1 group by apt_type_code order by count ( * ) desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartment type code is the most common among apartments with more than one bathroom? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ group by _ order by count ( _ ) desc limit _ | select apt_type_code from apartments where bathroom_count > 1 group by apt_type_code order by count ( * ) desc limit 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show each apartment type code, and the maximum and minimum number of rooms for each type. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , max ( _ ) , min ( _ ) from _ group by _ | select apt_type_code , max ( room_count ) , min ( room_count ) from apartments group by apt_type_code
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Return each apartment type code along with the maximum and minimum number of rooms among each type. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , max ( _ ) , min ( _ ) from _ group by _ | select apt_type_code , max ( room_count ) , min ( room_count ) from apartments group by apt_type_code
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show each gender code and the corresponding count of guests sorted by the count in descending order. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , count ( _ ) from _ group by _ order by count ( _ ) desc | select gender_code , count ( * ) from guests group by gender_code order by count ( * ) desc
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ , count ( _ ) from _ group by _ order by count ( _ ) desc | select gender_code , count ( * ) from guests group by gender_code order by count ( * ) desc
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many apartments do not have any facility? | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from apartments where apt_id not in ( select apt_id from apartment_facilities )
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the number of apartments that have no facility. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from apartments where apt_id not in ( select apt_id from apartment_facilities )
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the apartment numbers of apartments with bookings that have status code both "Provisional" and "Confirmed" | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ intersect select _ from _ where _ | select apartments.apt_number from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Confirmed' intersect select apartments.apt_number from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Provisional'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartments have bookings with both status codes "Provisional" and "Confirmed"? Give me the apartment numbers. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ intersect select _ from _ where _ | select apartments.apt_number from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Confirmed' intersect select apartments.apt_number from apartment_bookings join apartments on apartment_bookings.apt_id = apartments.apt_id where apartment_bookings.booking_status_code = 'Provisional'
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the apartment numbers of apartments with unit status availability of both 0 and 1. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ intersect select _ from _ where _ | select apartments.apt_number from apartments join view_unit_status on apartments.apt_id = view_unit_status.apt_id where view_unit_status.available_yn = 0 intersect select apartments.apt_number from apartments join view_unit_status on apartments.apt_id = view_unit_status.apt_id where view_unit_status.available_yn = 1
apartment_rentals
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which apartments have unit status availability of both 0 and 1? Return their apartment numbers. | 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 | apartment_facilities : apt_id , facility_code | guests : guest_id , gender_code , guest_first_name , guest_last_name , date_of_birth | apartment_bookings : apt_booking_id , apt_id , guest_id , booking_status_code , booking_start_date , booking_end_date | view_unit_status : apt_id , apt_booking_id , status_date , available_yn | apartments.building_id = apartment_buildings.building_id | apartment_facilities.apt_id = apartments.apt_id | apartment_bookings.guest_id = guests.guest_id | apartment_bookings.apt_id = apartments.apt_id | view_unit_status.apt_booking_id = apartment_bookings.apt_booking_id | view_unit_status.apt_id = apartments.apt_id | ### Response: select _ from _ where _ intersect select _ from _ where _ | select apartments.apt_number from apartments join view_unit_status on apartments.apt_id = view_unit_status.apt_id where view_unit_status.available_yn = 0 intersect select apartments.apt_number from apartments join view_unit_status on apartments.apt_id = view_unit_status.apt_id where view_unit_status.available_yn = 1
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many games are held after season 2007? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select count ( _ ) from _ where _ | select count ( * ) from game where season > 2007
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the dates of games by the home team name in descending order. | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ order by _ desc | select date from game order by home_team desc
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the season, home team, away team of all the games. | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ | select season , home_team , away_team from game
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the maximum, minimum and average home games each stadium held? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select max ( _ ) , min ( _ ) , avg ( _ ) from _ | select max ( home_games ) , min ( home_games ) , avg ( home_games ) from stadium
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average attendance of stadiums with capacity percentage higher than 100%? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ where _ | select average_attendance from stadium where capacity_percentage > 100
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the player name, number of matches, and information source for players who do not suffer from injury of 'Knee problem'? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ where _ | select player , number_of_matches , source from injury_accident where injury != 'Knee problem'
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the season of the game which causes the player 'Walter Samuel' to get injured? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ where _ | select game.season from game join injury_accident on game.id = injury_accident.game_id where injury_accident.player = 'Walter Samuel'
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the ids, scores, and dates of the games which caused at least two injury accidents? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ group by _ having count ( _ ) >= _ | select game.id , game.score , game.date from game join injury_accident on injury_accident.game_id = game.id group by game.id having count ( * ) >= 2
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the id and name of the stadium where the most injury accidents happened? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ group by _ order by count ( _ ) desc limit _ | select stadium.id , stadium.name from stadium join game on stadium.id = game.stadium_id join injury_accident on game.id = injury_accident.game_id group by stadium.id order by count ( * ) desc limit 1
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the id and name of the stadium where the largest number of injury accidents occurred. | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ group by _ order by count ( _ ) desc limit _ | select stadium.id , stadium.name from stadium join game on stadium.id = game.stadium_id join injury_accident on game.id = injury_accident.game_id group by stadium.id order by count ( * ) desc limit 1
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: In which season and which stadium did any player have an injury of 'Foot injury' or 'Knee problem'? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ where _ | select game.season , stadium.name from game join stadium on game.stadium_id = stadium.id join injury_accident on game.id = injury_accident.game_id where injury_accident.injury = 'Foot injury' or injury_accident.injury = 'Knee problem'
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many different kinds of information sources are there for injury accidents? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select count ( distinct _ ) from _ | select count ( distinct source ) from injury_accident
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many games are free of injury accidents? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select count ( _ ) from _ where _ not in ( select _ from _ ) | select count ( * ) from game where id not in ( select game_id from injury_accident )
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many distinct kinds of injuries happened after season 2010? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select count ( distinct _ ) from _ where _ | select count ( distinct injury_accident.injury ) from injury_accident join game on injury_accident.game_id = game.id where game.season > 2010
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured. | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ where _ intersect select _ from _ where _ | select stadium.name from game join stadium on game.stadium_id = stadium.id join injury_accident on game.id = injury_accident.game_id where injury_accident.player = 'Walter Samuel' intersect select stadium.name from game join stadium on game.stadium_id = stadium.id join injury_accident on game.id = injury_accident.game_id where injury_accident.player = 'Thiago Motta'
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the name, average attendance, total attendance for stadiums where no accidents happened. | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ except select _ from _ | select name , average_attendance , total_attendance from stadium except select stadium.name , stadium.average_attendance , stadium.total_attendance from game join stadium on game.stadium_id = stadium.id join injury_accident on game.id = injury_accident.game_id
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which stadium name contains the substring "Bank"? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ where _ like _ | select name from stadium where name like '%Bank%'
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many games has each stadium held? | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ , count ( _ ) from _ group by _ | select stadium.id , count ( * ) from stadium join game on stadium.id = game.stadium_id group by stadium.id
game_injury
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: 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. | 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 | game.stadium_id = stadium.id | injury_accident.game_id = game.id | ### Response: select _ from _ order by _ desc | select game.date , injury_accident.player from game join injury_accident on game.id = injury_accident.game_id order by game.season desc
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List all country and league names. | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select _ from _ | select country.name , league.name from country join league on country.id = league.country_id
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many leagues are there in England? | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select count ( _ ) from _ where _ | select count ( * ) from country join league on country.id = league.country_id where country.name = 'England'
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the average weight of all players? | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select avg ( _ ) from _ | select avg ( weight ) from player
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the maximum and minimum height of all players? | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select max ( _ ) , min ( _ ) from _ | select max ( weight ) , min ( weight ) from player
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List all player names who have an overall rating higher than the average. | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select distinct _ from _ where _ > ( select avg ( _ ) from _ ) | select distinct player.player_name from player join player_attributes on player.player_api_id = player_attributes.player_api_id where player_attributes.overall_rating > ( select avg ( overall_rating ) from player_attributes )
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of players who have the best dribbling? | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select distinct _ from _ where _ = ( select max ( _ ) from _ ) | select distinct player.player_name from player join player_attributes on player.player_api_id = player_attributes.player_api_id where player_attributes.dribbling = ( select max ( overall_rating ) from player_attributes )
soccer_1
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the names of all players who have a crossing score higher than 90 and prefer their right foot. | 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 , ball_control , acceleration , sprint_speed , agility , reactions , balance , shot_power , jumping , stamina , strength , long_shots , aggression , interceptions , positioning , vision , penalties , marking , standing_tackle , sliding_tackle , gk_diving , gk_handling , gk_kicking , gk_positioning , gk_reflexes | sqlite_sequence : name , seq | player : id , player_api_id , player_name , player_fifa_api_id , birthday , height , weight | league : id , country_id , name | country : id , name | team : id , team_api_id , team_fifa_api_id , team_long_name , team_short_name | team_attributes : id , team_fifa_api_id , team_api_id , date , buildupplayspeed , buildupplayspeedclass , buildupplaydribbling , buildupplaydribblingclass , buildupplaypassing , buildupplaypassingclass , buildupplaypositioningclass , chancecreationpassing , chancecreationpassingclass , chancecreationcrossing , chancecreationcrossingclass , chancecreationshooting , chancecreationshootingclass , chancecreationpositioningclass , defencepressure , defencepressureclass , defenceaggression , defenceaggressionclass , defenceteamwidth , defenceteamwidthclass , defencedefenderlineclass | player_attributes.player_api_id = player.player_api_id | player_attributes.player_fifa_api_id = player.player_fifa_api_id | league.country_id = country.id | team_attributes.team_api_id = team.team_api_id | team_attributes.team_fifa_api_id = team.team_fifa_api_id | ### Response: select distinct _ from _ where _ | select distinct player.player_name from player join player_attributes on player.player_api_id = player_attributes.player_api_id where player_attributes.crossing > 90 and player_attributes.preferred_foot = 'right'