evidence
stringlengths
0
673
db_id
stringclasses
69 values
question
stringlengths
24
325
SQL
stringlengths
23
804
released in 2003 refers to movie_release_year = 2003; user 2941 refers to user_id = 2941; film refers to movie;
movie_platform
Please list the names of the films released in 2003 among the films scored by user 2941 .
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 2003 AND T1.user_id = 2941
Patti Smith: Dream of Life' is movie_title; the user was not a trialist when he created the list refers to user_trialist = 0;
movie_platform
How many users were not trialists when they rated the movie "Patti Smith: Dream of Life"?
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Patti Smith: Dream of Life' AND T1.user_trialist = 0
Highest average score refers to Max(Avg(rating_score));
movie_platform
Which movie has the highest average score in Mubi?
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1
number of comments related to the critic made by the user rating the movie refers to critic_comments; top movie refers to Max(critic_comments);
movie_platform
Please list the names of the top three movies in the number comments related to the critic made by the user rating the movie.
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_comments DESC LIMIT 3
user 85981819 refers to user_id = 85981819;  first list created refers to Min (list_creation_date_utc);
movie_platform
What was the title of the first list created by a user 85981819? And please provide the user_avatar_image_url.
SELECT T2.list_title, T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_id = 85981819 ORDER BY T2.list_creation_timestamp_utc LIMIT 1
in 2020 refers to rating_timestamp_utc = '2020%'; rated the most times refers to Max(Count(movie_title));
movie_platform
Please list the names of the movies that have been rated the most times in 2020.
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2020%' GROUP BY T2.movie_title ORDER BY COUNT(T2.movie_title) DESC LIMIT 1
Versailles Rive-Gauche' is movie_title; average score refers to Avg(rating_score);
movie_platform
What is the average score for the movie Versailles Rive-Gauche?
SELECT AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Versailles Rive-Gauche'
user 59988436 refers to user_id = 59988436; received 21 comments refers to critic_comments = 21; film refers to movie;
movie_platform
Which film rated by user 59988436 that received 21 comments?
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 59988436 AND T1.critic_comments = 21
received more than 20 likes refers to critic_likes>20;
movie_platform
Please list the names of the movies that received more than 20 likes?
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic_likes > 20
The Fall of Berlin' is movie_title; in 2019 refers to rating_timestamp_utc = 2019; Average score refers to Avg(rating_score);
movie_platform
What is the average score of the movie "The Fall of Berlin" in 2019?
SELECT SUM(T1.rating_score) / COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2019%' AND T2.movie_title LIKE 'The Fall of Berlin'
Patti Smith: Dream of Life' is movie_title; more than 3 refers to rating_score >3; percentage = Divide(Count(rating_score where rating_score >3), Count(rating_score))*100
movie_platform
What percentage of users rated the movie "Patti Smith: Dream of Life" by more than 3?
SELECT CAST(SUM(CASE WHEN T1.rating_score > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Patti Smith: Dream of Life'
Abbas Kiarostami' is director_name; the highest Average score refers to Max(Avg(rating_score));
movie_platform
Which of the film directed by director Abbas Kiarostami has the highest average score?
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Abbas Kiarostami' GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1
year refers to movie_release_year; most release films refers to MAX(COUNT(movie_id))
movie_platform
Which year had the most released films?
SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1
director that made the most movies refers to MAX(COUNT(movie_id))
movie_platform
Who is the director that made the most movies? Give the director's id.
SELECT director_id FROM movies GROUP BY director_id ORDER BY COUNT(movie_id) DESC LIMIT 1
highest movie popularity refers to MAX(movie_popularity)
movie_platform
How many movies did the director of the highest movie popularity make?
SELECT COUNT(movie_id) FROM movies WHERE director_id = ( SELECT director_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )
paying subscribers refers to user_has_payment_method = 1; rating a movie after the year 2014 refers to rating_date_utc>'2014%'
movie_platform
What's the number of the paying subscribers when rating a movie after the year 2014?
SELECT COUNT(user_subscriber) FROM ratings_users WHERE user_has_payment_method = 1 AND rating_date_utc > '2014%'
earliest user created a list refers to MIN(list_creation_date_utc); didn't get any followers refers to user_subscriber = 0
movie_platform
Who was the earliest user created a list but didn't get any followers? Give the user ID.
SELECT user_id FROM lists_users WHERE user_subscriber = 0 ORDER BY list_creation_date_utc LIMIT 1
number of followers refers to user_subscriber; posted the most lists refers to MAX(COUNT(list_id))
movie_platform
Give the number of followers for the user who posted the most lists.
SELECT SUM(T1.list_followers) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id GROUP BY T1.user_id ORDER BY COUNT(T1.list_id) DESC LIMIT 1
the list "Non-American Films about World War II" refers to list_title = 'Non-American Films about World War II'
movie_platform
How many followers did the user who posted the list "Non-American Films about World War II" have?
SELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Non-American Films about World War II'
movie "Downfall" refers to movie_title = 'Downfall'; rating of "4" refers to rating_score = 4
movie_platform
What's the number of users gave the movie "Downfall" a rating of "4"?
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Downfall' AND T1.rating_score = 4
5 ratings refers to rating_score = 5; name of the movie refers to movie_title
movie_platform
Give the name of the movie that got the most "5" ratings.
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5
name of the movie refers to movie_title; most critic comments refers to MAX(critic_comments)
movie_platform
Which movie got the most critic comments? Give the name of the movie.
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY COUNT(T1.critic_comments) DESC LIMIT 1
at 2019/10/17 1:36:36 refers to rating_timestamp_utc = '2019/10/17 1:36:36'; avatar of the user refers to user_avatar_image_url
movie_platform
Show the avatar of the user who gave the rating at 2019/10/17 1:36:36.
SELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id WHERE T1.rating_timestamp_utc LIKE '2019-10-17 01:36:36'
the list "Vladimir Vladimirovich Nabokov" refers to list_title = 'Vladimir Vladimirovich Nabokov'; portrait picture refers to user_avatar_image_url
movie_platform
Show the portrait picture of the user who created the list "Vladimir Vladimirovich Nabokov".
SELECT T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Vladimir Vladimirovich Nabokov'
the list that contained the most number of the 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
movie_platform
For the user who post the list that contained the most number of the movies, is he/she a paying subscriber when creating that list?
SELECT T1.user_has_payment_method FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number = ( SELECT MAX(list_movie_number) FROM lists )
head portrait refers to user_avatar_image_url; "5" ratings refers to rating_score = 5
movie_platform
Show the head portrait of the user who gave the most "5" ratings.
SELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id WHERE T1.rating_score = 5
most movie popularity number refers to MAX(movie_popularity)
movie_platform
How many critics were given to the movie that got the most movie popularity number.
SELECT COUNT(T1.critic) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_popularity = ( SELECT MAX(movie_popularity) FROM movies )
4 rating refers to rating_score = 4; the movie "Freaks" refers to movie_title = 'Freaks' ; at 2013/5/4 6:33:32 refers to rating_timestamp_utc = '2013-05-04 06:33:32'
movie_platform
Who gave a "4" rating to the movie "Freaks" at 2013/5/4 6:33:32? Give his/her user id.
SELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE rating_score = 4 AND rating_timestamp_utc LIKE '2013-05-04 06:33:32' AND T2.movie_title LIKE 'Freaks'
rated 5 refers to rating_score = 5; on 2013/5/3 5:11:17 refers to rating_timestamp_utc = '2013-05-03 05:11:17'
movie_platform
Give the url of movie which was rated 5 on 2013/5/3 5:11:17.
SELECT T2.movie_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE rating_score = 5 AND rating_timestamp_utc LIKE '2013-05-03 05:11:17'
1998 movie refers to movie_release_year = '1998'; the highest popularity refers to MAX(movie_popularity) ; "4" rating refers to rating_score = 4
movie_platform
For the 1998 movie which got the highest popularity, how many "4" rating did the movie get?
SELECT COUNT(T2.movie_title) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 4 AND T2.movie_release_year = 1998 ORDER BY T2.movie_popularity DESC LIMIT 1
more than 13000 popularity number refers to movie_popularity > 13000; least ratings refers to MIN(rating_score)
movie_platform
From all the movies that got more than 13000 popularity number, which one had the least ratings.
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_popularity > 13000 ORDER BY T1.rating_score LIMIT 1
paying subscribers refer to user_has_payment_method = 1; movie "One Flew Over the Cuckoo's Nest" refers to movie_id = 'One Flew Over the Cuckoo''s Nest'
movie_platform
How many paying subscribers gave a rating to the movie "One Flew Over the Cuckoo's Nest"?
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'One Flew Over the Cuckoo''s Nest' AND T3.user_has_payment_method = 1
got more than 3000 followers refers to list_followers > 3000; paying subscribers refer to user_has_payment_method = 1
movie_platform
For the lists that got more than 3000 followers, how many did the users who created those lists are paying subscribers?
SELECT COUNT(T1.user_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers > 3000 AND T1.user_has_payment_method = 1
1988 movie refers to movie_release_year = '1998'; most ratings refers to MAX(rating_score)
movie_platform
Which 1988 movie got the most ratings?
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 1988 ORDER BY T1.rating_score DESC LIMIT 1
released in 1995 refers to movie_release_year = '1995'; lower than 3 ratings refers to rating_score <3; most popularity movie refers to MAX(movie_popularity)
movie_platform
For all the movies that were released in 1995, how many lower than 3 ratings did the most popularity movie had?
SELECT COUNT(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score < 3 AND T2.movie_release_year = 1995 AND T2.movie_popularity = ( SELECT MAX(movie_popularity) FROM movies WHERE movie_release_year = 1995 )
movie "Go Go Tales" refers to movie_title = 'Go Go Tales'; gave "5" refers to rating_score = 5; percentage refers to DIVIDE(COUNT(rating_score = 5),COUNT(rating_score))*100
movie_platform
What is the percentage of users gave "5" to the movie "Go Go Tales"?
SELECT CAST(SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Go Go Tales'
movie "G.I. Jane" refers to movie_title = 'G.I. Jane'; subscribers refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(user_subscriber))*100
movie_platform
Give the percentage of subscribers who rated who rated the movie "G.I. Jane".
SELECT CAST(SUM(CASE WHEN T3.user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'G.I. Jane'
"A Shot in the Dark" refers to movie_title = 'A Shot in the Dark'; paying subscriber refers to user_has_payment_method = 1; percentage refers to DIVIDE(COUNT(user_has_payment_method = 1),COUNT(user_has_payment_method))*100
movie_platform
For all the users who gave "A Shot in the Dark" a rating, how many percent of them is a paying subscriber?
SELECT CAST(SUM(CASE WHEN T1.user_has_payment_method = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'A Shot in the Dark'
user 4208563 refers to user_id = 4208563
movie_platform
Name all the list titles created by user 4208563.
SELECT list_title FROM lists WHERE user_id LIKE 4208563
created in 2016 refers to list_creation_timestamp_utc like '2016%'; updated most recently refers to MAX(list_update_timestamp_utc)
movie_platform
Among the lists created in 2016, which is the list that was updated most recently.
SELECT list_title FROM lists WHERE strftime('%Y', list_update_timestamp_utc) = '2016' ORDER BY list_update_timestamp_utc DESC LIMIT 1
was a subscriber refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(list_id))
movie_platform
What is the percentage of list created by user who was a subscriber when he created the list?
SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(list_id) FROM lists_users
was a subscriber refers to user_subscriber = 1
movie_platform
Name all lists created by a user who was a subcriber when created the list.
SELECT DISTINCT T2.list_id FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_subscriber = 1
eligible for trial refers to user_eligible_for_trial = 1
movie_platform
Provide list titles created by user who are eligible for trial when he created the list.
SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_eligible_for_trial = 1
lists with at least one follower refers to list_followers > = 1; was a subscriber refers to user_subscriber = 1
movie_platform
Among the lists with at least one follower, how many were created by user who was subscriber when created the list?
SELECT COUNT(T1.list_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers >= 1 AND T1.user_subscriber = 1
at least 200 movies in the list refers to list_movie_number > 200; average number of followers refers to avg(list_followers)
movie_platform
For all list titles with at least 200 movies in the list, what is their average number of followers?
SELECT AVG(list_followers) FROM lists WHERE list_movie_number > 200
have less than 50 movies in the list refers to list_movie_number <50; was a subscriber refers to user_subscriber = 1
movie_platform
List all the titles created by user who was a subsriber when he created the list and have less than 50 movies in the list.
SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number < 50 AND T1.user_subscriber = 1
not been updated for the longest period of time refers to MIN(list_update_timestamp_utc); how long it has not been updated refers to SUBTRACT(CURRENT_TIMESTAMP, list_update_timestamp_utc)
movie_platform
Which title list has not been updated for the longest period of time? State how long it has not been updated?
SELECT list_title , datetime(CURRENT_TIMESTAMP, 'localtime') - datetime(list_update_timestamp_utc) FROM lists ORDER BY list_update_timestamp_utc LIMIT 1
list titled 'Sound and Vision' refers to list_title = 'Sound and Vision'; user_subscriber = 1 means the user was a subscriber when he rated the movie; user_subscriber = 0 means the user was not a subscriber when he rated the movie
movie_platform
Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list?
SELECT T1.user_id, T1.user_subscriber FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Sound and Vision'
more than 200 followers refers to list_followers >200; how long the list has been created refers to SUBTRACT(CURRENT_TIMESTAMP,list_creation_timestamp_utc)
movie_platform
For the list with more than 200 followers, state the title and how long the list has been created?
SELECT list_title , 365 * (strftime('%Y', 'now') - strftime('%Y', list_creation_timestamp_utc)) + 30 * (strftime('%m', 'now') - strftime('%m', list_creation_timestamp_utc)) + strftime('%d', 'now') - strftime('%d', list_creation_timestamp_utc) FROM lists WHERE list_followers > 200
percentage of movies that were never been rated refers to DIVIDE(COUNT(main_movies.movie_id ! = main_ratings.movie_id),COUNT(movie_id))
movie_platform
Among all movies in the list, calculate the percentage of movies that were never been rated?
SELECT CAST(SUM(CASE WHEN T2.movie_id IS NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.movie_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id
user 39115684 refers to user_id = 39115684; title refers to movie_title; rating date refers to rating_timestamp_utc
movie_platform
List all movies rated by user 39115684. State the title, rating date and rating score.
SELECT T2.movie_title, T1.rating_timestamp_utc, T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 39115684
Between 1970 to 1980 refers to movie_release_year between 1970 and 1980; popularity of more than 11,000 refers movie_popularity >11000
movie_platform
Between 1970 to 1980, how many movies with a popularity of more than 11,000 were released?
SELECT COUNT(movie_id) FROM movies WHERE movie_release_year BETWEEN '1970' AND '1980' AND movie_popularity > 11000
directed by Felipe Cazals refers to director_name = 'Felipe Cazals' ; realeased on 1976 refers to movie_release_year = 1976
movie_platform
How many movies directed by Felipe Cazals was realeased on 1976?
SELECT COUNT(movie_id) FROM movies WHERE movie_release_year = 1976 AND director_name LIKE 'Felipe Cazals'
movie titled "Red Blooded American Girl" refers to movie_title = 'Red Blooded American Girl'
movie_platform
What is the URL to the movie director page on Mubi of the movie titled "Red Blooded American Girl"
SELECT director_url FROM movies WHERE movie_title LIKE 'Red Blooded American Girl'
updated most recently refers to MAX(list_update_date_utc)
movie_platform
What is the name of the list that was updated most recently?
SELECT list_title FROM lists WHERE list_update_timestamp_utc = ( SELECT list_update_timestamp_utc FROM lists ORDER BY list_update_timestamp_utc DESC LIMIT 1 )
list that has 142 comments refers to list_comments = 142
movie_platform
Who created the list that has 142 comments? Indicate the user id of the user, if there are multiple lists with 142 comments, list the user id of the person who created the list
SELECT user_id FROM lists WHERE list_comments = 142
Jeannot Szwarc's refers to director_name = 'Jeannot Szwarc'; most popular movie refers to MAX(movie_popularity); average rating score refers to avg(rating_score)
movie_platform
What is Jeannot Szwarc's most popular movie and what is its average rating score?
SELECT T2.movie_title, AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Jeannot Szwarc' ORDER BY T2.movie_popularity DESC LIMIT 1
highest number of movies COUNT(T1.movie_id); in the 70s refers to movie_release_year between 1970 and 1979
movie_platform
Who is the director that directed the highest number of movies in the 70s? If there are multiple directors with the same amount of movies, list all of their names and indicate the highest rating score that those movies got from the users.
SELECT T2.director_name, T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1970 AND 1979 GROUP BY T2.director_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1
Between 1/1/2010 to 12/31/2020 refers to rating_timestamp_utc between '2010-01-01%' and '2020-12-31%'; a trialist refers to user_trialist = 1; movie "The Secret Life of Words" refers to movie_title = 'The Secret Life of Words'; rating score of 3 refers to rating_score = 3
movie_platform
Between 1/1/2010 to 12/31/2020, how many users, who were a trialist when they created the list, gave the movie "The Secret Life of Words" a rating score of 3?
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'The Secret Life of Words' AND T1.rating_score = 3 AND T1.user_trialist = 0 AND T1.rating_timestamp_utc BETWEEN '2010%' AND '2020%'
critic received the highest amount of likes refers to MAX(critic_likes);
movie_platform
What is the name of the movie whose critic received the highest amount of likes? Indicate the URL to the rating on Mubi.
SELECT T2.movie_title, T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 1
most popular movies refers to MAX(movie_popularity); rating score of 5 refers to rating_score = 5; movies of the 21st century refers to movie_release_year> = 2000
movie_platform
What are the top 5 most popular movies of the 21st century? Indicate how many users gave it a rating score of 5.
SELECT DISTINCT T2.movie_id, SUM(T1.rating_score = 5) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T2.movie_popularity DESC LIMIT 5
average number of followers refers to AVG(list_followers); movie "Pavee Lackeen: The Traveller Girl" refers to movie_title = 'Pavee Lackeen: The Traveller Girl'; on 3/27/2011 at 2:06:34 AM refers to rating_timestamp_utc = '2011-03-27 02:06:34'
movie_platform
What is the average number of followers of the lists created by the user who rated the movie "Pavee Lackeen: The Traveller Girl" on 3/27/2011 at 2:06:34 AM?
SELECT CAST(SUM(T4.list_followers) AS REAL) / COUNT(T2.list_id) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN movies AS T3 ON T1.movie_id = T3.movie_id INNER JOIN lists AS T4 ON T2.list_id = T4.list_id WHERE T3.movie_title LIKE 'Pavee Lackeen: The Traveller Girl' AND T1.rating_timestamp_utc LIKE '2011-03-27 02:06:34'
Between 1/1/2017 to 12/31/2017 refers to rating_timestamp_utc between '2017-01-01 00:00:00' and '2017-12-31 00:00:00'; eligible for trial refers to user_eligible_for_trial = 1; movie "Patti Smith: Dream of Life" refers to movie_title = 'Patti Smith: Dream of Life'
movie_platform
Between 1/1/2017 to 12/31/2017, how many users who were eligible for trial when they rated the movie "Patti Smith: Dream of Life"and what is the image URL to the movie on Mubi?
SELECT COUNT(T1.user_id), T2.movie_image_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE datetime(T1.rating_timestamp_utc) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 00:00:00'
average number of number of movies refers to AVG(list_movie_number); user 8516503 refers to user_id = 8516503; rating score of 5 refers to rating_score = 5
movie_platform
What is the average number of number of movies added to the lists of user 8516503? Indicate how many movies did he/she give a rating score of 5.
SELECT AVG(T3.list_movie_number) , SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN lists AS T3 ON T2.user_id = T3.user_id WHERE T1.user_id = 8516503
most popular movie of all time refers to MAX(movie_popularity); a trialist refers to user_trialist = 1; average rating score = AVG(rating_score)
movie_platform
Who is the director of the most popular movie of all time and when was it released? Indicate the average rating score of the users who were on a trialist when they rated the movie.
SELECT T1.director_name, T1.movie_release_year , SUM(T2.rating_score) / COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 1 ORDER BY T1.movie_popularity DESC LIMIT 1
user 57756708 refers to user_id = 57756708; rated recently refers to MAX(rating_timestamp_utc)
movie_platform
What is the name of the movie that was rated recently by user 57756708?
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 57756708 ORDER BY T1.rating_timestamp_utc DESC LIMIT 1
the average rating score refers to AVG(T2.rating_score); oldest movies refers to MIN(rating_timestamp_utc)
movie_platform
What are the top 10 oldest movies and what are the average rating score for each movie? Indicate the name of the director and when the movies were released.
SELECT T2.movie_id, AVG(T1.rating_score), T2.director_name, T2.movie_release_year FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.rating_timestamp_utc ASC LIMIT 10
total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(sum(qty))
book_publishing_company
Which date has the most ordered quantity? What is the total order quantity on that day?
SELECT ord_date, SUM(qty) FROM sales GROUP BY ord_date ORDER BY SUM(qty) DESC LIMIT 1
total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(count(qty)); date refers to ord_date; year 1992 refers to YEAR(ord_date) = 1992
book_publishing_company
What is the title with the most ordered quantity in year 1992?
SELECT T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y', T1.ord_date) = '1992' ORDER BY T1.qty DESC LIMIT 1
publication date refers to pubdate; payment terms refers to payterms; payterms = 'ON invoice'
book_publishing_company
List the title, price and publication date for all sales with 'ON invoice' payment terms.
SELECT T2.title, T2.price, T2.pubdate FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE T1.payterms = 'ON invoice'
at least 10% royalty refers to royalty > = 10; minimum range is synonym for low range which refers to lorange; without minimum range amount refers to lorange <> 0
book_publishing_company
What is the title that have at least 10% royalty without minimum range amount.
SELECT T1.title FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange = 0 AND T2.royalty >= 10
lorange mean low range; hirange mean high range; range refers to between the low and high range; lorange>10000; hirange<12000
book_publishing_company
State the title and royalty percentage for title ID BU2075 between 10000 to 50000 range.
SELECT T1.title, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 10000 AND T2.hirange < 50000 AND T1.title_ID = 'BU2075'
minimum range is synonym for low range which refers to lorange
book_publishing_company
Among the titles with royalty percentage, which title has the greatest royalty percentage. State it's minimum range to enjoy this royalty percentage.
SELECT T1.title, T2.lorange FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id ORDER BY T2.royalty DESC LIMIT 1
publisher name refers to pub_name;
book_publishing_company
Provide a list of titles together with its publisher name for all publishers located in the USA.
SELECT T1.title, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA'
most year to date sales refers to MAX(ytd_sales); range limit means high range which refers to hirange; the 20000 range refers to hirange<20000
book_publishing_company
State the royalty percentage for the most year to date sale title within the 20000 range.
SELECT MAX(T1.ytd_sales) FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 20000 AND T2.hirange < 20000
publisher name refers to pub_name; publication date refers to pubdate; published in year 1991 refers to YEAR(pubdate) = 1991
book_publishing_company
List all titles published in year 1991. Also provide notes details of the title and the publisher's name.
SELECT T1.title, T1.notes, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991'
qty is abbreviation for quantity; sales of quantity more than 20 refers to qty>20; store refers to stor_name
book_publishing_company
List all titles with sales of quantity more than 20 and store located in the CA state.
SELECT T1.title, T2.qty FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T2.stor_id = T3.stor_id WHERE T2.qty > 20 AND T3.state = 'CA'
qty is abbreviation for quantity; highest quantity refers to MAX(qty); least quantity refers to MIN(qty)
book_publishing_company
Name the store with the highest quantity in sales? What is the least quantity title from the store's sale?
SELECT T3.stor_id, T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T3.stor_id = T1.stor_id WHERE T3.stor_id = ( SELECT stor_id FROM sales GROUP BY stor_id ORDER BY SUM(qty) DESC LIMIT 1 ) GROUP BY T3.stor_id, T2.title ORDER BY SUM(T1.qty) ASC LIMIT 1
name the publisher refers to pub_name
book_publishing_company
Name the title and publisher for title ID BU 2075. Provide all the royalty percentage for all ranges.
SELECT T1.title, T3.pub_name, T2.lorange, T2.hirange, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id INNER JOIN publishers AS T3 ON T1.pub_id = T3.pub_id WHERE T1.title_id = 'BU2075'
store with ID 7066 refers to stor_ID = '7066'; 'Net 60' payment terms refers to payterm = 'Net 60'; qty is abbreviation for quantity; percentage = DIVIDE(payterms = 'Net 60', sum(qty))*100
book_publishing_company
Name the store with ID 7066 and calculate the percentage of the the quantity ordered that were on 'Net 30' payment terms.
SELECT T2.stor_name , CAST(SUM(CASE WHEN payterms = 'Net 30' THEN qty ELSE 0 END) AS REAL) * 100 / SUM(qty) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE T1.stor_id = '7066' GROUP BY T2.stor_name
publisher id refers to pub_id; publisher name refers to pub_name; average year to date sales = AVG(ytd_sales)
book_publishing_company
State the publisher name for publisher ID 877? Calculate its average year to date sales.
SELECT T2.pub_name, AVG(T1.ytd_sales) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.pub_id = '0877' GROUP BY T2.pub_name
hired before year 1990 refers to YEAR(hire_date)<1990
book_publishing_company
Name all employees who were hired before year 1990.
SELECT fname, lname FROM employee WHERE STRFTIME('%Y', hire_date) < '1990'
lowest job level refers to MIN(job_lvl)
book_publishing_company
Which employee has the lowest job level. State the first name, last name and when he /she was hired.
SELECT fname, lname, hire_date FROM employee ORDER BY job_lvl LIMIT 1
most hired employees refers to MAX(count(emp_id))
book_publishing_company
In which year has the most hired employees?
SELECT STRFTIME('%Y', hire_date) FROM employee GROUP BY STRFTIME('%Y', hire_date) ORDER BY COUNT(emp_id) DESC LIMIT 1
maximum level in their job designation refers to job_lvl = MAX(max_lvl)
book_publishing_company
List all employees who are at the maximum level in their job designation.
SELECT T1.fname, T1.lname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl = T2.max_lvl
Chief Financial Offer is a job description which refers to job_desc
book_publishing_company
Name the Chief Executive Officer and when he/she was hired.
SELECT T1.fname, T1.lname, T1.hire_date FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Chief Financial Officier'
not located at USA refers to country! = 'USA'
book_publishing_company
Who are the employees working for publisher not located in USA? State the employee's name and publisher name.
SELECT T1.fname, T1.lname, T2.pub_name FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country != 'USA'
name = fname, lname; job description refers to job_desc; publisher refers pub_name
book_publishing_company
List all employees working for publisher 'GGG&G'. State their name and job description.
SELECT T1.fname, T1.lname, T3.job_desc FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id INNER JOIN jobs AS T3 ON T1.job_id = T3.job_id WHERE T2.pub_name = 'GGG&G'
publisher name refers to pub_name
book_publishing_company
For each publisher, state the type of titles they published order by the publisher name.
SELECT DISTINCT T2.pub_name, T1.type FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id ORDER BY T2.pub_name
most title published refers to MAX(count(title_id); published in 1991 refers to YEAR(pubdate) = 1991
book_publishing_company
Name the publisher which has the most titles published in 1991.
SELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991' GROUP BY T1.pub_id, T2.pub_name ORDER BY COUNT(T1.title_id) DESC LIMIT 1
published by refers to pub_name
book_publishing_company
Name the title with the highest price published by 'Binnet & Hardley'.
SELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'Binnet & Hardley' ORDER BY T1.price DESC LIMIT 1
job level greater than 200 refers to job_lvl>200; job description refers to job_desc
book_publishing_company
Among all employees, who have job level greater than 200. State the employee name and job description.
SELECT T1.fname, T1.lname, T2.job_desc FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl > 200
business title refers to title under business where type = 'business'
book_publishing_company
Name all the authors for all business titles.
SELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.type = 'business'
year to date sales refers to ytd_sales; not on contract refers to contract = 0
book_publishing_company
List all the titles and year to date sales by author who are not on contract.
SELECT T1.title_id, T1.ytd_sales FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0
year to date sales refers to ytd_sales; on contract refers to contract = 1
book_publishing_company
For all authors from CA who are not on contract, which title of his/hers has the most year to date sales.
SELECT T1.title FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0 AND T3.state = 'CA' ORDER BY T1.ytd_sales DESC LIMIT 1
most year to date sales refers to MAX(ytd_sales); on contract refers to contract = 1; name of author = au_fname, au_lname
book_publishing_company
Name all the authors for 'Sushi, Anyone?'.
SELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.title = 'Sushi, Anyone?'
Editor or Auditor are job description which refers to job_desc; percentage = DIVIDE(count(job_desc = 'Editor' or job_desc = 'Auditor'), count(emp_id))*100
book_publishing_company
Calculate the percentage of the employees who are Editor or Designer?
SELECT CAST(SUM(CASE WHEN T2.job_desc IN ('Editor', 'Designer') THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.job_id) FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id
year to date sales refers to ytd_sales; average order = AVG(ytd_sales)
book_publishing_company
List all titles which have year to date sales higher than the average order by pubisher name.
SELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.ytd_sales > ( SELECT AVG(ytd_sales) FROM titles )
book_publishing_company
How many publishers are in the USA?
SELECT COUNT(pub_id) FROM publishers WHERE country = 'USA'
publisher name refers to pub_name; New Moon Books is a publisher name
book_publishing_company
What is the publisher's information of New Moon Books?
SELECT T1.pr_info FROM pub_info AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'New Moon Books'