db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
candidate_poll | select candidate_id from candidate order by oppose_rate limit 1 | Question: find the id of the candidate who got the lowest oppose rate. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | find the id of the candidate who got the lowest oppose rate. |
candidate_poll | select candidate_id from candidate order by oppose_rate limit 1 | Question: what is the id of the candidate with the lowest oppose rate? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what is the id of the candidate with the lowest oppose rate? |
candidate_poll | select support_rate , consider_rate , oppose_rate from candidate order by unsure_rate | Question: please list support, consider, and oppose rates for each candidate in ascending order by unsure rate. | Tables: 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. | Joins: candidate.Peop... | please list support, consider, and oppose rates for each candidate in ascending order by unsure rate. |
candidate_poll | select support_rate , consider_rate , oppose_rate from candidate order by unsure_rate | Question: what are the support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate? | Tables: 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. | Joins: candidat... | what are the support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate? |
candidate_poll | select poll_source from candidate order by oppose_rate desc limit 1 | Question: which poll source does the highest oppose rate come from? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | which poll source does the highest oppose rate come from? |
candidate_poll | select poll_source from candidate order by oppose_rate desc limit 1 | Question: return the poll source corresponding to the candidate who has the oppose rate. | Tables: 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. | Joins: candidate.People_ID = people.People_I... | return the poll source corresponding to the candidate who has the oppose rate. |
candidate_poll | select name from people order by date_of_birth | Question: list all people names in the order of their date of birth from old to young. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | list all people names in the order of their date of birth from old to young. |
candidate_poll | select name from people order by date_of_birth | Question: what are the names of all people, ordered by their date of birth? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what are the names of all people, ordered by their date of birth? |
candidate_poll | select avg(height) , avg(weight) from people where sex = 'm' | Question: find the average height and weight for all males (sex is m). | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | find the average height and weight for all males (sex is m). |
candidate_poll | select avg(height) , avg(weight) from people where sex = 'm' | Question: what are the average height and weight across males (sex is m)? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what are the average height and weight across males (sex is m)? |
candidate_poll | select name from people where height > 200 or height < 190 | Question: find the names of people who are taller than 200 or lower than 190. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | find the names of people who are taller than 200 or lower than 190. |
candidate_poll | select name from people where height > 200 or height < 190 | Question: what are the names of people who have a height greater than 200 or less than 190? | Tables: 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. | Joins: candidate.People_ID = people.Peopl... | what are the names of people who have a height greater than 200 or less than 190? |
candidate_poll | select avg(weight) , min(weight) , sex from people group by sex | Question: find the average and minimum weight for each gender. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | find the average and minimum weight for each gender. |
candidate_poll | select avg(weight) , min(weight) , sex from people group by sex | Question: what are the average and minimum weights for people of each sex? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what are the average and minimum weights for people of each sex? |
candidate_poll | select t1.name , t1.sex from people as t1 join candidate as t2 on t1.people_id = t2.people_id order by t2.support_rate desc limit 1 | Question: find the name and gender of the candidate who got the highest support rate. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | find the name and gender of the candidate who got the highest support rate. |
candidate_poll | select t1.name , t1.sex from people as t1 join candidate as t2 on t1.people_id = t2.people_id order by t2.support_rate desc limit 1 | Question: what is the name and sex of the candidate with the highest support rate? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what is the name and sex of the candidate with the highest support rate? |
candidate_poll | select t1.name , t1.sex , min(oppose_rate) from people as t1 join candidate as t2 on t1.people_id = t2.people_id group by t1.sex | Question: find the name of the candidates whose oppose percentage is the lowest for each sex. | Tables: 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. | Joins: candidate.People_ID = people.Peo... | find the name of the candidates whose oppose percentage is the lowest for each sex. |
candidate_poll | select t1.name , t1.sex , min(oppose_rate) from people as t1 join candidate as t2 on t1.people_id = t2.people_id group by t1.sex | Question: for each sex, what is the name and sex of the candidate with the oppose rate for their sex? | Tables: 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. | Joins: candidate.People_ID = pe... | for each sex, what is the name and sex of the candidate with the oppose rate for their sex? |
candidate_poll | select t1.sex from people as t1 join candidate as t2 on t1.people_id = t2.people_id group by t1.sex order by avg(t2.unsure_rate) desc limit 1 | Question: which gender got the highest average uncertain ratio. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | which gender got the highest average uncertain ratio. |
candidate_poll | select t1.sex from people as t1 join candidate as t2 on t1.people_id = t2.people_id group by t1.sex order by avg(t2.unsure_rate) desc limit 1 | Question: what is the sex of the candidate who had the highest unsure rate? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what is the sex of the candidate who had the highest unsure rate? |
candidate_poll | select name from people where people_id not in (select people_id from candidate) | Question: what are the names of people who did not participate in the candidate election. | Tables: 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. | Joins: candidate.People_ID = people.People_... | what are the names of people who did not participate in the candidate election. |
candidate_poll | select name from people where people_id not in (select people_id from candidate) | Question: give the names of people who did not participate in the candidate election. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | give the names of people who did not participate in the candidate election. |
candidate_poll | select t1.name from people as t1 join candidate as t2 on t1.people_id = t2.people_id where t2.support_rate < t2.oppose_rate | Question: find the names of the candidates whose support percentage is lower than their oppose rate. | Tables: 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. | Joins: candidate.People_ID = peo... | find the names of the candidates whose support percentage is lower than their oppose rate. |
candidate_poll | select t1.name from people as t1 join candidate as t2 on t1.people_id = t2.people_id where t2.support_rate < t2.oppose_rate | Question: what are the names of candidates who have a lower support rate than oppose rate? | Tables: 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. | Joins: candidate.People_ID = people.People... | what are the names of candidates who have a lower support rate than oppose rate? |
candidate_poll | select count(*) , sex from people where weight > 85 group by sex | Question: how many people are there whose weight is higher than 85 for each gender? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | how many people are there whose weight is higher than 85 for each gender? |
candidate_poll | select count(*) , sex from people where weight > 85 group by sex | Question: count the number of people of each sex who have a weight higher than 85. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | count the number of people of each sex who have a weight higher than 85. |
candidate_poll | select max(support_rate) , min(consider_rate) , min(oppose_rate) from candidate | Question: find the highest support percentage, lowest consider rate and oppose rate of all candidates. | Tables: 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. | Joins: candidate.People_ID = p... | find the highest support percentage, lowest consider rate and oppose rate of all candidates. |
candidate_poll | select max(support_rate) , min(consider_rate) , min(oppose_rate) from candidate | Question: return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates? | Tables: 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. | Joins: candidate.Peo... | return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates? |
candidate_poll | select t1.name from people as t1 join candidate as t2 on t1.people_id = t2.people_id where t1.sex = 'f' order by t1.name | Question: list all female (sex is f) candidate names in the alphabetical order. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | list all female (sex is f) candidate names in the alphabetical order. |
candidate_poll | select t1.name from people as t1 join candidate as t2 on t1.people_id = t2.people_id where t1.sex = 'f' order by t1.name | Question: what are the names of all female candidates in alphabetical order (sex is f)? | Tables: 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. | Joins: candidate.People_ID = people.People_ID... | what are the names of all female candidates in alphabetical order (sex is f)? |
candidate_poll | select name from people where height < (select avg(height) from people) | Question: find the name of people whose height is lower than the average. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | find the name of people whose height is lower than the average. |
candidate_poll | select name from people where height < (select avg(height) from people) | Question: what are the names of people who are shorter than average? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what are the names of people who are shorter than average? |
candidate_poll | select * from people | Question: list all info about all people. | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | list all info about all people. |
candidate_poll | select * from people | Question: what is all the information about all people? | Tables: 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. | Joins: candidate.People_ID = people.People_ID, | what is all the information about all people? |
movie_1 | select title from movie where director = 'steven spielberg' | Question: find the titles of all movies directed by steven spielberg. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the titles of all movies directed by steven spielberg. |
movie_1 | select title from movie where director = 'steven spielberg' | Question: what are the names of all movies directed by steven spielberg? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all movies directed by steven spielberg? |
movie_1 | select title from movie where director = 'james cameron' and year > 2000 | Question: what is the name of the movie produced after 2000 and directed by james cameron? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the name of the movie produced after 2000 and directed by james cameron? |
movie_1 | select title from movie where director = 'james cameron' and year > 2000 | Question: what are the titles of all movies that james cameron directed after 2000? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the titles of all movies that james cameron directed after 2000? |
movie_1 | select count(*) from movie where year < 2000 | Question: how many movies were made before 2000? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | how many movies were made before 2000? |
movie_1 | select count(*) from movie where year < 2000 | Question: how many movies were made before 2000? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | how many movies were made before 2000? |
movie_1 | select director from movie where title = 'avatar' | Question: who is the director of movie avatar? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | who is the director of movie avatar? |
movie_1 | select director from movie where title = 'avatar' | Question: who directed avatar? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | who directed avatar? |
movie_1 | select count(*) from reviewer | Question: how many reviewers listed? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | how many reviewers listed? |
movie_1 | select count(*) from reviewer | Question: how many reviewers are there? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | how many reviewers are there? |
movie_1 | select rid from reviewer where name like '%mike%' | Question: what is the id of the reviewer whose name has substring mike? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the id of the reviewer whose name has substring mike? |
movie_1 | select rid from reviewer where name like '%mike%' | Question: what is the id of the reviewer whose name includes the word 'mike'? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the id of the reviewer whose name includes the word 'mike'? |
movie_1 | select rid from reviewer where name = 'daniel lewis' | Question: what is the reviewer id of daniel lewis? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the reviewer id of daniel lewis? |
movie_1 | select rid from reviewer where name = 'daniel lewis' | Question: what is the id of the reviewer named daniel lewis? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the id of the reviewer named daniel lewis? |
movie_1 | select count(*) from rating where stars > 3 | Question: what is the total number of ratings that has more than 3 stars? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the total number of ratings that has more than 3 stars? |
movie_1 | select count(*) from rating where stars > 3 | Question: how many movie ratings have more than 3 stars? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | how many movie ratings have more than 3 stars? |
movie_1 | select max(stars) , min(stars) from rating | Question: what is the lowest and highest rating star? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the lowest and highest rating star? |
movie_1 | select max(stars) , min(stars) from rating | Question: what is the maximum and mininum number of stars a rating can receive? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the maximum and mininum number of stars a rating can receive? |
movie_1 | select distinct year from movie as t1 join rating as t2 on t1.mid = t2.mid where t2.stars >= 4 order by t1.year | Question: find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year. |
movie_1 | select distinct year from movie as t1 join rating as t2 on t1.mid = t2.mid where t2.stars >= 4 order by t1.year | Question: in what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | in what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently? |
movie_1 | select t1.director , t1.title from movie as t1 join rating as t2 on t1.mid = t2.mid where t2.stars = 5 | Question: what are the names of directors who directed movies with 5 star rating? also return the title of these movies. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of directors who directed movies with 5 star rating? also return the title of these movies. |
movie_1 | select t1.director , t1.title from movie as t1 join rating as t2 on t1.mid = t2.mid where t2.stars = 5 | Question: what are the names of the directors who created a movie with a 5 star rating, and what was the name of those movies? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | 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_1 | select t2.name , avg(t1.stars) from rating as t1 join reviewer as t2 on t1.rid = t2.rid group by t2.name | Question: what is the average rating star for each reviewer? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the average rating star for each reviewer? |
movie_1 | select t2.name , avg(t1.stars) from rating as t1 join reviewer as t2 on t1.rid = t2.rid group by t2.name | Question: what is the average number of stars that each reviewer awards for a movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the average number of stars that each reviewer awards for a movie? |
movie_1 | select title from movie where mid not in (select mid from rating) | Question: find the titles of all movies that have no ratings. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the titles of all movies that have no ratings. |
movie_1 | select title from movie where mid not in (select mid from rating) | Question: what are the titles of all movies that have not been rated? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the titles of all movies that have not been rated? |
movie_1 | select distinct name from reviewer as t1 join rating as t2 on t1.rid = t2.rid where ratingdate = 'null' | Question: find the names of all reviewers who have ratings with a null value for the date. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the names of all reviewers who have ratings with a null value for the date. |
movie_1 | select distinct name from reviewer as t1 join rating as t2 on t1.rid = t2.rid where ratingdate = 'null' | Question: what are the different names of all reviewers whose ratings do not have a date field? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the different names of all reviewers whose ratings do not have a date field? |
movie_1 | select avg(t1.stars) , t2.title from rating as t1 join movie as t2 on t1.mid = t2.mid where t2.year = (select min(year) from movie) | Question: what is the average rating stars and title for the oldest movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the average rating stars and title for the oldest movie? |
movie_1 | select avg(t1.stars) , t2.title from rating as t1 join movie as t2 on t1.mid = t2.mid where t2.year = (select min(year) from movie) | Question: for the oldest movie listed, what is its average rating and title? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | for the oldest movie listed, what is its average rating and title? |
movie_1 | select title from movie where year = (select max(year) from movie) | Question: what is the name of the most recent movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the name of the most recent movie? |
movie_1 | select title from movie where year = (select max(year) from movie) | Question: what is the title of the newest movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the title of the newest movie? |
movie_1 | select max(t1.stars) , t2.year from rating as t1 join movie as t2 on t1.mid = t2.mid where t2.year = (select max(year) from movie) | Question: what is the maximum stars and year for the most recent movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the maximum stars and year for the most recent movie? |
movie_1 | select max(t1.stars) , t2.year from rating as t1 join movie as t2 on t1.mid = t2.mid where t2.year = (select max(year) from movie) | Question: what is highest rating for the most recent movie and when was it released? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is highest rating for the most recent movie and when was it released? |
movie_1 | select title from movie where year > (select max(year) from movie where director = 'steven spielberg') | Question: what is the names of movies whose created year is after all movies directed by steven spielberg? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what is the names of movies whose created year is after all movies directed by steven spielberg? |
movie_1 | select title from movie where year > (select max(year) from movie where director = 'steven spielberg') | Question: what are the names of all movies that were created after the most recent steven spielberg film? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all movies that were created after the most recent steven spielberg film? |
movie_1 | select t2.title , t2.director from rating as t1 join movie as t2 on t1.mid = t2.mid where t1.stars > (select avg(t1.stars) from rating as t1 join movie as t2 on t1.mid = t2.mid where t2.director = 'james cameron') | Question: what are the titles and directors of the movies whose star is greater than the average stars of the movies directed by james cameron? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | 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_1 | select t2.title , t2.director from rating as t1 join movie as t2 on t1.mid = t2.mid where t1.stars > (select avg(t1.stars) from rating as t1 join movie as t2 on t1.mid = t2.mid where t2.director = 'james cameron') | Question: what are the titles and directors of all movies that have a rating higher than the average james cameron film rating? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the titles and directors of all movies that have a rating higher than the average james cameron film rating? |
movie_1 | select t3.name , t2.title , t1.stars , t1.ratingdate from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid order by t3.name , t2.title , t1.stars | Question: 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. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = ... | 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_1 | select t3.name , t2.title , t1.stars , t1.ratingdate from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid order by t3.name , t2.title , t1.stars | Question: what is the reviewer name, film title, movie rating, and rating date for every movie ordered by reviewer name, movie title, then finally rating? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.... | 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_1 | select t2.name from rating as t1 join reviewer as t2 on t1.rid = t2.rid group by t1.rid having count(*) >= 3 | Question: find the names of all reviewers who have contributed three or more ratings. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the names of all reviewers who have contributed three or more ratings. |
movie_1 | select t2.name from rating as t1 join reviewer as t2 on t1.rid = t2.rid group by t1.rid having count(*) >= 3 | Question: what are the names of all reviewers that have rated 3 or more movies? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all reviewers that have rated 3 or more movies? |
movie_1 | select distinct t3.name from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t2.title = 'gone with the wind' | Question: find the names of all reviewers who rated gone with the wind. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the names of all reviewers who rated gone with the wind. |
movie_1 | select distinct t3.name from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t2.title = 'gone with the wind' | Question: what are the names of all the different reviewers who rates gone with the wind? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all the different reviewers who rates gone with the wind? |
movie_1 | select distinct t2.director from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t3.name = 'sarah martinez' | Question: find the names of all directors whose movies are rated by sarah martinez. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the names of all directors whose movies are rated by sarah martinez. |
movie_1 | select distinct t2.director from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t3.name = 'sarah martinez' | Question: what are the names of all directors whose movies have been reviewed by sarah martinez? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all directors whose movies have been reviewed by sarah martinez? |
movie_1 | select distinct t3.name , t2.title , t1.stars from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t2.director = t3.name | Question: 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. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mI... | 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_1 | select distinct t3.name , t2.title , t1.stars from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t2.director = t3.name | Question: what are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the different reviewer names, movie titles, and stars for every rating where the reviewer had the same name as the director? |
movie_1 | select name from reviewer union select title from movie | Question: return all reviewer names and movie names together in a single list. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | return all reviewer names and movie names together in a single list. |
movie_1 | select name from reviewer union select title from movie | Question: what are the names of all the reviewers and movie names? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all the reviewers and movie names? |
movie_1 | select distinct title from movie except select t2.title from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t3.name = 'chris jackson' | Question: find the titles of all movies not reviewed by chris jackson. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the titles of all movies not reviewed by chris jackson. |
movie_1 | select distinct title from movie except select t2.title from rating as t1 join movie as t2 on t1.mid = t2.mid join reviewer as t3 on t1.rid = t3.rid where t3.name = 'chris jackson' | Question: what are the titles of all movies that were not reviewed by chris jackson? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the titles of all movies that were not reviewed by chris jackson? |
movie_1 | select t1.title , t1.director from movie as t1 join movie as t2 on t1.director = t2.director where t1.title != t2.title order by t1.director , t1.title | Question: 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. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Review... | 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_1 | select t1.title , t1.director from movie as t1 join movie as t2 on t1.director = t2.director where t1.title != t2.title order by t1.director , t1.title | Question: for all directors who have directed more than one movie, what movies have they directed and what are their names? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | for all directors who have directed more than one movie, what movies have they directed and what are their names? |
movie_1 | select t1.title , t1.year from movie as t1 join movie as t2 on t1.director = t2.director where t1.title != t2.title | Question: for directors who had more than one movie, return the titles and produced years of all movies directed by them. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | for directors who had more than one movie, return the titles and produced years of all movies directed by them. |
movie_1 | select t1.title , t1.year from movie as t1 join movie as t2 on t1.director = t2.director where t1.title != t2.title | Question: for each director who directed more than one movie, what are the titles and dates of release for all those movies? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | for each director who directed more than one movie, what are the titles and dates of release for all those movies? |
movie_1 | select director from movie group by director having count(*) = 1 | Question: what are the names of the directors who made exactly one movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of the directors who made exactly one movie? |
movie_1 | select director from movie group by director having count(*) = 1 | Question: what are the names of all directors who made one movie? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all directors who made one movie? |
movie_1 | select director from movie where director != 'null' group by director having count(*) = 1 | Question: what are the names of the directors who made exactly one movie excluding director null? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of the directors who made exactly one movie excluding director null? |
movie_1 | select director from movie where director != 'null' group by director having count(*) = 1 | Question: what are the names of all directors who have made one movie except for the director named null? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the names of all directors who have made one movie except for the director named null? |
movie_1 | select count(*) , t1.director from movie as t1 join rating as t2 on t1.mid = t2.mid group by t1.director | Question: how many movie reviews does each director get? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | how many movie reviews does each director get? |
movie_1 | select count(*) , t1.director from movie as t1 join rating as t2 on t1.mid = t2.mid group by t1.director | Question: for each director, how many reviews have they received? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | for each director, how many reviews have they received? |
movie_1 | select t2.title , avg(t1.stars) from rating as t1 join movie as t2 on t1.mid = t2.mid group by t1.mid order by avg(t1.stars) desc limit 1 | Question: find the movies with the highest average rating. return the movie titles and average rating. | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | find the movies with the highest average rating. return the movie titles and average rating. |
movie_1 | select t2.title , avg(t1.stars) from rating as t1 join movie as t2 on t1.mid = t2.mid group by t1.mid order by avg(t1.stars) desc limit 1 | Question: what are the movie titles with the highest average rating and what are those ratings? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the movie titles with the highest average rating and what are those ratings? |
movie_1 | select t2.title , avg(t1.stars) from rating as t1 join movie as t2 on t1.mid = t2.mid group by t1.mid order by avg(t1.stars) limit 1 | Question: what are the movie titles and average rating of the movies with the lowest average rating? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the movie titles and average rating of the movies with the lowest average rating? |
movie_1 | select t2.title , avg(t1.stars) from rating as t1 join movie as t2 on t1.mid = t2.mid group by t1.mid order by avg(t1.stars) limit 1 | Question: what are the titles and average ratings for all movies that have the lowest average rating? | Tables: Movie -> mID, title, year, director. Reviewer -> rID, name. Rating -> rID, mID, stars, ratingDate. | Joins: Rating.rID = Reviewer.rID, Rating.mID = Movie.mID, | what are the titles and average ratings for all movies that have the lowest average rating? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.