input
stringlengths
358
16.1k
output
stringlengths
24
805
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Name movie titles released in year 1945. Sort the listing by the descending order of movie popularity. [/INST]
SELECT movie_title FROM movies WHERE movie_release_year = 1945 ORDER BY movie_popularity DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: State the most popular movie? When was it released and who is the director for the movie? [/INST]
SELECT movie_title, movie_release_year, director_name FROM movies ORDER BY movie_popularity DESC LIMIT 1 ;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of the longest movie title? When was it released? [/INST]
SELECT movie_title, movie_release_year FROM movies ORDER BY LENGTH(movie_popularity) DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Name the movie with the most ratings. [/INST]
SELECT movie_title FROM movies GROUP BY movie_title ORDER BY COUNT(movie_title) DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average number of Mubi users who love movies directed by Stanley Kubrick? [/INST]
SELECT AVG(movie_popularity) FROM movies WHERE director_name = 'Stanley Kubrick';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average rating for movie titled 'When Will I Be Loved'? [/INST]
SELECT AVG(T2.rating_score) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'When Will I Be Loved';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the user avatar url for user 41579158? What is the latest movie rated by him / her? [/INST]
SELECT T3.user_avatar_image_url, T3.rating_date_utc FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T3.user_id = T2.user_id WHERE T3.user_id = 41579158 ORDER BY T3.rating_date_utc DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the percentage of the ratings were rated by user who was a subcriber? [/INST]
SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: List all movie title rated in April 2020 from user who was a trialist. [/INST]
SELECT T1.movie_title FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 1 AND T2.rating_timestamp_utc LIKE '2020-04%';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: List ther users who gave the worst rating for movie 'Love Will Tear Us Apart'. [/INST]
SELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Love Will Tear Us Apart' AND T1.rating_score = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: List all movies with the best rating score. State the movie title and number of Mubi user who loves the movie. [/INST]
SELECT DISTINCT T2.movie_title, T2.movie_popularity FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: For all ratings which are rated in year 2020, name the movies which has the rating scored 4 and above. [/INST]
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE CAST(SUBSTR(T1.rating_timestamp_utc, 1, 4) AS INTEGER) = 2020 AND CAST(SUBSTR(T1.rating_timestamp_utc, 6, 2) AS INTEGER) > 4;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: For all movies where users left a critic, find the movie name, user, rating and critics comments from the user. [/INST]
SELECT T2.movie_title, T1.user_id, T1.rating_score, T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic IS NOT NULL;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: For movie titled 'Welcome to the Dollhouse', how many percentage of the ratings were rated with highest score. [/INST]
SELECT CAST(SUM(CASE WHEN T2.rating_score = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'Welcome to the Dollhouse';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the percentage of rated movies were released in year 2021? [/INST]
SELECT CAST(SUM(CASE WHEN T1.movie_release_year = 2021 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Who is the director of the movie Sex, Drink and Bloodshed? [/INST]
SELECT director_name FROM movies WHERE movie_title = 'Sex, Drink and Bloodshed';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of the most followed list? [/INST]
SELECT list_title FROM lists ORDER BY list_followers DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What are the URL to the list page on Mubi of the lists with followers between 1-2 and whose last update timestamp was on 2012? [/INST]
SELECT list_url FROM lists WHERE list_update_timestamp_utc LIKE '2012%' AND list_followers BETWEEN 1 AND 2 ORDER BY list_update_timestamp_utc DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the list ID that was first created by user 85981819? [/INST]
SELECT list_id FROM lists_users WHERE user_id = 85981819 ORDER BY list_creation_date_utc ASC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: For movie id 1269, how many users, who was a paying subscriber and was eligible for trial when he rated the movie, gave the movie a rating score of less than or equal to 2? [/INST]
SELECT COUNT(*) FROM ratings WHERE movie_id = 1269 AND rating_score <= 2 AND user_eligible_for_trial = 1 AND user_has_payment_method = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What are the movie popularity of the movies released in 2021 that were directed by Steven Spielberg? List the names of the movies and their corresponding popularity. [/INST]
SELECT movie_title, movie_popularity FROM movies WHERE movie_release_year = 2021 AND director_name = 'Steven Spielberg';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: When was the first movie released and who directed it? [/INST]
SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the user ID of the user, who was a subscriber when he created the list, who created a list for 10 consecutive years? If there are multiple users, indicate each of their user IDs. [/INST]
SELECT user_id FROM lists_users WHERE user_subscriber = 1 GROUP BY user_id HAVING MAX(SUBSTR(list_creation_date_utc, 1, 4)) - MIN(SUBSTR(list_creation_date_utc, 1, 4)) >= 10;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users gave "Pavee Lackeen: The Traveller Girl" movie a rating score of 4? [/INST]
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'Pavee Lackeen: The Traveller Girl' AND T2.rating_score = 4;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Was the user who created the "World War 2 and Kids" list eligible for trial when he created the list? Indicate how many followers does the said list has. [/INST]
SELECT T2.user_eligible_for_trial, T1.list_followers FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T1.user_id AND T1.list_id = T2.list_id WHERE T1.list_title = 'World War 2 and Kids';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Which year was the third movie directed by Quentin Tarantino released? Indicate the user ids of the user who gave it a rating score of 4. [/INST]
SELECT T2.movie_release_year, T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_id = ( SELECT movie_id FROM movies WHERE director_name = 'Quentin Tarantino' ORDER BY movie_release_year ASC LIMIT 2, 1 ) AND T1.rating_score = 4;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the URL to the movie director page on Mubi of the director whose movie was critic by user 2452551 and was given 39 likes? [/INST]
SELECT T2.director_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 2452551 AND T1.critic_likes = 39;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average rating score of the movie "When Will I Be Loved" and who was its director? [/INST]
SELECT AVG(T1.rating_score), T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movies were added to the list with the most number of movies? Indicate whether the user was a paying subscriber or not when he created the list. [/INST]
SELECT T1.list_movie_number, T2.user_has_payment_method FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id ORDER BY T1.list_movie_number DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the name of the movie whose critic received the highest number of likes related to the critic made by the user rating the movie? [/INST]
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How much is the popularity of the movie that has the highest popularity between 1920 to 1929 and when did the movie received its first rating score of 1 from the users who were a paying subscriber when they rated the movie ? [/INST]
SELECT MAX(T2.movie_popularity), MIN(T1.rating_timestamp_utc) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1920 AND 1929 AND T1.rating_score = 1 AND T1.user_has_payment_method = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movies directed by Francis Ford Coppola have a popularity of more than 1,000? Indicate what is the highest amount of likes that each critic per movie has received, if there's any. [/INST]
SELECT COUNT(T2.movie_title), T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Francis Ford Coppola' AND T2.movie_popularity > 1000;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the URL to the user profile image on Mubi of the user who gave the movie id of 1103 a 5 ratinng score on 4/19/2020? [/INST]
SELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN ratings_users AS T2 ON T1.user_id = T2.user_id WHERE T2.user_id = 1103 AND rating_score = 5 AND T2.rating_date_utc = '2020-04-19';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Among the lists created by user 4208563, which one has the highest number of followers? Indicate how many followers it has and whether the user was a subscriber or not when he created the list. [/INST]
SELECT T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563 ORDER BY T1.list_followers DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Which year has the least number of movies that was released and what is the title of the movie in that year that has the highest number of rating score of 1? [/INST]
SELECT DISTINCT T1.movie_release_year, T1.movie_title FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = ( SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1 ) AND T2.rating_score = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users, who were a paying subscriber when they rated the movie, gave the movie that was released in 1924 and directed by Erich von Stroheim a rating score of 5? [/INST]
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = 1924 AND T1.director_name = 'Erich von Stroheim' AND T2.rating_score = 5 AND T2.user_has_payment_method = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average number of movies added to the lists of user 8516503? Give the user profile image URL on Mubi. [/INST]
SELECT AVG(T1.list_movie_number), T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T2.user_id = 8516503;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users rated the movie "The Magnificent Ambersons" gave a rating score of no more than 2? List all the URL to the rating on Mubi. [/INST]
SELECT COUNT(T2.user_id), T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'The Magnificent Ambersons' AND T2.rating_score <= 2;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users who created a list in the February of 2016 were eligible for trial when they created the list? Indicate the user id of the user who has the most number of followers in his list in February of 2016. [/INST]
SELECT T1.list_followers FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T1.list_id = T2.list_id WHERE T2.list_creation_date_utc BETWEEN '2016-02-01' AND '2016-02-29' AND T2.user_eligible_for_trial = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the URL to the rating on Mubi of the Riff-Raff movie that was given the highest rating score by user 22030372? [/INST]
SELECT T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_id = 22030372 AND T2.rating_score = 5 AND T1.movie_title = 'Riff-Raff';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many directors have directed atleast 10 movies between 1960 to 1985? Indicate the name of the movie in those years of each director that received the highest amount of 5 rating score. [/INST]
SELECT T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1960 AND 1985 GROUP BY T2.director_name HAVING COUNT(T2.movie_id) > 10;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users, who were not a a trialist when they rated the movie, gave the movie "The South" a rating score of not more than 2? [/INST]
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 0 AND T2.rating_score <= 2 AND T1.movie_title = 'The South';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many likes did the critic of the movie "Apocalypse Now" received after giving the movie a rating score of 5? [/INST]
SELECT T2.critic_likes FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 0 AND T2.rating_score = 5 AND T1.movie_title = 'Apocalypse Now';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average rating score of the movie "The Crowd" and who was its director? [/INST]
SELECT AVG(T2.rating_score), T1.director_name FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'The Crowd';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: When was the first movie of the director who directed the highest number of movies released and what is the user id of the user who received the highest number of comments related to the critic made by the user rating the movie? [/INST]
SELECT MIN(movie_release_year) FROM movies WHERE director_name = ( SELECT T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1960 AND 1985 GROUP BY T2.director_name ORDER BY COUNT(T2.director_name) DESC LIMIT 1 );
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movies have a popularity of more than 400 but less than 500? Indicate the name of the movies and the highest rating score each movie has received. [/INST]
SELECT T1.movie_title, MAX(T2.rating_score) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_popularity BETWEEN 400 AND 500 GROUP BY T1.movie_title;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the URL to the rating on Mubi made by user 45579900 for the movie "The Vertical Ray of the Sun" that received 20 likes? [/INST]
SELECT T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_id = 45579900 AND T1.movie_title = 'The Vertical Ray of the Sun' AND T2.critic_likes = 20;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average popularity of each movie that was directed by Christopher Nolan? Indicate which movie directed by him has received the highest number of 5 rating scores. [/INST]
SELECT AVG(T2.movie_popularity) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Christopher Nolan';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What are the names of the movie that was rated by the user between 1/1/2013 to 12/31/2013 by the user who created the list "100 Greatest Living American Filmmakers"? Calculate for the average rating score of those movies in 2013. [/INST]
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T1.rating_timestamp_utc BETWEEN '2013-01-01' AND '2013-12-31' AND T3.list_title = '100 Greatest Living American Filmmakers';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average rating score of the 'Pavee Lackeen: The Traveller Girl' movie and what year was it released? [/INST]
SELECT AVG(T1.rating_score), T2.movie_release_year FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Pavee Lackeen: The Traveller Girl';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movie lists were still updated 10 years after it was created? [/INST]
SELECT COUNT(*) FROM lists WHERE SUBSTR(list_update_timestamp_utc, 1, 4) - SUBSTR(list_creation_timestamp_utc, 1, 4) > 10;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's the description for the movie list "Short and pretty damn sweet"? [/INST]
SELECT list_description FROM lists WHERE list_title = 'Short and pretty damn sweet';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Where can I find the movie list "Short and pretty damn sweet"? [/INST]
SELECT list_url FROM lists WHERE list_title = 'Short and pretty damn sweet';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Among the movie lists created after 2010/1/1, how many of them have over 200 followers? [/INST]
SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_update_timestamp_utc > '2010-01-01';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movie lists were created by user 83373278 when he or she was a subscriber? [/INST]
SELECT COUNT(*) FROM lists_users WHERE user_id = 83373278 AND user_subscriber = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: In which year was the movie "La Antena" released? [/INST]
SELECT movie_release_year FROM movies WHERE movie_title = 'La Antena';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Please give me the url of the movie "La Antena". [/INST]
SELECT movie_url FROM movies WHERE movie_title = 'La Antena';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Which movie is more popular, "The General" or "Il grido"? [/INST]
SELECT movie_title FROM movies WHERE movie_title = 'The General' OR movie_title = 'Il grido' ORDER BY movie_popularity DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movies registered on Mubi are directed by Hong Sang-soo? [/INST]
SELECT COUNT(movie_id) FROM movies WHERE director_name = 'Hong Sang-soo';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Was the user who created the list "250 Favourite Films" a trialist when he or she created the list? [/INST]
SELECT T2.user_trialist FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the titles of the movie lists user 32172230 created when he or she was eligible for trial. [/INST]
SELECT T1.list_title FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 32172230 AND T2.user_eligible_for_trial = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many movie lists with over 100 movies had user 85981819 created when he or she was a paying subscriber? [/INST]
SELECT COUNT(*) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 AND T1.list_movie_number > 100 AND T2.user_has_payment_method = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's the description of user 85981819's movie list with the most followers? [/INST]
SELECT T1.list_description FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 ORDER BY T1.list_followers DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: When did the creator of the list "250 Favourite Films" last updated a movie list? [/INST]
SELECT T2.list_update_date_utc FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films' ORDER BY T2.list_update_date_utc DESC LIMIT 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's the avatar image of the user who created the movie list "250 Favourite Films"? [/INST]
SELECT T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many more movie lists were created by the user who created the movie list "250 Favourite Films"? [/INST]
SELECT COUNT(list_id) FROM lists_users WHERE user_id = ( SELECT user_id FROM lists WHERE list_title = '250 Favourite Films' );
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users liked the movie "A Way of Life" to the highest extent? [/INST]
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_score = 5;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Please list all the critics made by the user rating the movie "A Way of Life". [/INST]
SELECT T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many critics of the movie "Imitation of Life" got more than 1 like? [/INST]
SELECT COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Imitation of Life' AND T1.critic_likes > 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Which user made a critic for the film "When Will I Be Loved" and got 2 comments for the critic? [/INST]
SELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.critic_comments = 2;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: When did user 39115684 rate the movie "A Way of Life"? [/INST]
SELECT T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's the url of user 39115684's rating on the movie 'When Will I Be Loved'? [/INST]
SELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Was user 39115684 a trialist when he or she rated the movie "A Way of Life"? [/INST]
SELECT T1.user_trialist FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users were trialists when they rated the movie "A Way of Life"? [/INST]
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.user_trialist = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Please list all the links to the ratings on the movie "A Way of Life" with a critic. [/INST]
SELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.critic IS NOT NULL;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many users have rated the most popular movie? [/INST]
SELECT COUNT(rating_id) FROM ratings WHERE movie_id = ( SELECT movie_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 );
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: User 58149469's critic on which film got 1 like and 2 comments? [/INST]
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 58149469 AND T1.critic_likes = 1 AND T1.critic_comments = 2;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Among the users who are trailists when rating the movie "When Will I Be Loved", how many of them have rated "1" on the movie? [/INST]
SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.rating_score = 1 AND T1.user_trialist = 1;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many ratings on the movie "A Way of Life" are made after the year 2011? [/INST]
SELECT COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_timestamp_utc >= '2012-01-01';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's of rating on the movie "Innocence Unprotected" by the user who created the movie list "250 Favourite Films"? [/INST]
SELECT T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T2.movie_title = 'Innocence Unprotected' AND T3.list_title = '250 Favourite Films';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the movies rated by the user who created the movie list "250 Favourite Films". [/INST]
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T3.list_title = '250 Favourite Films';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's the average rating score of the movie "A Way of Life"? [/INST]
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 = 'A Way of Life';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: What's the percentage of the users who have rated "1" on the movie "When Will I Be Loved"? [/INST]
SELECT CAST(SUM(CASE WHEN T1.rating_score = 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 WHERE T2.movie_title = 'When Will I Be Loved';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How much higher is the average rating score of the movie "Innocence Unprotected" than the movie "When Will I Be Loved"? [/INST]
SELECT SUM(CASE WHEN T2.movie_title = 'Innocence Unprotected' THEN T1.rating_score ELSE 0 END) / SUM(CASE WHEN T2.movie_title = 'Innocence Unprotected' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.movie_title = 'When Will I Be Loved' THEN T1.rating_score ELSE 0 END) / SUM(CASE WHEN T2.movie_title = 'When Will I Be Loved' THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Who was the director of the movie "Tokyo Eyes"? [/INST]
SELECT director_name FROM movies WHERE movie_title = 'Tokyo Eyes';
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: How many films were released in 2007? [/INST]
SELECT COUNT(*) FROM movies WHERE movie_release_year = 2007;
[INST] Here is a database schema: lists : user_id [ INTEGER ] lists.user_id = lists_users.user_id list_id [ INTEGER ] primary_key list_title [ TEXT ] list_movie_number [ INTEGER ] list_update_timestamp_utc [ TEXT ] list_creation_timestamp_utc [ TEXT ] list_followers [ INTEGER ] list_url [ TEXT ] list_comments [ INTEGER ] list_description [ TEXT ] list_cover_image_url [ TEXT ] list_first_image_url [ TEXT ] list_second_image_url [ TEXT ] list_third_image_url [ TEXT ] movies : movie_id [ INTEGER ] primary_key movie_title [ TEXT ] movie_release_year [ INTEGER ] movie_url [ TEXT ] movie_title_language [ TEXT ] movie_popularity [ INTEGER ] movie_image_url [ TEXT ] director_id [ TEXT ] director_name [ TEXT ] director_url [ TEXT ] ratings_users : user_id [ INTEGER ] ratings_users.user_id = lists_users.user_id rating_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] lists_users : user_id [ INTEGER ] lists_users.user_id = lists.user_id list_id [ INTEGER ] lists_users.list_id = lists.list_id list_update_date_utc [ TEXT ] list_creation_date_utc [ TEXT ] user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_avatar_image_url [ TEXT ] user_cover_image_url [ TEXT ] user_eligible_for_trial [ TEXT ] user_has_payment_method [ TEXT ] ratings : movie_id [ INTEGER ] ratings.movie_id = movies.movie_id rating_id [ INTEGER ] rating_url [ TEXT ] rating_score [ INTEGER ] rating_timestamp_utc [ TEXT ] critic [ TEXT ] critic_likes [ INTEGER ] critic_comments [ INTEGER ] user_id [ INTEGER ] ratings.user_id = lists_users.user_id user_trialist [ INTEGER ] user_subscriber [ INTEGER ] user_eligible_for_trial [ INTEGER ] user_has_payment_method [ INTEGER ] Please write me a SQL statement that answers the following question: Which of the films released in 2006 was the most popular among Mubi users? [/INST]
SELECT movie_title FROM movies WHERE movie_release_year = 2006 ORDER BY movie_popularity DESC LIMIT 1;

Dataset Card for "bird_text_to_sql"

More Information needed

Downloads last month
115