db_id
stringlengths 4
31
| text
stringlengths 370
4.84k
|
---|---|
movie_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 and years of the movies that has the top 3 highest rating star? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , movie.year from rating join movie on rating.mid = movie.mid order by rating.stars desc limit 3
|
movie_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 and years released for the movies with the top 3 highest ratings? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , movie.year from rating join movie on rating.mid = movie.mid order by rating.stars desc limit 3
|
movie_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: For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.stars , movie.director , max ( rating.stars ) from rating join movie on rating.mid = movie.mid where director != 'null' group by director
|
movie_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: For each director, what are the titles and ratings for all the movies they reviewed? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.stars , movie.director , max ( rating.stars ) from rating join movie on rating.mid = movie.mid where director != 'null' group by director
|
movie_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: Find the title and star rating of the movie that got the least rating star for each reviewer. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.rid , rating.stars , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.rid
|
movie_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: For each reviewer id, what is the title and rating for the movie with the smallest rating? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.rid , rating.stars , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.rid
|
movie_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: Find the title and score of the movie with the lowest rating among all movies directed by each director. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.stars , movie.director , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by movie.director
|
movie_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: For each director, what is the title and score of their most poorly rated movie? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.stars , movie.director , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by movie.director
|
movie_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 name of the movie that is rated by most of times? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.mid from rating join movie on rating.mid = movie.mid group by rating.mid order by count ( * ) desc limit 1
|
movie_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 name of the movie that has been reviewed the most? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title , rating.mid from rating join movie on rating.mid = movie.mid group by rating.mid order by count ( * ) desc limit 1
|
movie_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 titles of all movies that have rating star is between 3 and 5? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title from rating join movie on rating.mid = movie.mid where rating.stars between 3 and 5
|
movie_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 titles of all movies that have between 3 and 5 stars? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title from rating join movie on rating.mid = movie.mid where rating.stars between 3 and 5
|
movie_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: Find the names of reviewers who had given higher than 3 star ratings. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select reviewer.name from rating join reviewer on rating.rid = reviewer.rid where rating.stars > 3
|
movie_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 the reviewers who have rated a movie more than 3 stars before? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select reviewer.name from rating join reviewer on rating.rid = reviewer.rid where rating.stars > 3
|
movie_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: Find the average rating star for each movie that are not reviewed by Brittany Harris. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select mid , avg ( stars ) from rating where mid not in ( select rating.mid from rating join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Brittany Harris' ) group by mid
|
movie_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 rating for each movie that has never been reviewed by Brittany Harris? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select mid , avg ( stars ) from rating where mid not in ( select rating.mid from rating join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Brittany Harris' ) group by mid
|
movie_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 ids of the movies that are not reviewed by Brittany Harris. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select mid from rating except select rating.mid from rating join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Brittany Harris'
|
movie_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 ids of all moviest hat have not been reviewed by Britanny Harris? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select mid from rating except select rating.mid from rating join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Brittany Harris'
|
movie_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: Find the average rating star for each movie that received at least 2 ratings. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select mid , avg ( stars ) from rating group by mid having count ( * ) >= 2
|
movie_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: For each movie that received more than 3 reviews, what is the average rating? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select mid , avg ( stars ) from rating group by mid having count ( * ) >= 2
|
movie_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: find the ids of reviewers who did not give 4 star. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select rid from rating except select rid from rating where stars = 4
|
movie_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 ids of all reviewers who did not give 4 stars? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select rid from rating except select rid from rating where stars = 4
|
movie_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: Find the ids of reviewers who didn't only give 4 star. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select rid from rating where stars != 4
|
movie_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 ids of all reviewers who have not given 4 stars at least once? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select rid from rating where stars != 4
|
movie_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 names of the movies that are either made after 2000 or reviewed by Brittany Harris? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select distinct movie.title from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Brittany Harris' or movie.year > 2000
|
movie_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 all movies that were made after 2000 or reviewed by Brittany Harris? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select distinct movie.title from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Brittany Harris' or movie.year > 2000
|
movie_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 names of the movies that are either made before 1980 or directed by James Cameron? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select title from movie where director = 'James Cameron' or year < 1980
|
movie_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 all movies made before 1980 or had James Cameron as the director? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select title from movie where director = 'James Cameron' or year < 1980
|
movie_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 reviewers who had rated 3 star and 4 star? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select reviewer.name from rating join reviewer on rating.rid = reviewer.rid where rating.stars = 3 intersect select reviewer.name from rating join reviewer on rating.rid = reviewer.rid where rating.stars = 4
|
movie_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 all reviewers that have given 3 or 4 stars for reviews? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select reviewer.name from rating join reviewer on rating.rid = reviewer.rid where rating.stars = 3 intersect select reviewer.name from rating join reviewer on rating.rid = reviewer.rid where rating.stars = 4
|
movie_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 movies that get 3 star and 4 star? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title from rating join movie on rating.mid = movie.mid where rating.stars = 3 intersect select movie.title from rating join movie on rating.mid = movie.mid where rating.stars = 4
|
movie_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 all movies that received 3 or 4 stars? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid |
### Response:
select movie.title from rating join movie on rating.mid = movie.mid where rating.stars = 3 intersect select movie.title from rating join movie on rating.mid = movie.mid where rating.stars = 4
|
county_public_safety
|
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 counties are there? | 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 county_public_safety
|
county_public_safety
|
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: Count the number of countries. | 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 county_public_safety
|
county_public_safety
|
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 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 name from county_public_safety order by population desc
|
county_public_safety
|
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 the counties of public safety, ordered by population descending? | 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 order by population desc
|
county_public_safety
|
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 distinct police forces of counties whose location is not on east side. | 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 distinct police_force from county_public_safety where location != 'East'
|
county_public_safety
|
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 different police forces of counties that are not located in the East? | 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 distinct police_force from county_public_safety where location != 'East'
|
county_public_safety
|
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 minimum and maximum crime rate of 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 min ( crime_rate ) , max ( crime_rate ) from county_public_safety
|
county_public_safety
|
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 minimum and maximum crime rates across all 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 min ( crime_rate ) , max ( crime_rate ) from county_public_safety
|
county_public_safety
|
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 crime rates of counties in ascending order of number of 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 crime_rate from county_public_safety order by police_officers asc
|
county_public_safety
|
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 crime rates of counties sorted by number of offices ascending? | 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 crime_rate from county_public_safety order by police_officers asc
|
county_public_safety
|
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 cities in ascending alphabetical order? | 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 order by name asc
|
county_public_safety
|
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 names of cities, ordered alphabetically. | 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 order by name asc
|
county_public_safety
|
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 percentage of hispanics in cities with the black percentage higher than 10? | 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 hispanic from city where black > 10
|
county_public_safety
|
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 hispanic percentage for cities in which the black percentage is greater than 10. | 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 hispanic from city where black > 10
|
county_public_safety
|
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 county with the largest 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 name from county_public_safety order by population desc limit 1
|
county_public_safety
|
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 name of the county with the greatest 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 name from county_public_safety order by population desc limit 1
|
county_public_safety
|
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 the city with the top 5 white percentages. | 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 order by white desc limit 5
|
county_public_safety
|
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 the five cities with the greatest proportion of white people? | 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 order by white desc limit 5
|
county_public_safety
|
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 names of cities and names of counties they are in. | 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 city.name , county_public_safety.name from city join county_public_safety on city.county_id = county_public_safety.county_id
|
county_public_safety
|
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 cities, as well as the names of the counties they correspond to? | 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 city.name , county_public_safety.name from city join county_public_safety on city.county_id = county_public_safety.county_id
|
county_public_safety
|
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 white percentages of cities and the crime rates of counties they are in. | 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 city.white , county_public_safety.crime_rate from city join county_public_safety on city.county_id = county_public_safety.county_id
|
county_public_safety
|
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 white percentages of cities, and the corresponding crime rates of the counties they correspond to? | 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 city.white , county_public_safety.crime_rate from city join county_public_safety on city.county_id = county_public_safety.county_id
|
county_public_safety
|
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 of cities in the county that has the largest number of 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 )
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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
|
county_public_safety
|
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 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
|
county_public_safety
|
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: 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
|
county_public_safety
|
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 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
|
county_public_safety
|
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 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
|
county_public_safety
|
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 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
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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'
|
county_public_safety
|
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 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'
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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 )
|
county_public_safety
|
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 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
|
county_public_safety
|
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 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
|
inn_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: 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'
|
inn_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 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'
|
inn_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: 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
|
inn_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 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
|
inn_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: 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
|
inn_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: 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
|
inn_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 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'
|
inn_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: 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'
|
inn_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 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'
|
inn_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: 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'
|
inn_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: 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
|
inn_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: 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
|
inn_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 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'
|
inn_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: 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'
|
inn_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 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'
|
inn_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: 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'
|
inn_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 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'
|
inn_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: 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'
|
inn_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 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
|
inn_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 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
|
inn_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: 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
|
inn_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 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
|
inn_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 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'
|
inn_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: 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'
|
inn_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 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
|
inn_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: 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
|
inn_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 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'
|
inn_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 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'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.