Dataset Viewer
Auto-converted to Parquet Duplicate
db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
movie_platform
Name movie titles released in year 1945. Sort the listing by the descending order of movie popularity.
released in the year 1945 refers to movie_release_year = 1945;
SELECT movie_title FROM movies WHERE movie_release_year = 1945 ORDER BY movie_popularity DESC LIMIT 1
movie_platform
State the most popular movie? When was it released and who is the director for the movie?
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;
SELECT movie_title, movie_release_year, director_name FROM movies ORDER BY movie_popularity DESC LIMIT 1
movie_platform
Name the movie with the most ratings.
movie with the most rating refers to MAX(SUM(rating_score));
SELECT movie_title FROM movies GROUP BY movie_title ORDER BY COUNT(movie_title) DESC LIMIT 1
movie_platform
What is the average number of Mubi users who love movies directed by Stanley Kubrick?
average = AVG(movie_popularity); number of Mubi users who loves the movie refers to movie_popularity;
SELECT AVG(movie_popularity) FROM movies WHERE director_name = 'Stanley Kubrick'
movie_platform
Who is the director of the movie Sex, Drink and Bloodshed?
Sex, Drink and Bloodshed refers to movie title = 'Sex, Drink and Bloodshed';
SELECT director_name FROM movies WHERE movie_title = 'Sex, Drink and Bloodshed'
movie_platform
What is the name of the most followed list?
most followed list refers to MAX(list_followers);
SELECT list_title FROM lists ORDER BY list_followers DESC LIMIT 1
movie_platform
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?
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';
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
movie_platform
What is the list ID that was first created by user 85981819?
first created list refers to oldest list_creation_date_utc;
SELECT list_id FROM lists_users WHERE user_id = 85981819 ORDER BY list_creation_date_utc ASC LIMIT 1
movie_platform
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?
paying subscriber refers to user_has_payment_method = 1; eligible for trial refers to user_eligible_for_trial = 1; rating_score< = 2;
SELECT COUNT(*) FROM ratings WHERE movie_id = 1269 AND rating_score <= 2 AND user_eligible_for_trial = 1 AND user_has_payment_method = 1
movie_platform
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.
movie released in 2021 refers to movie_release_year = 2021; popularity refers to movie_popularity;
SELECT movie_title, movie_popularity FROM movies WHERE movie_release_year = 2021 AND director_name = 'Steven Spielberg'
movie_platform
When was the first movie released and who directed it?
first movie refers to oldest movie_release_year;
SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1
movie_platform
How many users gave "Pavee Lackeen: The Traveller Girl" movie a rating score of 4?
FALSE;
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'Pavee Lackeen: The Traveller Girl' AND T2.rating_score = 4
movie_platform
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.
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;
SELECT T1.list_movie_number, T2.user_has_payment_method FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id ORDER BY T1.list_movie_number DESC LIMIT 1
movie_platform
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 ?
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;
SELECT MAX(T2.movie_popularity), MIN(T1.rating_timestamp_utc) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1920 AND 1929 AND T1.rating_score = 1 AND T1.user_has_payment_method = 1
movie_platform
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.
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)
SELECT T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563 ORDER BY T1.list_followers DESC LIMIT 1
movie_platform
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?
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
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = 1924 AND T1.director_name = 'Erich von Stroheim' AND T2.rating_score = 5 AND T2.user_has_payment_method = 1
movie_platform
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?
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
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 0 AND T2.rating_score <= 2 AND T1.movie_title = 'The South'
movie_platform
What's the description for the movie list "Short and pretty damn sweet"?
Short and pretty damn sweet is list_title; description refers to list_description;
SELECT list_description FROM lists WHERE list_title = 'Short and pretty damn sweet'
movie_platform
Where can I find the movie list "Short and pretty damn sweet"?
Short and pretty damn sweet is list_title; location of the movie refers to list_url;
SELECT list_url FROM lists WHERE list_title = 'Short and pretty damn sweet'
movie_platform
Among the movie lists created after 2010/1/1, how many of them have over 200 followers?
created after 2010/1/1 refers to list_update_timestamp_utc>'2010/1/1'; over 200 followers refers to list_followers>200;
SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_update_timestamp_utc > '2010-01-01'
movie_platform
How many movie lists were created by user 83373278 when he or she was a subscriber?
the user was a subscriber when he created the list refers to user_subscriber = 1; user 83373278 refers to user_id = 83373278;
SELECT COUNT(*) FROM lists_users WHERE user_id = 83373278 AND user_subscriber = 1
movie_platform
In which year was the movie "La Antena" released?
movie La Antena refers to movie_title = 'La Antena'; which year refers to movie_release_year;
SELECT movie_release_year FROM movies WHERE movie_title = 'La Antena'
movie_platform
Please give me the url of the movie "La Antena".
movie La Antena refers to movie_title = 'La Antena'; url refers to movie_url;
SELECT movie_url FROM movies WHERE movie_title = 'La Antena'
movie_platform
Which movie is more popular, "The General" or "Il grido"?
The General and Il grido are movie_title; more popular movie refers to higher (movie_popularity);
SELECT movie_title FROM movies WHERE movie_title = 'The General' OR movie_title = 'Il grido' ORDER BY movie_popularity DESC LIMIT 1
movie_platform
How many movies registered on Mubi are directed by Hong Sang-soo?
Hong Sang-soo is the name of director;
SELECT COUNT(movie_id) FROM movies WHERE director_name = 'Hong Sang-soo'
movie_platform
Was the user who created the list "250 Favourite Films" a trialist when he or she created the list?
the user was a trialist when he created the list refers to user_trailist = 1; 250 Favourite Films is list_title;
SELECT T2.user_trialist FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'
movie_platform
What's the description of user 85981819's movie list with the most followers?
user 85981819 refers to user_id = 85981819; most followers refers to Max(list_followers); description refers to list_descriptions;
SELECT T1.list_description FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 ORDER BY T1.list_followers DESC LIMIT 1
movie_platform
When did the creator of the list "250 Favourite Films" last updated a movie list?
250 Favourite Films refers to list_title; last update refers to list_update_date_utc;
SELECT T2.list_update_date_utc FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films' ORDER BY T2.list_update_date_utc DESC LIMIT 1
movie_platform
What's the avatar image of the user who created the movie list "250 Favourite Films"?
250 Favourite Films refers to list_title; avatar image refers to user_avatar_image_url;
SELECT T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'
movie_platform
How many more movie lists were created by the user who created the movie list "250 Favourite Films"?
250 Favourite Films refers to list_title;
SELECT COUNT(list_id) FROM lists_users WHERE user_id = ( SELECT user_id FROM lists WHERE list_title = '250 Favourite Films' )
movie_platform
How many users liked the movie "A Way of Life" to the highest extent?
like the movie highest to the extent refers to rating_score = 5; A Way of Life refers to movie_title;
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 = 'A Way of Life' AND T1.rating_score = 5
movie_platform
How many critics of the movie "Imitation of Life" got more than 1 like?
Imitation of Life refers to movie_title; critics got more than 1 like refers to critic_likes >1;
SELECT COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Imitation of Life' AND T1.critic_likes > 1
movie_platform
How many users were trialists when they rated the movie "A Way of Life"?
A Way of Life' refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1;
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 = 'When Will I Be Loved' AND T1.user_trialist = 1
movie_platform
How many users have rated the most popular movie?
most popular refers to Max(movie_popularity);
SELECT COUNT(rating_id) FROM ratings WHERE movie_id = ( SELECT movie_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )
movie_platform
Among the users who are trailists when rating the movie "When Will I Be Loved", how many of them have rated "1" on the movie?
When Will I Be Loved refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1;rated 1 on the movie refers to rating_score = 1;
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 = 'When Will I Be Loved' AND T1.rating_score = 1 AND T1.user_trialist = 1
movie_platform
How many ratings on the movie "A Way of Life" are made after the year 2011?
A Way of Life' is movie_title; rating after the year 2011 refers to rating_timestamp_utc > '2011';
SELECT COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_timestamp_utc >= '2012-01-01'
movie_platform
Who was the director of the movie "Tokyo Eyes"?
Tokyo Eyes' is movie_title, director refers to director_name;
SELECT director_name FROM movies WHERE movie_title = 'Tokyo Eyes'
movie_platform
How many films were released in 2007?
film released in 2007 refers to movie_release_year = 2007; film refers to movie
SELECT COUNT(*) FROM movies WHERE movie_release_year = 2007
movie_platform
Which of the films released in 2006 was the most popular among Mubi users?
released in 2006 refers to movie_release_year = 2006; most popular refers to Max(movie_popularity); film refers to movie;
SELECT movie_title FROM movies WHERE movie_release_year = 2006 ORDER BY movie_popularity DESC LIMIT 1
movie_platform
How many films did Åke Sandgren direct?
Ake Sandgren is the director name;  film refers to movie
SELECT COUNT(movie_title) FROM movies WHERE director_name = 'Åke Sandgren'
movie_platform
Which of the films directed by Álex de la Iclesia is the most popular among Mubi users?
Alex de la Iclesia is the director name; the most popular refers to Max(movie_popularity); films refers to movies;
SELECT movie_title FROM movies WHERE director_name = 'Åke Sandgren' ORDER BY movie_popularity DESC LIMIT 1
movie_platform
When was the movie Cops released?
Cops' is movie_title; released refers to movie_release_year;
SELECT movie_release_year FROM movies WHERE movie_title = 'Cops'
movie_platform
Please list the id of the director of the movie "It's Winter".
It's Winter' is movie_title;
SELECT director_id FROM movies WHERE movie_title = 'It''s Winter'
movie_platform
Please provide the ID of the user with the most followers on the list.
most followers refers to Max(list_followers);
SELECT user_id FROM lists ORDER BY list_followers DESC LIMIT 1
movie_platform
Please provide the title of the list with the most comments on the list.
the most comments refers to Max(list_comments);
SELECT list_title FROM lists GROUP BY list_title ORDER BY COUNT(list_comments) DESC LIMIT 1
movie_platform
How many users have more than 100 followers in the list created by users in 2009?
more than 100 followers refers to list_followers >100;  list created by the user in 2009 refers to list_creation_date_utc = '2009';
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 > 100 AND T1.list_creation_date_utc LIKE '2009%'
movie_platform
How many users in Mubi give the movie "White Night Wedding for 5"?
White Night Wedding' is movie_title; for 5 refers to rating_score = 5;
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5 AND T2.movie_title = 'White Night Wedding'
movie_platform
What's the cover image of the user who created the movie list 'Georgia related films'?
Play it cool' is list_title; cover image of user refers to user_cover_image_url;
SELECT T1.user_cover_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Georgia related films'
movie_platform
How many followers does the list created by the user whose user_avatar_image_url is https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214 have?
followers refers to list_followers;
SELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_avatar_image_url = 'https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214'
movie_platform
How many users were not trialists when they rated the movie "Patti Smith: Dream of Life"?
Patti Smith: Dream of Life' is movie_title; the user was not a trialist when he created the list refers to user_trialist = 0;
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
movie_platform
What was the title of the first list created by a user 85981819? And please provide the user_avatar_image_url.
user 85981819 refers to user_id = 85981819;  first list created refers to Min (list_creation_date_utc);
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
movie_platform
Which year had the most released films?
year refers to movie_release_year; most release films refers to MAX(COUNT(movie_id))
SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1
movie_platform
Who is the director that made the most movies? Give the director's id.
director that made the most movies refers to MAX(COUNT(movie_id))
SELECT director_id FROM movies GROUP BY director_id ORDER BY COUNT(movie_id) DESC LIMIT 1
movie_platform
How many movies did the director of the highest movie popularity make?
highest movie popularity refers to MAX(movie_popularity)
SELECT COUNT(movie_id) FROM movies WHERE director_id = ( SELECT director_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )
movie_platform
What's the number of the paying subscribers when rating a movie after the year 2014?
paying subscribers refers to user_has_payment_method = 1; rating a movie after the year 2014 refers to rating_date_utc>'2014%'
SELECT COUNT(user_subscriber) FROM ratings_users WHERE user_has_payment_method = 1 AND rating_date_utc > '2014%'
movie_platform
Who was the earliest user created a list but didn't get any followers? Give the user ID.
earliest user created a list refers to MIN(list_creation_date_utc); didn't get any followers refers to user_subscriber = 0
SELECT user_id FROM lists_users WHERE user_subscriber = 0 ORDER BY list_creation_date_utc LIMIT 1
movie_platform
Give the number of followers for the user who posted the most lists.
number of followers refers to user_subscriber; posted the most lists refers to MAX(COUNT(list_id))
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
movie_platform
How many followers did the user who posted the list "Non-American Films about World War II" have?
the list "Non-American Films about World War II" refers to list_title = 'Non-American Films about World War II'
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_platform
What's the number of users gave the movie "Downfall" a rating of "4"?
movie "Downfall" refers to movie_title = 'Downfall'; rating of "4" refers to rating_score = 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
movie_platform
Show the portrait picture of the user who created the list "Vladimir Vladimirovich Nabokov".
the list "Vladimir Vladimirovich Nabokov" refers to list_title = 'Vladimir Vladimirovich Nabokov'; portrait picture refers to user_avatar_image_url
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'
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?
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
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 )
movie_platform
How many critics were given to the movie that got the most movie popularity number.
most movie popularity number refers to MAX(movie_popularity)
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 )
movie_platform
How many paying subscribers gave a rating to the movie "One Flew Over the Cuckoo's Nest"?
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'
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
movie_platform
For all the movies that were released in 1995, how many lower than 3 ratings did the most popularity movie had?
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)
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_platform
What is the percentage of list created by user who was a subscriber when he created the list?
was a subscriber refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(list_id))
SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(list_id) FROM lists_users
movie_platform
Name all lists created by a user who was a subcriber when created the list.
was a subscriber refers to user_subscriber = 1
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
movie_platform
Among the lists with at least one follower, how many were created by user who was subscriber when created the list?
lists with at least one follower refers to list_followers > = 1; was a subscriber refers to user_subscriber = 1
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
movie_platform
For all list titles with at least 200 movies in the list, what is their average number of followers?
at least 200 movies in the list refers to list_movie_number > 200; average number of followers refers to avg(list_followers)
SELECT AVG(list_followers) FROM lists WHERE list_movie_number > 200
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.
have less than 50 movies in the list refers to list_movie_number <50; was a subscriber refers to user_subscriber = 1
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
movie_platform
Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list?
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
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'
movie_platform
Between 1970 to 1980, how many movies with a popularity of more than 11,000 were released?
Between 1970 to 1980 refers to movie_release_year between 1970 and 1980; popularity of more than 11,000 refers movie_popularity >11000
SELECT COUNT(movie_id) FROM movies WHERE movie_release_year BETWEEN '1970' AND '1980' AND movie_popularity > 11000
movie_platform
How many movies directed by Felipe Cazals was realeased on 1976?
directed by Felipe Cazals refers to director_name = 'Felipe Cazals' ; realeased on 1976 refers to movie_release_year = 1976
SELECT COUNT(movie_id) FROM movies WHERE movie_release_year = 1976 AND director_name LIKE 'Felipe Cazals'
movie_platform
What is the URL to the movie director page on Mubi of the movie titled "Red Blooded American Girl"
movie titled "Red Blooded American Girl" refers to movie_title = 'Red Blooded American Girl'
SELECT director_url FROM movies WHERE movie_title LIKE 'Red Blooded American Girl'
movie_platform
What is the name of the list that was updated most recently?
updated most recently refers to MAX(list_update_date_utc)
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 )
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
list that has 142 comments refers to list_comments = 142
SELECT user_id FROM lists WHERE list_comments = 142
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?
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
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%'
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.
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
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
book_publishing_company
Which date has the most ordered quantity? What is the total order quantity on that day?
total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(sum(qty))
SELECT ord_date, SUM(qty) FROM sales GROUP BY ord_date ORDER BY SUM(qty) DESC LIMIT 1
book_publishing_company
List the title, price and publication date for all sales with 'ON invoice' payment terms.
publication date refers to pubdate; payment terms refers to payterms; payterms = 'ON invoice'
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'
book_publishing_company
What is the title that have at least 10% royalty without minimum range amount.
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
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
book_publishing_company
State the title and royalty percentage for title ID BU2075 between 10000 to 50000 range.
lorange mean low range; hirange mean high range; range refers to between the low and high range; lorange>10000; hirange<12000
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'
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.
minimum range is synonym for low range which refers to lorange
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
book_publishing_company
Provide a list of titles together with its publisher name for all publishers located in the USA.
publisher name refers to pub_name;
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'
book_publishing_company
List all titles with sales of quantity more than 20 and store located in the CA state.
qty is abbreviation for quantity; sales of quantity more than 20 refers to qty>20; store refers to stor_name
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'
book_publishing_company
Name the store with the highest quantity in sales? What is the least quantity title from the store's sale?
qty is abbreviation for quantity; highest quantity refers to MAX(qty); least quantity refers to MIN(qty)
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
book_publishing_company
Name the title and publisher for title ID BU 2075. Provide all the royalty percentage for all ranges.
name the publisher refers to pub_name
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'
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.
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
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
book_publishing_company
State the publisher name for publisher ID 877? Calculate its average year to date sales.
publisher id refers to pub_id; publisher name refers to pub_name; average year to date sales = AVG(ytd_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
book_publishing_company
Which employee has the lowest job level. State the first name, last name and when he /she was hired.
lowest job level refers to MIN(job_lvl)
SELECT fname, lname, hire_date FROM employee ORDER BY job_lvl LIMIT 1
book_publishing_company
List all employees who are at the maximum level in their job designation.
maximum level in their job designation refers to job_lvl = MAX(max_lvl)
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
book_publishing_company
Name the Chief Executive Officer and when he/she was hired.
Chief Financial Offer is a job description which refers to job_desc
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'
book_publishing_company
Who are the employees working for publisher not located in USA? State the employee's name and publisher name.
not located at USA refers to country! = 'USA'
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'
book_publishing_company
List all employees working for publisher 'GGG&G'. State their name and job description.
name = fname, lname; job description refers to job_desc; publisher refers pub_name
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'
book_publishing_company
For each publisher, state the type of titles they published order by the publisher name.
publisher name refers to pub_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
book_publishing_company
Name the title with the highest price published by 'Binnet & Hardley'.
published by refers to pub_name
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
book_publishing_company
Among all employees, who have job level greater than 200. State the employee name and job description.
job level greater than 200 refers to job_lvl>200; job description refers to job_desc
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
book_publishing_company
Name all the authors for all business titles.
business title refers to title under business where type = 'business'
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'
book_publishing_company
Name all the authors for 'Sushi, Anyone?'.
most year to date sales refers to MAX(ytd_sales); on contract refers to contract = 1; name of author = au_fname, au_lname
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?'
book_publishing_company
Calculate the percentage of the employees who are Editor or Designer?
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
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
book_publishing_company
List all titles which have year to date sales higher than the average order by pubisher name.
year to date sales refers to ytd_sales; average order = AVG(ytd_sales)
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 )
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
39