richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: What are the names of cities that are in the county with the most police officers? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select name from city where county_id = ( select county_id from county_public_safety order by police_officers desc limit 1 )

### Instruction:

Convert text to sql: Show the number of cities in counties that have a population more than 20000. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select count ( * ) from city where county_id in ( select county_id from county_public_safety where population > 20000 )

### Instruction:

Convert text to sql: How many cities are in counties that have populations of over 20000? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select count ( * ) from city where county_id in ( select county_id from county_public_safety where population > 20000 )

### Instruction:

Convert text to sql: Show the crime rate of counties with a city having white percentage more than 90. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select county_public_safety.crime_rate from city join county_public_safety on city.county_id = county_public_safety.county_id where city.white > 90

### Instruction:

Convert text to sql: What are the crime rates of counties that contain cities that have white percentages of over 90? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select county_public_safety.crime_rate from city join county_public_safety on city.county_id = county_public_safety.county_id where city.white > 90
### Instruction:

Convert text to sql: Please show the police forces and the number of counties with each police force. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select police_force , count ( * ) from county_public_safety group by police_force

### Instruction:

Convert text to sql: How many counties correspond to each police force? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select police_force , count ( * ) from county_public_safety group by police_force

### Instruction:

Convert text to sql: What is the location shared by most counties? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select location from county_public_safety group by location order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which location has the most corresponding counties? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select location from county_public_safety group by location order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: List the names of counties that do not have any cities. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select name from county_public_safety where county_id not in ( select county_id from city )

### Instruction:

Convert text to sql: What are the names of counties that do not contain any cities? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select name from county_public_safety where county_id not in ( select county_id from city )
### Instruction:

Convert text to sql: Show the police force shared by counties with location on the east and west. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select police_force from county_public_safety where location = 'East' intersect select police_force from county_public_safety where location = 'West'

### Instruction:

Convert text to sql: Which police forces operate in both counties that are located in the East and in the West? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select police_force from county_public_safety where location = 'East' intersect select police_force from county_public_safety where location = 'West'

### Instruction:

Convert text to sql: Show the names of cities in counties that have a crime rate less than 100. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select name from city where county_id in ( select county_id from county_public_safety where crime_rate < 100 )

### Instruction:

Convert text to sql: What are the names of cities that are in counties that have a crime rate below 100? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select name from city where county_id in ( select county_id from county_public_safety where crime_rate < 100 )

### Instruction:

Convert text to sql: Show the case burden of counties in descending order of population. | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select case_burden from county_public_safety order by population desc
### Instruction:

Convert text to sql: What are the case burdens of counties, ordered descending by population? | county_public_safety : county_id , name , population , police_officers , residents_per_officer , case_burden , crime_rate , police_force , location | city : city_id , county_id , name , white , black , amerindian , asian , multiracial , hispanic | city.county_id = county_public_safety.county_id | 

### Response:

select case_burden from county_public_safety order by population desc
### Instruction:

Convert text to sql: Find the names of all modern rooms with a base price below $160 and two beds. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname from rooms where baseprice < 160 and beds = 2 and decor = 'modern'

### Instruction:

Convert text to sql: What are the names of modern rooms that have a base price lower than $160 and two beds. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname from rooms where baseprice < 160 and beds = 2 and decor = 'modern'

### Instruction:

Convert text to sql: Find all the rooms that have a price higher than 160 and can accommodate more than 2 people. Report room names and ids. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname , roomid from rooms where baseprice > 160 and maxoccupancy > 2

### Instruction:

Convert text to sql: What are the room names and ids of all the rooms that cost more than 160 and can accommodate more than two people. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname , roomid from rooms where baseprice > 160 and maxoccupancy > 2

### Instruction:

Convert text to sql: Find the most popular room in the hotel. The most popular room is the room that had seen the largest number of reservations. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select rooms.roomname from reservations join rooms on reservations.room = rooms.roomid group by reservations.room order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which room has the largest number of reservations? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select rooms.roomname from reservations join rooms on reservations.room = rooms.roomid group by reservations.room order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: How many kids stay in the rooms reserved by ROY SWEAZY? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select kids from reservations where firstname = 'ROY' and lastname = 'SWEAZY'

### Instruction:

Convert text to sql: Find the number of kids staying in the rooms reserved by a person called ROY SWEAZ. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select kids from reservations where firstname = 'ROY' and lastname = 'SWEAZY'

### Instruction:

Convert text to sql: How many times does ROY SWEAZY has reserved a room. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select count ( * ) from reservations where firstname = 'ROY' and lastname = 'SWEAZY'

### Instruction:

Convert text to sql: Find the number of times ROY SWEAZY has reserved a room. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select count ( * ) from reservations where firstname = 'ROY' and lastname = 'SWEAZY'

### Instruction:

Convert text to sql: Which room has the highest rate? List the room's full name, rate, check in and check out date. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select rooms.roomname , reservations.rate , reservations.checkin , reservations.checkout from reservations join rooms on reservations.room = rooms.roomid group by reservations.room order by reservations.rate desc limit 1

### Instruction:

Convert text to sql: Return the name, rate, check in and check out date for the room with the highest rate. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select rooms.roomname , reservations.rate , reservations.checkin , reservations.checkout from reservations join rooms on reservations.room = rooms.roomid group by reservations.room order by reservations.rate desc limit 1
### Instruction:

Convert text to sql: How many adults stay in the room CONRAD SELBIG checked in on Oct 23, 2010? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select adults from reservations where checkin = '2010-10-23' and firstname = 'CONRAD' and lastname = 'SELBIG'

### Instruction:

Convert text to sql: Find the number of adults for the room reserved and checked in by CONRAD SELBIG on Oct 23, 2010. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select adults from reservations where checkin = '2010-10-23' and firstname = 'CONRAD' and lastname = 'SELBIG'

### Instruction:

Convert text to sql: How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select kids from reservations where checkin = '2010-09-21' and firstname = 'DAMIEN' and lastname = 'TRACHSEL'

### Instruction:

Convert text to sql: Return the number of kids for the room reserved and checked in by DAMIEN TRACHSEL on  Sep 21, 2010. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select kids from reservations where checkin = '2010-09-21' and firstname = 'DAMIEN' and lastname = 'TRACHSEL'

### Instruction:

Convert text to sql: How many king beds are there? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select sum ( beds ) from rooms where bedtype = 'King'

### Instruction:

Convert text to sql: Find the total number of king beds available. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select sum ( beds ) from rooms where bedtype = 'King'

### Instruction:

Convert text to sql: List the names and decor of rooms that have a king bed. Sort the list by their price. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname , decor from rooms where bedtype = 'King' order by baseprice asc
### Instruction:

Convert text to sql: What are the names and decor of rooms with a king bed? Sort them by their price | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname , decor from rooms where bedtype = 'King' order by baseprice asc

### Instruction:

Convert text to sql: Which room has cheapest base price? List the room's name and the base price. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname , baseprice from rooms order by baseprice asc limit 1

### Instruction:

Convert text to sql: What are the room name and base price of the room with the lowest base price? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select roomname , baseprice from rooms order by baseprice asc limit 1

### Instruction:

Convert text to sql: What is the decor of room Recluse and defiance? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select decor from rooms where roomname = 'Recluse and defiance'

### Instruction:

Convert text to sql: Return the decor of the room named "Recluse and defiance". | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select decor from rooms where roomname = 'Recluse and defiance'

### Instruction:

Convert text to sql: What is the average base price of different bed type? List bed type and average base price. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select bedtype , avg ( baseprice ) from rooms group by bedtype

### Instruction:

Convert text to sql: For each bed type, find the average base price of different bed type. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select bedtype , avg ( baseprice ) from rooms group by bedtype
### Instruction:

Convert text to sql: What is the total number of people who could stay in the modern rooms in this inn? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select sum ( maxoccupancy ) from rooms where decor = 'modern'

### Instruction:

Convert text to sql: How many people in total can stay in the modern rooms of this inn? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select sum ( maxoccupancy ) from rooms where decor = 'modern'

### Instruction:

Convert text to sql: What kind of decor has the least number of reservations? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select rooms.decor from reservations join rooms on reservations.room = rooms.roomid group by rooms.decor order by count ( rooms.decor ) asc limit 1

### Instruction:

Convert text to sql: What is the least popular kind of decor? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select rooms.decor from reservations join rooms on reservations.room = rooms.roomid group by rooms.decor order by count ( rooms.decor ) asc limit 1

### Instruction:

Convert text to sql: List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids. | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select count ( * ) from reservations join rooms on reservations.room = rooms.roomid where rooms.maxoccupancy = reservations.adults + reservations.kids

### Instruction:

Convert text to sql: How many times the number of adults and kids staying in a room reached the maximum capacity of the room? | rooms : roomid , roomname , beds , bedtype , maxoccupancy , baseprice , decor | reservations : code , room , checkin , checkout , rate , lastname , firstname , adults , kids | reservations.room = rooms.roomid | 

### Response:

select count ( * ) from reservations join rooms on reservations.room = rooms.roomid where rooms.maxoccupancy = reservations.adults + reservations.kids