db_id
stringlengths
4
31
text
stringlengths
370
4.84k
candidate_poll
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the id of the candidate who got the lowest oppose rate. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select candidate_id from candidate order by oppose_rate asc limit 1
candidate_poll
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 id of the candidate with the lowest oppose rate? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select candidate_id from candidate order by oppose_rate asc limit 1
candidate_poll
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 list support, consider, and oppose rates for each candidate in ascending order by unsure rate. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select support_rate , consider_rate , oppose_rate from candidate order by unsure_rate asc
candidate_poll
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 support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select support_rate , consider_rate , oppose_rate from candidate order by unsure_rate asc
candidate_poll
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 poll source does the highest oppose rate come from? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select poll_source from candidate order by oppose_rate desc limit 1
candidate_poll
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 poll source corresponding to the candidate who has the oppose rate. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select poll_source from candidate order by oppose_rate desc limit 1
candidate_poll
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List all people names in the order of their date of birth from old to young. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people order by date_of_birth asc
candidate_poll
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 people, ordered by their date of birth? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people order by date_of_birth asc
candidate_poll
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 height and weight for all males (sex is M). | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select avg ( height ) , avg ( weight ) from people where sex = 'M'
candidate_poll
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 average height and weight across males (sex is M)? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select avg ( height ) , avg ( weight ) from people where sex = 'M'
candidate_poll
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 people who are taller than 200 or lower than 190. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people where height > 200 or height < 190
candidate_poll
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 people who have a height greater than 200 or less than 190? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people where height > 200 or height < 190
candidate_poll
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 and minimum weight for each gender. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select avg ( weight ) , min ( weight ) , sex from people group by sex
candidate_poll
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 average and minimum weights for people of each sex? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select avg ( weight ) , min ( weight ) , sex from people group by sex
candidate_poll
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 name and gender of the candidate who got the highest support rate. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name , people.sex from people join candidate on people.people_id = candidate.people_id order by candidate.support_rate desc limit 1
candidate_poll
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 and sex of the candidate with the highest support rate? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name , people.sex from people join candidate on people.people_id = candidate.people_id order by candidate.support_rate desc limit 1
candidate_poll
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 name of the candidates whose oppose percentage is the lowest for each sex. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name , people.sex , min ( oppose_rate ) from people join candidate on people.people_id = candidate.people_id group by people.sex
candidate_poll
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 sex, what is the name and sex of the candidate with the oppose rate for their sex? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name , people.sex , min ( oppose_rate ) from people join candidate on people.people_id = candidate.people_id group by people.sex
candidate_poll
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 gender got the highest average uncertain ratio. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.sex from people join candidate on people.people_id = candidate.people_id group by people.sex order by avg ( candidate.unsure_rate ) desc limit 1
candidate_poll
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 sex of the candidate who had the highest unsure rate? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.sex from people join candidate on people.people_id = candidate.people_id group by people.sex order by avg ( candidate.unsure_rate ) desc limit 1
candidate_poll
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 people who did not participate in the candidate election. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people where people_id not in ( select people_id from candidate )
candidate_poll
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Give the names of people who did not participate in the candidate election. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people where people_id not in ( select people_id from candidate )
candidate_poll
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 the candidates whose support percentage is lower than their oppose rate. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name from people join candidate on people.people_id = candidate.people_id where candidate.support_rate < candidate.oppose_rate
candidate_poll
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 candidates who have a lower support rate than oppose rate? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name from people join candidate on people.people_id = candidate.people_id where candidate.support_rate < candidate.oppose_rate
candidate_poll
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 are there whose weight is higher than 85 for each gender? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select count ( * ) , sex from people where weight > 85 group by sex
candidate_poll
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 people of each sex who have a weight higher than 85. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select count ( * ) , sex from people where weight > 85 group by sex
candidate_poll
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 highest support percentage, lowest consider rate and oppose rate of all candidates. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select max ( support_rate ) , min ( consider_rate ) , min ( oppose_rate ) from candidate
candidate_poll
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 maximum support rate, minimum consider rate, and minimum oppose rate across all candidates? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select max ( support_rate ) , min ( consider_rate ) , min ( oppose_rate ) from candidate
candidate_poll
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: list all female (sex is F) candidate names in the alphabetical order. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name from people join candidate on people.people_id = candidate.people_id where people.sex = 'F' order by people.name asc
candidate_poll
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 female candidates in alphabetical order (sex is F)? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select people.name from people join candidate on people.people_id = candidate.people_id where people.sex = 'F' order by people.name asc
candidate_poll
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 name of people whose height is lower than the average. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people where height < ( select avg ( height ) from people )
candidate_poll
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 people who are shorter than average? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select name from people where height < ( select avg ( height ) from people )
candidate_poll
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List all info about all people. | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select * from people
candidate_poll
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 all the information about all people? | candidate : candidate_id , people_id , poll_source , date , support_rate , consider_rate , oppose_rate , unsure_rate | people : people_id , sex , name , date_of_birth , height , weight | candidate.people_id = people.people_id | ### Response: select * from people
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 titles of all movies directed by steven spielberg. | 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 = 'Steven Spielberg'
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 directed by Steven Spielberg? | 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 = 'Steven Spielberg'
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 produced after 2000 and 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' and 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 titles of all movies that James Cameron directed after 2000? | 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' and 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: How many movies were made before 2000? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) from movie where 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: How many movies were made before 2000? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) from movie where 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: Who is the director of movie Avatar? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select director from movie where title = 'Avatar'
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: Who directed Avatar? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select director from movie where title = 'Avatar'
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: How many reviewers listed? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) from reviewer
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: How many reviewers are there? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) from reviewer
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 id of the reviewer whose name has substring 'Mike'? | 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 reviewer where name like '%Mike%'
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 id of the reviewer whose name includes the word "Mike"? | 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 reviewer where name like '%Mike%'
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 reviewer id of Daniel Lewis? | 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 reviewer where name = 'Daniel Lewis'
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 id of the reviewer named Daniel Lewis? | 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 reviewer where name = 'Daniel Lewis'
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 total number of ratings that has more than 3 stars? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) from rating where 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: How many movie ratings have more than 3 stars? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) from rating where 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 is the lowest and 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 max ( stars ) , min ( stars ) from rating
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 maximum and mininum number of stars a rating can receive? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select max ( stars ) , min ( stars ) from rating
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 all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct year from movie join rating on movie.mid = rating.mid where rating.stars >= 4 order by movie.year asc
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: In what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct year from movie join rating on movie.mid = rating.mid where rating.stars >= 4 order by movie.year asc
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 directors who directed movies with 5 star rating? Also return the title of these movies. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select movie.director , movie.title from movie join rating on movie.mid = rating.mid where rating.stars = 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 names of the directors who created a movie with a 5 star rating, and what was the name of those movies? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select movie.director , movie.title from movie join rating on movie.mid = rating.mid where rating.stars = 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 is the average 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 reviewer.name , avg ( rating.stars ) from rating join reviewer on rating.rid = reviewer.rid group by reviewer.name
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 number of stars that each reviewer awards for a movie? | 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 , avg ( rating.stars ) from rating join reviewer on rating.rid = reviewer.rid group by reviewer.name
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 titles of all movies that have no ratings. | 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 mid not in ( select mid from rating )
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 not been rated? | 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 mid not in ( select mid from rating )
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 all reviewers who have ratings with a NULL value for the date. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct name from reviewer join rating on reviewer.rid = rating.rid where ratingdate = 'null'
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 different names of all reviewers whose ratings do not have a date field? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct name from reviewer join rating on reviewer.rid = rating.rid where ratingdate = 'null'
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 stars and title for the oldest movie? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select avg ( rating.stars ) , movie.title from rating join movie on rating.mid = movie.mid where movie.year = ( select min ( year ) from movie )
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 the oldest movie listed, what is its average rating and title? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select avg ( rating.stars ) , movie.title from rating join movie on rating.mid = movie.mid where movie.year = ( select min ( year ) from movie )
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 most recent movie? | 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 year = ( select max ( year ) from movie )
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 title of the newest movie? | 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 year = ( select max ( year ) from movie )
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 maximum stars and year for the most recent movie? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select max ( rating.stars ) , movie.year from rating join movie on rating.mid = movie.mid where movie.year = ( select max ( year ) from movie )
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 highest rating for the most recent movie and when was it released? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select max ( rating.stars ) , movie.year from rating join movie on rating.mid = movie.mid where movie.year = ( select max ( year ) from movie )
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 names of movies whose created year is after all movies directed by Steven Spielberg? | 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 year > ( select max ( year ) from movie where director = 'Steven Spielberg' )
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 created after the most recent Steven Spielberg film? | 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 year > ( select max ( year ) from movie where director = 'Steven Spielberg' )
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 and directors of the movies whose star is greater than the average stars of the movies 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 movie.title , movie.director from rating join movie on rating.mid = movie.mid where rating.stars > ( select avg ( rating.stars ) from rating join movie on rating.mid = movie.mid where movie.director = 'James Cameron' )
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 and directors of all movies that have a rating higher than the average James Cameron film 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 , movie.director from rating join movie on rating.mid = movie.mid where rating.stars > ( select avg ( rating.stars ) from rating join movie on rating.mid = movie.mid where movie.director = 'James Cameron' )
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: Return reviewer name, movie title, stars, and ratingDate. And sort the data first by reviewer name, then by movie title, and lastly by number of stars. | 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 , movie.title , rating.stars , rating.ratingdate from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid order by reviewer.name asc , movie.title , rating.stars
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 reviewer name, film title, movie rating, and rating date for every movie ordered by reviewer name, movie title, then finally rating? | 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 , movie.title , rating.stars , rating.ratingdate from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid order by reviewer.name asc , movie.title , rating.stars
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 all reviewers who have contributed three or more 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 group by rating.rid having count ( * ) >= 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 all reviewers that have rated 3 or more movies? | 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 group by rating.rid having count ( * ) >= 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 names of all reviewers who rated Gone with the Wind. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct reviewer.name from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where movie.title = 'Gone with the Wind'
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 the different reviewers who rates Gone with the Wind? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct reviewer.name from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where movie.title = 'Gone with the Wind'
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 all directors whose movies are rated by Sarah Martinez. | 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.director from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Sarah Martinez'
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 directors whose movies have been reviewed by Sarah Martinez? | 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.director from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Sarah Martinez'
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 any rating where the name of reviewer is the same as the director of the movie, return the reviewer name, movie title, and number of stars. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct reviewer.name , movie.title , rating.stars from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where movie.director = reviewer.name
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 different reviewer names, movie titles, and stars for every rating where the reviewer had the same name 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 distinct reviewer.name , movie.title , rating.stars from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where movie.director = reviewer.name
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: Return all reviewer names and movie names together in a single list. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select name from reviewer union select title from movie
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 the reviewers and movie names? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select name from reviewer union select title from movie
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 titles of all movies not reviewed by Chris Jackson. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct title from movie except select movie.title from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Chris Jackson'
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 were not reviewed by Chris Jackson? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select distinct title from movie except select movie.title from rating join movie on rating.mid = movie.mid join reviewer on rating.rid = reviewer.rid where reviewer.name = 'Chris Jackson'
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 all directors who directed more than one movie, return the titles of all movies directed by them, along with the director name. Sort by director name, then movie title. | 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.director from movie join movie on movie.director = movie.director where movie.title != movie.title order by movie.director asc , movie.title
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 all directors who have directed more than one movie, what movies have they directed and what are their names? | 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.director from movie join movie on movie.director = movie.director where movie.title != movie.title order by movie.director asc , movie.title
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 directors who had more than one movie, return the titles and produced years of all movies directed by them. | 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 movie join movie on movie.director = movie.director where movie.title != movie.title
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 who directed more than one movie, what are the titles and dates of release for all those movies? | 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 movie join movie on movie.director = movie.director where movie.title != movie.title
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 directors who made exactly one movie? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select director from movie group by director having count ( * ) = 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 names of all directors who made one movie? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select director from movie group by director having count ( * ) = 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 names of the directors who made exactly one movie excluding director NULL? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select director from movie where director != 'null' group by director having count ( * ) = 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 names of all directors who have made one movie except for the director named NULL? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select director from movie where director != 'null' group by director having count ( * ) = 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: How many movie reviews does each director get? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) , movie.director from movie join rating on movie.mid = rating.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, how many reviews have they received? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | ### Response: select count ( * ) , movie.director from movie join rating on movie.mid = rating.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: Find the movies with the highest average rating. Return the movie titles and 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 movie.title , avg ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.mid order by avg ( rating.stars ) 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 movie titles with the highest average rating and what are those 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 , avg ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.mid order by avg ( rating.stars ) 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 movie titles and average rating of the movies with the lowest 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 movie.title , avg ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.mid order by avg ( rating.stars ) asc 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 and average ratings for all movies that have the lowest 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 movie.title , avg ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.mid order by avg ( rating.stars ) asc limit 1