richardr1126/spider-skeleton-context-instruct huggingface dataset:
### 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
### 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
### 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
### 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
### 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
### 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 )
### 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 )
### 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'
### 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'
### 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
### 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
### 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
### 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
### 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
### 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
### 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
### 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'
### 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'
### 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
### 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
### 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
### 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'
### 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
### 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 )
### 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
### 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'