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

### 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 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

### 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 name from stadium where name like '%Bank%'

### 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 stadium.id , count ( * ) from stadium join game on stadium.id = game.stadium_id group by stadium.id
### 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 game.date , injury_accident.player from game join injury_accident on game.id = injury_accident.game_id order by game.season desc
### 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 country.name , league.name from country join league on country.id = league.country_id
### 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 country join league on country.id = league.country_id where country.name = 'England'
### 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 ( weight ) from player