db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
1
673
SQL
stringlengths
23
804
schema
stringclasses
69 values
movie_platform
Please list the names of the films released in 2003 among the films scored by user 2941 .
released in 2003 refers to movie_release_year = 2003; user 2941 refers to user_id = 2941; film refers to movie;
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Which movie has the highest average score in Mubi?
Highest average score refers to Max(Avg(rating_score));
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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.
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);
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Please list the names of the movies that have been rated the most times in 2020.
in 2020 refers to rating_timestamp_utc = '2020%'; rated the most times refers to Max(Count(movie_title));
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
What is the average score for the movie Versailles Rive-Gauche?
Versailles Rive-Gauche' is movie_title; average score refers to Avg(rating_score);
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Which film rated by user 59988436 that received 21 comments?
user 59988436 refers to user_id = 59988436; received 21 comments refers to critic_comments = 21; film refers to movie;
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Please list the names of the movies that received more than 20 likes?
received more than 20 likes refers to critic_likes>20;
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
What is the average score of the movie "The Fall of Berlin" in 2019?
The Fall of Berlin' is movie_title; in 2019 refers to rating_timestamp_utc = 2019; Average score refers to Avg(rating_score);
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
What percentage of users rated the movie "Patti Smith: Dream of Life" by more than 3?
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
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Which of the film directed by director Abbas Kiarostami has the highest average score?
Abbas Kiarostami' is director_name; the highest Average score refers to Max(Avg(rating_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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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 )
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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%'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Give the name of the movie that got the most "5" ratings.
5 ratings refers to rating_score = 5; name of the movie refers to movie_title
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Which movie got the most critic comments? Give the name of the movie.
name of the movie refers to movie_title; most critic comments refers to MAX(critic_comments)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Show the avatar of the user who gave the rating at 2019/10/17 1:36:36.
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
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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 )
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Show the head portrait of the user who gave the most "5" ratings.
head portrait refers to user_avatar_image_url; "5" ratings refers to rating_score = 5
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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 )
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Who gave a "4" rating to the movie "Freaks" at 2013/5/4 6:33:32? Give his/her user id.
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'
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Give the url of movie which was rated 5 on 2013/5/3 5:11:17.
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'
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
For the 1998 movie which got the highest popularity, how many "4" rating did the movie get?
1998 movie refers to movie_release_year = '1998'; the highest popularity refers to MAX(movie_popularity) ; "4" rating refers to rating_score = 4
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
From all the movies that got more than 13000 popularity number, which one had the least ratings.
more than 13000 popularity number refers to movie_popularity > 13000; least ratings refers to MIN(rating_score)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
For the lists that got more than 3000 followers, how many did the users who created those lists are paying subscribers?
got more than 3000 followers refers to list_followers > 3000; paying subscribers refer to user_has_payment_method = 1
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Which 1988 movie got the most ratings?
1988 movie refers to movie_release_year = '1998'; most ratings refers to MAX(rating_score)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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 )
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
What is the percentage of users gave "5" to the movie "Go Go Tales"?
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
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Give the percentage of subscribers who rated who rated the movie "G.I. Jane".
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
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
For all the users who gave "A Shot in the Dark" a rating, how many percent of them is a paying subscriber?
"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
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Name all the list titles created by user 4208563.
user 4208563 refers to user_id = 4208563
SELECT list_title FROM lists WHERE user_id LIKE 4208563
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Among the lists created in 2016, which is the list that was updated most recently.
created in 2016 refers to list_creation_timestamp_utc like '2016%'; updated most recently refers to MAX(list_update_timestamp_utc)
SELECT list_title FROM lists WHERE strftime('%Y', list_update_timestamp_utc) = '2016' ORDER BY list_update_timestamp_utc DESC LIMIT 1
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Provide list titles created by user who are eligible for trial when he created the list.
eligible for trial refers to user_eligible_for_trial = 1
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Which title list has not been updated for the longest period of time? State how long it has not been updated?
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)
SELECT list_title , datetime(CURRENT_TIMESTAMP, 'localtime') - datetime(list_update_timestamp_utc) FROM lists ORDER BY list_update_timestamp_utc LIMIT 1
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
For the list with more than 200 followers, state the title and how long the list has been created?
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)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
Among all movies in the list, calculate the percentage of movies that were never been rated?
percentage of movies that were never been rated refers to DIVIDE(COUNT(main_movies.movie_id ! = main_ratings.movie_id),COUNT(movie_id))
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
List all movies rated by user 39115684. State the title, rating date and rating score.
user 39115684 refers to user_id = 39115684; title refers to movie_title; rating date refers to rating_timestamp_utc
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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 )
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
What is Jeannot Szwarc's most popular movie and what is its average rating score?
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)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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.
highest number of movies COUNT(T1.movie_id); in the 70s refers to movie_release_year between 1970 and 1979
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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%'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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.
critic received the highest amount of likes refers to MAX(critic_likes);
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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.
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
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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?
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'
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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?
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'
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'
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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.
most popular movie of all time refers to MAX(movie_popularity); a trialist refers to user_trialist = 1; average rating score = AVG(rating_score)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
movie_platform
What is the name of the movie that was rated recently by user 57756708?
user 57756708 refers to user_id = 57756708; rated recently refers to MAX(rating_timestamp_utc)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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.
the average rating score refers to AVG(T2.rating_score); oldest movies refers to MIN(rating_timestamp_utc)
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
database name:db_id movie_platform lists table lists Cols: user_id dtype integer, list_id dtype integer, list_title dtype text, list_movie_number dtype integer, list_update_timestamp_utc dtype text, list_creation_timestamp_utc dtype text, list_followers dtype integer, list_url dtype text, list_comments dtype integer, list_description dtype text, list_cover_image_url dtype text, list_first_image_url dtype text, list_second_image_url dtype text, list_third_image_url dtype text, movies table movies Cols: movie_id dtype integer, movie_title dtype text, movie_release_year dtype integer, movie_url dtype text, movie_title_language dtype text, movie_popularity dtype integer, movie_image_url dtype text, director_id dtype text, director_name dtype text, director_url dtype text, ratings_users table ratings_users Cols: user_id dtype integer, rating_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer, lists_users table lists_users Cols: user_id dtype integer, list_id dtype integer, list_update_date_utc dtype text, list_creation_date_utc dtype text, user_trialist dtype integer, user_subscriber dtype integer, user_avatar_image_url dtype text, user_cover_image_url dtype text, user_eligible_for_trial dtype text, user_has_payment_method dtype text, ratings table ratings Cols: movie_id dtype integer, rating_id dtype integer, rating_url dtype text, rating_score dtype integer, rating_timestamp_utc dtype text, critic dtype text, critic_likes dtype integer, critic_comments dtype integer, user_id dtype integer, user_trialist dtype integer, user_subscriber dtype integer, user_eligible_for_trial dtype integer, user_has_payment_method dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
What is the title with the most ordered quantity in year 1992?
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
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
State the royalty percentage for the most year to date sale title within the 20000 range.
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
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
List all titles published in year 1991. Also provide notes details of the title and the publisher's name.
publisher name refers to pub_name; publication date refers to pubdate; published in year 1991 refers to YEAR(pubdate) = 1991
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
Name all employees who were hired before year 1990.
hired before year 1990 refers to YEAR(hire_date)<1990
SELECT fname, lname FROM employee WHERE STRFTIME('%Y', hire_date) < '1990'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
In which year has the most hired employees?
most hired employees refers to MAX(count(emp_id))
SELECT STRFTIME('%Y', hire_date) FROM employee GROUP BY STRFTIME('%Y', hire_date) ORDER BY COUNT(emp_id) DESC LIMIT 1
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
Name the publisher which has the most titles published in 1991.
most title published refers to MAX(count(title_id); published in 1991 refers to YEAR(pubdate) = 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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
List all the titles and year to date sales by author who are not on contract.
year to date sales refers to ytd_sales; not on contract refers to contract = 0
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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.
year to date sales refers to ytd_sales; on contract refers to contract = 1
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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?'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
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 )
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
How many publishers are in the USA?
null
SELECT COUNT(pub_id) FROM publishers WHERE country = 'USA'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,
book_publishing_company
What is the publisher's information of New Moon Books?
publisher name refers to pub_name; New Moon Books is a publisher name
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'
database name:db_id book_publishing_company authors table authors Cols: author id dtype text, author last name dtype text, author first name dtype text, phone dtype text, address dtype text, city dtype text, state dtype text, zip dtype text, contract dtype text, jobs table jobs Cols: job id dtype integer, job description dtype text, min level dtype integer, max level dtype integer, publishers table publishers Cols: publisher id dtype text, publisher name dtype text, city dtype text, state dtype text, country dtype text, employee table employee Cols: employee id dtype text, first name dtype text, minit dtype text, last name dtype text, job id dtype integer, job level dtype integer, publisher id dtype text, hire_date dtype datetime, pub_info table pub_info Cols: publication id dtype text, logo dtype blob, publisher's information dtype text, stores table stores Cols: store id dtype text, store name dtype text, store address dtype text, city dtype text, state dtype text, zip dtype text, discounts table discounts Cols: discount type dtype text, store id dtype text, low quantity dtype integer, high quantity dtype integer, discount dtype real, titles table titles Cols: title id dtype text, title dtype text, type dtype text, publisher id dtype text, price dtype real, advance dtype real, royalty dtype integer, year to date sales dtype integer, notes dtype text, publication date dtype datetime, roysched table roysched Cols: title_id dtype text, low range dtype integer, high range dtype integer, royalty dtype integer, sales table sales Cols: store id dtype text, order number dtype text, order date dtype datetime, quantity dtype integer, payterms dtype text, title id dtype text, titleauthor table titleauthor Cols: author id dtype text, title id dtype text, author ordering dtype integer, royaltyper dtype integer,