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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Instruction:

Convert text to sql: What are the names and years of the movies that has the top 3 highest rating star? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , movie.year from rating join movie on rating.mid = movie.mid order by rating.stars desc limit 3
### Instruction:

Convert text to sql: What are the names and years released for the movies with the top 3 highest ratings? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , movie.year from rating join movie on rating.mid = movie.mid order by rating.stars desc limit 3

### Instruction:

Convert text to sql: For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , rating.stars , movie.director , max ( rating.stars ) from rating join movie on rating.mid = movie.mid where director != 'null' group by director

### Instruction:

Convert text to sql: For each director, what are the titles and ratings for all the movies they reviewed? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , rating.stars , movie.director , max ( rating.stars ) from rating join movie on rating.mid = movie.mid where director != 'null' group by director

### Instruction:

Convert text to sql: Find the title and star rating of the movie that got the least rating star for each reviewer. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , rating.rid , rating.stars , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.rid

### Instruction:

Convert text to sql: For each reviewer id, what is the title and rating for the movie with the smallest rating? | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , rating.rid , rating.stars , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by rating.rid

### Instruction:

Convert text to sql: Find the title and score of the movie with the lowest rating among all movies directed by each director. | movie : mid , title , year , director | reviewer : rid , name | rating : rid , mid , stars , ratingdate | rating.rid = reviewer.rid | rating.mid = movie.mid | 

### Response:

select movie.title , rating.stars , movie.director , min ( rating.stars ) from rating join movie on rating.mid = movie.mid group by movie.director