Chinastark/bird_dataset huggingface dataset:
Database: movie_platform
Note: released in the year 1945 refers to movie_release_year = 1945;
Question: Name movie titles released in year 1945. Sort the listing by the descending order of movie popularity.
SQL: SELECT movie_title FROM movies WHERE movie_release_year = 1945 ORDER BY movie_popularity DESC LIMIT 1
Database: movie_platform
Note: most popular movie refers to MAX(movie_popularity); when it was released refers to movie_release_year; director for the movie refers to director_name;
Question: State the most popular movie? When was it released and who is the director for the movie?
SQL: SELECT movie_title, movie_release_year, director_name FROM movies ORDER BY movie_popularity DESC LIMIT 1
Database: movie_platform
Note: longest movie title refers to MAX(LENGTH(movie_title)); when it was released refers to movie_release_year;
Question: What is the name of the longest movie title? When was it released?
SQL: SELECT movie_title, movie_release_year FROM movies ORDER BY length(movie_popularity) DESC LIMIT 1
Database: movie_platform
Note: movie with the most rating refers to MAX(SUM(rating_score));
Question: Name the movie with the most ratings.
SQL: SELECT movie_title FROM movies GROUP BY movie_title ORDER BY count(movie_title) DESC LIMIT 1
Database: movie_platform
Note: average = AVG(movie_popularity); number of Mubi users who loves the movie refers to movie_popularity;
Question: What is the average number of Mubi users who love movies directed by Stanley Kubrick?
SQL: SELECT avg(movie_popularity) FROM movies WHERE director_name = 'Stanley Kubrick'
Database: movie_platform
Note: average rating = DIVIDE((SUM(rating_score where movie_title = 'When Will I Be Loved')), COUNT(rating_score));
Question: What is the average rating for movie titled 'When Will I Be Loved'?
SQL: SELECT avg(ratings.rating_score) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_title = 'When Will I Be Loved'
Database: movie_platform
Note: user avatar url refers to user_avatar_image_url; latest movie rated refers to latest rating_date;
Question: What is the user avatar url for user 41579158? What is the latest movie rated by him / her?
SQL: SELECT ratings_users.user_avatar_image_url, ratings_users.rating_date_utc FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id INNER JOIN ratings_users ON ratings_users.user_id = ratings.user_id WHERE ratings_users.user_id = 41579158 ORDER BY ratings_users.rating_date_utc DESC LIMIT 1
Database: movie_platform
Note: user is a subscriber refers to user_subscriber = 1; percentage of ratings = DIVIDE(SUM(user_subscriber = 1), SUM(rating_score)) as percent;
Question: What is the percentage of the ratings were rated by user who was a subcriber?
SQL: SELECT cast(sum(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM ratings
Database: movie_platform
Note: movie title rated in April 2020 refers to rating_timestamp_utc LIKE '%2020-04-%'; user is a trial list refers to user_trialist = 1;
Question: List all movie title rated in April 2020 from user who was a trialist.
SQL: SELECT movies.movie_title FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE ratings.user_trialist = 1 AND ratings.rating_timestamp_utc LIKE '2020-04%'
Database: movie_platform
Note: worst rating refers to rating_score = 1;
Question: List ther users who gave the worst rating for movie 'Love Will Tear Us Apart'.
SQL: SELECT ratings.user_id FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.movie_title = 'Love Will Tear Us Apart' AND ratings.rating_score = 1
Database: movie_platform
Note: best rating score refers to rating_score = 5; number of Mubi user who loves the movie refers to movie_popularity;
Question: List all movies with the best rating score. State the movie title and number of Mubi user who loves the movie.
SQL: SELECT DISTINCT movies.movie_title, movies.movie_popularity FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE ratings.rating_score = 5
Database: movie_platform
Note: ratings in year 2020 refers to rating_timestamp_utc like '%2020%'; rating_score >= 4;
Question: For all ratings which are rated in year 2020, name the movies which has the rating scored 4 and above.
SQL: SELECT movies.movie_title FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE cast(substr(ratings.rating_timestamp_utc, 1, 4) AS INTEGER) = 2020 AND cast(substr(ratings.rating_timestamp_utc, 6, 2) AS INTEGER) > 4
Database: movie_platform
Note: movies where users left a critic refers to critic IS NOT NULL; critic comments refers to critic;
Question: For all movies where users left a critic, find the movie name, user, rating and critics comments from the user.
SQL: SELECT movies.movie_title, ratings.user_id, ratings.rating_score, ratings.critic FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE ratings.critic IS NOT NULL
Database: movie_platform
Note: rated with highest score refers to rating_score = 5; percentage = MULTIPLY(DIVIDE(SUM(rating_score = 5), COUNT(rating_score)), 100);
Question: For movie titled 'Welcome to the Dollhouse', how many percentage of the ratings were rated with highest score.
SQL: SELECT cast(sum(CASE WHEN ratings.rating_score = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_title = 'Welcome to the Dollhouse'
Database: movie_platform
Note: percentage = DIVIDE(SUM(movie_release_year = 2021), COUNT(rating_id)) as percent; movies released in year 2021 refers to movie_release_year = 2021;
Question: What is the percentage of rated movies were released in year 2021?
SQL: SELECT cast(sum(CASE WHEN movies.movie_release_year = 2021 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id
Database: movie_platform
Note: Sex, Drink and Bloodshed refers to movie title = 'Sex, Drink and Bloodshed';
Question: Who is the director of the movie Sex, Drink and Bloodshed?
SQL: SELECT director_name FROM movies WHERE movie_title = 'Sex, Drink and Bloodshed'
Database: movie_platform
Note: most followed list refers to MAX(list_followers);
Question: What is the name of the most followed list?
SQL: SELECT list_title FROM LISTS ORDER BY list_followers DESC LIMIT 1
Database: movie_platform
Note: URL to the list page on Mubi refers to list_url; list_followers = 1 OR list_followers = 2; last update timestamp was on 2012 refers to list_update_timestamp_utc BETWEEN '2012-1-1' AND '2012-12-31';
Question: What are the URL to the list page on Mubi of the lists with followers between 1-2 and whose last update timestamp was on 2012?
SQL: SELECT list_url FROM LISTS WHERE list_update_timestamp_utc LIKE '2012%' AND list_followers BETWEEN 1 AND 2 ORDER BY list_update_timestamp_utc DESC LIMIT 1
Database: movie_platform
Note: first created list refers to oldest list_creation_date_utc;
Question: What is the list ID that was first created by user 85981819?
SQL: SELECT list_id FROM lists_users WHERE user_id = 85981819 ORDER BY list_creation_date_utc ASC LIMIT 1
Database: movie_platform
Note: paying subscriber refers to user_has_payment_method = 1; eligible for trial refers to user_eligible_for_trial = 1; rating_score<= 2;
Question: For movie id 1269, how many users, who was a paying subscriber and was eligible for trial when he rated the movie, gave the movie a rating score of less than or equal to 2?
SQL: SELECT count(*) FROM ratings WHERE movie_id = 1269 AND rating_score <= 2 AND user_eligible_for_trial = 1 AND user_has_payment_method = 1
Database: movie_platform
Note: movie released in 2021 refers to movie_release_year = 2021; popularity refers to movie_popularity;
Question: What are the movie popularity of the movies released in 2021 that were directed by Steven Spielberg? List the names of the movies and their corresponding popularity.
SQL: SELECT movie_title, movie_popularity FROM movies WHERE movie_release_year = 2021 AND director_name = 'Steven Spielberg'
Database: movie_platform
Note: first movie refers to oldest movie_release_year;
Question: When was the first movie released and who directed it?
SQL: SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1
Database: movie_platform
Note: user was a subscriber when he created the list refers to user_subscriber = 1; user who created a list for 10 consecutive years refers to user_id with list_creation_date_utc for 10 succeeding years;
Question: What is the user ID of the user, who was a subscriber when he created the list, who created a list for 10 consecutive years? If there are multiple users, indicate each of their user IDs.
SQL: SELECT user_id FROM lists_users WHERE user_subscriber = 1 GROUP BY user_id HAVING max(substr(list_creation_date_utc, 1, 4)) - min(substr(list_creation_date_utc, 1, 4)) >= 10
Database: movie_platform
Note: FALSE;
Question: How many users gave "Pavee Lackeen: The Traveller Girl" movie a rating score of 4?
SQL: SELECT count(ratings.user_id) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_title = 'Pavee Lackeen: The Traveller Girl' AND ratings.rating_score = 4
Database: movie_platform
Note: user was eligible for trial when he created the list refers to user_eligible_for_trial = 1; number of followers a list have refers to list_followers;
Question: Was the user who created the "World War 2 and Kids" list eligible for trial when he created the list? Indicate how many followers does the said list has.
SQL: SELECT lists_users.user_eligible_for_trial, LISTS.list_followers FROM LISTS INNER JOIN lists_users ON LISTS.user_id = LISTS.user_id AND LISTS.list_id = lists_users.list_id WHERE LISTS.list_title = 'World War 2 and Kids'
Database: movie_platform
Note: third movie refers to third movie that has oldest movie_release_year;
Question: Which year was the third movie directed by Quentin Tarantino released? Indicate the user ids of the user who gave it a rating score of 4.
SQL: SELECT movies.movie_release_year, ratings.user_id FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE ratings.movie_id = ( SELECT movie_id FROM movies WHERE director_name = 'Quentin Tarantino' ORDER BY movie_release_year ASC LIMIT 2, 1 ) AND ratings.rating_score = 4
Database: movie_platform
Note: URL to the movie director page on Mubi refers to director_url; likes refers to critic_likes; critic_likes = 39;
Question: What is the URL to the movie director page on Mubi of the director whose movie was critic by user 2452551 and was given 39 likes?
SQL: SELECT movies.director_url FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE ratings.user_id = 2452551 AND ratings.critic_likes = 39
Database: movie_platform
Note: average rating score = AVG(rating_score);
Question: What is the average rating score of the movie "When Will I Be Loved" and who was its director?
SQL: SELECT avg(ratings.rating_score), movies.director_name FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.movie_title = 'When Will I Be Loved'
Database: movie_platform
Note: list with the most number of movies refers to MAX(list_movie_number); user_has_payment_method = 1 means the user was a paying subscriber when he created the list; user_has_payment_method = 0 means the user was not a paying subscriber when he created the list;
Question: How many movies were added to the list with the most number of movies? Indicate whether the user was a paying subscriber or not when he created the list.
SQL: SELECT LISTS.list_movie_number, lists_users.user_has_payment_method FROM LISTS INNER JOIN lists_users ON LISTS.list_id = lists_users.list_id ORDER BY LISTS.list_movie_number DESC LIMIT 1
Database: movie_platform
Note: number of likes received refers to critic likes; received the highest number of likes refers to MAX(critic_likes);
Question: What is the name of the movie whose critic received the highest number of likes related to the critic made by the user rating the movie?
SQL: SELECT movies.movie_title FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id ORDER BY ratings.critic_likes DESC LIMIT 1
Database: movie_platform
Note: movie with highest popularity refers to MAX(movie_popularity); movie_release_year BETWEEN 1920 AND 1929; when the movie received its first rating score of 1 refers to oldest date in rating_timestamp_utc where rating score = 1; user was a paying subscriber when they rated the movie refers to user_has_payment_method = 1;
Question: How much is the popularity of the movie that has the highest popularity between 1920 to 1929 and when did the movie received its first rating score of 1 from the users who were a paying subscriber when they rated the movie ?
SQL: SELECT max(movies.movie_popularity), min(ratings.rating_timestamp_utc) FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.movie_release_year BETWEEN 1920 AND 1929 AND ratings.rating_score = 1 AND ratings.user_has_payment_method = 1
Database: movie_platform
Note: Francis Ford Coppola refers to director_name; popularity of more than 1,000 refers to movie_popularity >1000;highest amount of likes that each critic per movie has received refers to MAX(critic_likes);
Question: How many movies directed by Francis Ford Coppola have a popularity of more than 1,000? Indicate what is the highest amount of likes that each critic per movie has received, if there's any.
SQL: SELECT count(movies.movie_title), ratings.critic FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.director_name = 'Francis Ford Coppola' AND movies.movie_popularity > 1000
Database: movie_platform
Note: URL to the user profile image on Mubi  refers to user_avatar_image_url;  4/19/2020 refers to rating_date_utc;
Question: What is the URL to the user profile image on Mubi of the user who gave the movie id of 1103 a 5 ratinng score on 4/19/2020?
SQL: SELECT ratings_users.user_avatar_image_url FROM ratings INNER JOIN ratings_users ON ratings.user_id = ratings_users.user_id WHERE ratings_users.user_id = 1103 AND rating_score = 5 AND ratings_users.rating_date_utc = '2020-04-19'
Database: movie_platform
Note: User 4208563 refers to user_id;highest number of followers refers to MAX(list_followers); user_subscriber = 1 means that the user was a subscriber when he created the list; user_subscriber = 0 means the user was not a subscriber when he created the list (to replace);
Question: Among the lists created by user 4208563, which one has the highest number of followers? Indicate how many followers it has and whether the user was a subscriber or not when he created the list.
SQL: SELECT LISTS.list_followers, lists_users.user_subscriber = 1 FROM LISTS INNER JOIN lists_users ON LISTS.user_id = lists_users.user_id AND lists_users.list_id = lists_users.list_id WHERE lists_users.user_id = 4208563 ORDER BY LISTS.list_followers DESC LIMIT 1
Database: movie_platform
Note: least number of movies refers to MIN(movie_release_year); highest rating score refers to MAX(SUM(movie_id) where rating_score = '1');
Question: Which year has the least number of movies that was released and what is the title of the movie in that year that has the highest number of rating score of 1?
SQL: SELECT DISTINCT movies.movie_release_year, movies.movie_title FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_release_year = ( SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY count(movie_id) DESC LIMIT 1 ) AND ratings.rating_score = 1
Database: movie_platform
Note: Directed by Buster Keaton refers to director_name; released in 1924 refers to movie_release_year = 1924; paying subscriber refers to user_has_payment_method = 1;
Question: How many users, who were a paying subscriber when they rated the movie, gave the movie that was released in 1924 and directed by Erich von Stroheim a rating score of 5?
SQL: SELECT count(ratings.user_id) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_release_year = 1924 AND movies.director_name = 'Erich von Stroheim' AND ratings.rating_score = 5 AND ratings.user_has_payment_method = 1
Database: movie_platform
Note: user profile image URL refers to user_avatar_image_url; user 8516503 refers to user_id; Average refers to AVG(list_movie_number where user_id = 8516503);
Question: What is the average number of movies added to the lists of user 8516503? Give the user profile image URL on Mubi.
SQL: SELECT avg(LISTS.list_movie_number), lists_users.user_avatar_image_url FROM LISTS INNER JOIN lists_users ON LISTS.list_id = lists_users.list_id AND LISTS.user_id = lists_users.user_id WHERE lists_users.user_id = 8516503
Database: movie_platform
Note: The Magnificent Ambersons refers to movie_title; rating score of no more than 2 refers to rating_score<2; URL to rating refers to rating_url;
Question: How many users rated the movie "The Magnificent Ambersons" gave a rating score of no more than 2? List all the URL to the rating on Mubi.
SQL: SELECT count(ratings.user_id), ratings.rating_url FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_title = 'The Magnificent Ambersons' AND ratings.rating_score <= 2
Database: movie_platform
Note: created a list in the February of 2016 refer to list_creation_date_utc BETWEEN 2/1/2016 and 2/29/2016; eligible for trial refers to user_eligible_for_trial = 1;
Question: How many users who created a list in the February of 2016 were eligible for trial when they created the list? Indicate the user id of the user who has the most number of followers in his list in February of 2016.
SQL: SELECT LISTS.list_followers FROM LISTS INNER JOIN lists_users ON LISTS.user_id = lists_users.user_id AND LISTS.list_id = lists_users.list_id WHERE lists_users.list_creation_date_utc BETWEEN '2016-02-01' AND '2016-02-29' AND lists_users.user_eligible_for_trial = 1
Database: movie_platform
Note: URL refer to rating_url; user 22030372 refer to user_id;
Question: What is the URL to the rating on Mubi of the Riff-Raff movie that was given the highest rating score by user 22030372?
SQL: SELECT ratings.rating_url FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE ratings.user_id = 22030372 AND ratings.rating_score = 5 AND movies.movie_title = 'Riff-Raff'
Database: movie_platform
Note: directed at least 10 movies refers to count(direct_name)>10; 1960 to 1985 refer to movie_release_year;
Question: How many directors have directed atleast 10 movies between 1960 to 1985? Indicate the name of the movie in those years of each director that received the highest amount of 5 rating score.
SQL: SELECT movies.director_name FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.movie_release_year BETWEEN 1960 AND 1985 GROUP BY movies.director_name HAVING count(movies.movie_id) > 10
Database: movie_platform
Note: not a trialist refer to user_trialist = 0; rating score of not more than 2 refer to rating_score <2; The South refers to movie_title;
Question: How many users, who were not a a trialist when they rated the movie, gave the movie "The South" a rating score of not more than 2?
SQL: SELECT count(ratings.user_id) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE ratings.user_trialist = 0 AND ratings.rating_score <= 2 AND movies.movie_title = 'The South'
Database: movie_platform
Note: Apocalypse Now refer to movie_title; rating score refer to rating_score = '5';likes received refers to critic_likes;
Question: How many likes did the critic of the movie "Apocalypse Now" received after giving the movie a rating score of 5?
SQL: SELECT ratings.critic_likes FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE ratings.user_trialist = 0 AND ratings.rating_score = 5 AND movies.movie_title = 'Apocalypse Now'
Database: movie_platform
Note: director refer to director_name; The Crowd refer to movie_title; Average refer to AVG(rating_score);
Question: What is the average rating score of the movie "The Crowd" and who was its director?
SQL: SELECT avg(ratings.rating_score), movies.director_name FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_title = 'The Crowd'
Database: movie_platform
Note: comments refer to critic_comments;
Question: When was the first movie of the director who directed the highest number of movies released and what is the user id of the user who received the highest number of comments related to the critic made by the user rating the movie?
SQL: SELECT min(movie_release_year) FROM movies WHERE director_name = ( SELECT movies.director_name FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.movie_release_year BETWEEN 1960 AND 1985 GROUP BY movies.director_name ORDER BY count(movies.director_name) DESC LIMIT 1 )
Database: movie_platform
Note: popularity of more than 400 but less than 500 refers to movie_popularity BETWEEN 400 AND 500; highest rating score refer to MAX(rating_score);
Question: How many movies have a popularity of more than 400 but less than 500? Indicate the name of the movies and the highest rating score each movie has received.
SQL: SELECT movies.movie_title, max(ratings.rating_score) FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE movies.movie_popularity BETWEEN 400 AND 500 GROUP BY movies.movie_title
Database: movie_platform
Note: URL refer to rating_url; 20 likes refer to critic_likes = ’20’; user 45579900 refer to user_id;
Question: What is the URL to the rating on Mubi made by user 45579900 for the movie "The Vertical Ray of the Sun" that received 20 likes?
SQL: SELECT ratings.rating_url FROM movies INNER JOIN ratings ON movies.movie_id = ratings.movie_id WHERE ratings.user_id = 45579900 AND movies.movie_title = 'The Vertical Ray of the Sun' AND ratings.critic_likes = 20
Database: movie_platform
Note: 5 rating scores refer to rating_score; Christopher Nolan refer to director_name; average popularity of each movie refer to AVG(movie_popularity where director_name = 'Christopher Nolan');
Question: What is the average popularity of each movie that was directed by Christopher Nolan? Indicate which movie directed by him has received the highest number of 5 rating scores.
SQL: SELECT avg(movies.movie_popularity) FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.director_name = 'Christopher Nolan'
Database: movie_platform
Note: Between 1/1/2013 to 12/31/2013 refer to rating_timestamp_utc; 100 Greatest Living American Filmmakers refer to list_title; average rating score refer to DIVIDE( ADD(rating_score where rating_timestamp_utc = '1/1/2013-12/31/2013'), COUNT(rating_timestamp_utc = '1/1/2013-12/31/2013'));
Question: What are the names of the movie that was rated by the user between 1/1/2013 to 12/31/2013 by the user who created the list "100 Greatest Living American Filmmakers"? Calculate for the average rating score of those movies in 2013.
SQL: SELECT movies.movie_title FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id INNER JOIN LISTS ON LISTS.user_id = ratings.user_id WHERE ratings.rating_timestamp_utc BETWEEN '2013-01-01' AND '2013-12-31' AND LISTS.list_title = '100 Greatest Living American Filmmakers'
Database: movie_platform
Note: year it was released refers to movie_release_year; average rating score refers to AVG(rating_score where movie_title = 'Final Destination 6'); Final Destination 6 refers to movie_title;
Question: What is the average rating score of the 'Pavee Lackeen: The Traveller Girl' movie and what year was it released?
SQL: SELECT avg(ratings.rating_score), movies.movie_release_year FROM ratings INNER JOIN movies ON ratings.movie_id = movies.movie_id WHERE movies.movie_title = 'Pavee Lackeen: The Traveller Girl'
Database: movie_platform
Note: updated 10 years after it was created refers to list_update_timestamp_utc > (list_creation_timestamp_utc+10);
Question: How many movie lists were still updated 10 years after it was created?
SQL: SELECT count(*) FROM LISTS WHERE substr(list_update_timestamp_utc, 1, 4) - substr(list_creation_timestamp_utc, 1, 4) > 10