instruction
stringlengths
573
18.4k
db_id
stringlengths
4
75
source
stringclasses
2 values
sql_complexity
stringclasses
4 values
cnt_true
int64
0
10
question
stringlengths
24
2.03k
evidence
stringlengths
0
673
SQL
stringlengths
30
6.62k
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
State the most popular movie? When was it released and who is the director for the movie?
most popular movie refers to MAX(movie_popularity); when it was released refers to movie_release_year; director for the movie refers to director_name;
SELECT movie_title, movie_release_year, director_name FROM movies ORDER BY movie_popularity DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Moderate
7
What is the average number of Mubi users who love movies directed by Stanley Kubrick?
average = AVG(movie_popularity); number of Mubi users who loves the movie refers to movie_popularity;
SELECT AVG(movie_popularity) FROM movies WHERE director_name = 'Stanley Kubrick'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
Who is the director of the movie Sex, Drink and Bloodshed?
Sex, Drink and Bloodshed refers to movie title = 'Sex, Drink and Bloodshed';
SELECT director_name FROM movies WHERE movie_title = 'Sex, Drink and Bloodshed'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Simple
10
What is the name of the most followed list?
most followed list refers to MAX(list_followers);
SELECT list_title FROM lists ORDER BY list_followers DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Simple
10
What is the list ID that was first created by user 85981819?
first created list refers to oldest list_creation_date_utc;
SELECT list_id FROM lists_users WHERE user_id = 85981819 ORDER BY list_creation_date_utc ASC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, user_id in...
movie_platform
bird
Moderate
8
What are the movie popularity of the movies released in 2021 that were directed by Steven Spielberg? List the names of the movies and their corresponding popularity.
movie released in 2021 refers to movie_release_year = 2021; popularity refers to movie_popularity;
SELECT movie_title, movie_popularity FROM movies WHERE movie_release_year = 2021 AND director_name = 'Steven Spielberg'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Highly Complex
0
When was the first movie released and who directed it?
first movie refers to oldest movie_release_year;
SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Moderate
8
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.
user was eligible for trial when he created the list refers to user_eligible_for_trial = 1; number of followers a list have refers to list_followers;
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'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Complex
3
How many movies were added to the list with the most number of movies? Indicate whether the user was a paying subscriber or not when he created the list.
list with the most number of movies refers to MAX(list_movie_number); user_has_payment_method = 1 means the user was a paying subscriber when he created the list; user_has_payment_method = 0 means the user was not a paying subscriber when he created the list;
SELECT T1.list_movie_number, T2.user_has_payment_method FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id ORDER BY T1.list_movie_number DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_url...
movie_platform
bird
Complex
4
What is the average number of movies added to the lists of user 8516503? Give the user profile image URL on Mubi.
user profile image URL refers to user_avatar_image_url; user 8516503 refers to user_id; Average refers to AVG(list_movie_number where user_id = 8516503)
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
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_id ...
movie_platform
bird
Simple
10
What's the description for the movie list "Short and pretty damn sweet"?
Short and pretty damn sweet is list_title; description refers to list_description;
SELECT list_description FROM lists WHERE list_title = 'Short and pretty damn sweet'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
Where can I find the movie list "Short and pretty damn sweet"?
Short and pretty damn sweet is list_title; location of the movie refers to list_url;
SELECT list_url FROM lists WHERE list_title = 'Short and pretty damn sweet'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Simple
10
Among the movie lists created after 2010/1/1, how many of them have over 200 followers?
created after 2010/1/1 refers to list_update_timestamp_utc>'2010/1/1'; over 200 followers refers to list_followers>200;
SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_update_timestamp_utc > '2010-01-01'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Simple
10
How many movie lists were created by user 83373278 when he or she was a subscriber?
the user was a subscriber when he created the list refers to user_subscriber = 1; user 83373278 refers to user_id = 83373278;
SELECT COUNT(*) FROM lists_users WHERE user_id = 83373278 AND user_subscriber = 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Simple
10
In which year was the movie "La Antena" released?
movie La Antena refers to movie_title = 'La Antena'; which year refers to movie_release_year;
SELECT movie_release_year FROM movies WHERE movie_title = 'La Antena'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
Please give me the url of the movie "La Antena".
movie La Antena refers to movie_title = 'La Antena'; url refers to movie_url;
SELECT movie_url FROM movies WHERE movie_title = 'La Antena'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Moderate
5
Which movie is more popular, "The General" or "Il grido"?
The General and Il grido are movie_title; more popular movie refers to higher (movie_popularity);
SELECT movie_title FROM movies WHERE movie_title = 'The General' OR movie_title = 'Il grido' ORDER BY movie_popularity DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, director_id...
movie_platform
bird
Simple
10
How many movies registered on Mubi are directed by Hong Sang-soo?
Hong Sang-soo is the name of director;
SELECT COUNT(movie_id) FROM movies WHERE director_name = 'Hong Sang-soo'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, user_id in...
movie_platform
bird
Moderate
6
Was the user who created the list "250 Favourite Films" a trialist when he or she created the list?
the user was a trialist when he created the list refers to user_trailist = 1; 250 Favourite Films is list_title;
SELECT T2.user_trialist FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Moderate
8
Please list the titles of the movie lists user 32172230 created when he or she was eligible for trial.
the user was eligible for trail when he created the list refers to user_eligile_for_trail = 1; user 32172230 refers to user_id = 32172230;
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
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Highly Complex
0
How many movie lists with over 100 movies had user 85981819 created when he or she was a paying subscriber?
the user was a paying subscriber when he created the list refers to user_has_payment_method = 1;  movie lists with over 100 refers to list_movie_number >100;  user 85981819 refers to user_id = 85981819;
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
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
9
What's the description of user 85981819's movie list with the most followers?
user 85981819 refers to user_id = 85981819; most followers refers to Max(list_followers); description refers to list_descriptions;
SELECT T1.list_description FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 ORDER BY T1.list_followers DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_id ...
movie_platform
bird
Complex
1
When did the creator of the list "250 Favourite Films" last updated a movie list?
250 Favourite Films refers to list_title; last update refers to list_update_date_utc;
SELECT T2.list_update_date_utc FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films' ORDER BY T2.list_update_date_utc DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Moderate
7
What's the avatar image of the user who created the movie list "250 Favourite Films"?
250 Favourite Films refers to list_title; avatar image refers to user_avatar_image_url;
SELECT T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
How many more movie lists were created by the user who created the movie list "250 Favourite Films"?
250 Favourite Films refers to list_title;
SELECT COUNT(list_id) FROM lists_users WHERE user_id = ( SELECT user_id FROM lists WHERE list_title = '250 Favourite Films' )
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
Who was the director of the movie "Tokyo Eyes"?
Tokyo Eyes' is movie_title, director refers to director_name;
SELECT director_name FROM movies WHERE movie_title = 'Tokyo Eyes'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
How many films were released in 2007?
film released in 2007 refers to movie_release_year = 2007; film refers to movie
SELECT COUNT(*) FROM movies WHERE movie_release_year = 2007
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, user_...
movie_platform
bird
Simple
9
Which of the films released in 2006 was the most popular among Mubi users?
released in 2006 refers to movie_release_year = 2006; most popular refers to Max(movie_popularity); film refers to movie;
SELECT movie_title FROM movies WHERE movie_release_year = 2006 ORDER BY movie_popularity DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
How many films did Åke Sandgren direct?
Ake Sandgren is the director name;  film refers to movie
SELECT COUNT(movie_title) FROM movies WHERE director_name = 'Åke Sandgren'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
When was the movie Cops released?
Cops' is movie_title; released refers to movie_release_year;
SELECT movie_release_year FROM movies WHERE movie_title = 'Cops'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
Please list the id of the director of the movie "It's Winter".
It's Winter' is movie_title;
SELECT director_id FROM movies WHERE movie_title = 'It''s Winter'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
Please provide the ID of the user with the most followers on the list.
most followers refers to Max(list_followers);
SELECT user_id FROM lists ORDER BY list_followers DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Highly Complex
0
Please provide the title of the list with the most comments on the list.
the most comments refers to Max(list_comments);
SELECT list_title FROM lists GROUP BY list_title ORDER BY COUNT(list_comments) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Moderate
7
What's the cover image of the user who created the movie list 'Georgia related films'?
Play it cool' is list_title; cover image of user refers to user_cover_image_url;
SELECT T1.user_cover_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Georgia related films'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Complex
2
How many followers does the list created by the user whose user_avatar_image_url is https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214 have?
followers refers to list_followers;
SELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_avatar_image_url = 'https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, user_...
movie_platform
bird
Complex
2
What was the title of the first list created by a user 85981819? And please provide the user_avatar_image_url.
user 85981819 refers to user_id = 85981819;  first list created refers to Min (list_creation_date_utc);
SELECT T2.list_title, T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_id = 85981819 ORDER BY T2.list_creation_timestamp_utc LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
Which year had the most released films?
year refers to movie_release_year; most release films refers to MAX(COUNT(movie_id))
SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, user_...
movie_platform
bird
Simple
9
Who is the director that made the most movies? Give the director's id.
director that made the most movies refers to MAX(COUNT(movie_id))
SELECT director_id FROM movies GROUP BY director_id ORDER BY COUNT(movie_id) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Simple
10
How many movies did the director of the highest movie popularity make?
highest movie popularity refers to MAX(movie_popularity)
SELECT COUNT(movie_id) FROM movies WHERE director_id = ( SELECT director_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Complex
2
Who was the earliest user created a list but didn't get any followers? Give the user ID.
earliest user created a list refers to MIN(list_creation_date_utc); didn't get any followers refers to user_subscriber = 0
SELECT user_id FROM lists_users WHERE user_subscriber = 0 ORDER BY list_creation_date_utc LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Moderate
7
Show the portrait picture of the user who created the list "Vladimir Vladimirovich Nabokov".
the list "Vladimir Vladimirovich Nabokov" refers to list_title = 'Vladimir Vladimirovich Nabokov'; portrait picture refers to user_avatar_image_url
SELECT T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Vladimir Vladimirovich Nabokov'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, user_...
movie_platform
bird
Complex
4
For the user who post the list that contained the most number of the movies, is he/she a paying subscriber when creating that list?
the list that contained the most number of the movies refers to MAX(list_movie_number); user_has_payment_method = 1 means the user was a paying subscriber when he created the list ; user_has_payment_method = 0 means the user was not a paying subscriber when he created the list
SELECT T1.user_has_payment_method FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number = ( SELECT MAX(list_movie_number) FROM lists )
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Moderate
6
For the lists that got more than 3000 followers, how many did the users who created those lists are paying subscribers?
got more than 3000 followers refers to list_followers > 3000; paying subscribers refer to user_has_payment_method = 1
SELECT COUNT(T1.user_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers > 3000 AND T1.user_has_payment_method = 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Moderate
5
What is the percentage of list created by user who was a subscriber when he created the list?
was a subscriber refers to user_subscriber = 1; percentage refers to DIVIDE(COUNT(user_subscriber = 1),COUNT(list_id))
SELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(list_id) FROM lists_users
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_id ...
movie_platform
bird
Highly Complex
0
Name all lists created by a user who was a subcriber when created the list.
was a subscriber refers to user_subscriber = 1
SELECT DISTINCT T2.list_id FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_subscriber = 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Moderate
8
Provide list titles created by user who are eligible for trial when he created the list.
eligible for trial refers to user_eligible_for_trial = 1
SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_eligible_for_trial = 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_id ...
movie_platform
bird
Complex
4
Among the lists with at least one follower, how many were created by user who was subscriber when created the list?
lists with at least one follower refers to list_followers > = 1; was a subscriber refers to user_subscriber = 1
SELECT COUNT(T1.list_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers >= 1 AND T1.user_subscriber = 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
10
For all list titles with at least 200 movies in the list, what is their average number of followers?
at least 200 movies in the list refers to list_movie_number > 200; average number of followers refers to avg(list_followers)
SELECT AVG(list_followers) FROM lists WHERE list_movie_number > 200
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Moderate
8
List all the titles created by user who was a subsriber when he created the list and have less than 50 movies in the list.
have less than 50 movies in the list refers to list_movie_number <50; was a subscriber refers to user_subscriber = 1
SELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number < 50 AND T1.user_subscriber = 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_id ...
movie_platform
bird
Simple
10
Which title list has not been updated for the longest period of time? State how long it has not been updated?
not been updated for the longest period of time refers to MIN(list_update_timestamp_utc); how long it has not been updated refers to SUBTRACT(CURRENT_TIMESTAMP, list_update_timestamp_utc)
SELECT list_title , datetime(CURRENT_TIMESTAMP, 'localtime') - datetime(list_update_timestamp_utc) FROM lists ORDER BY list_update_timestamp_utc LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Simple
9
Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list?
list titled 'Sound and Vision' refers to list_title = 'Sound and Vision'; user_subscriber = 1 means the user was a subscriber when he rated the movie; user_subscriber = 0 means the user was not a subscriber when he rated the movie
SELECT T1.user_id, T1.user_subscriber FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Sound and Vision'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists ( user_id integer, list_id integ...
movie_platform
bird
Highly Complex
0
For the list with more than 200 followers, state the title and how long the list has been created?
more than 200 followers refers to list_followers >200; how long the list has been created refers to SUBTRACT(CURRENT_TIMESTAMP,list_creation_timestamp_utc)
SELECT list_title , 365 * (strftime('%Y', 'now') - strftime('%Y', list_creation_timestamp_utc)) + 30 * (strftime('%m', 'now') - strftime('%m', list_creation_timestamp_utc)) + strftime('%d', 'now') - strftime('%d', list_creation_timestamp_utc) FROM lists WHERE list_followers > 200
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE lists_users ( user_id integer, list_id...
movie_platform
bird
Simple
10
Between 1970 to 1980, how many movies with a popularity of more than 11,000 were released?
Between 1970 to 1980 refers to movie_release_year between 1970 and 1980; popularity of more than 11,000 refers movie_popularity >11000
SELECT COUNT(movie_id) FROM movies WHERE movie_release_year BETWEEN '1970' AND '1980' AND movie_popularity > 11000
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE movies ( movie_id integer, movie_title...
movie_platform
bird
Simple
10
How many movies directed by Felipe Cazals was realeased on 1976?
directed by Felipe Cazals refers to director_name = 'Felipe Cazals' ; realeased on 1976 refers to movie_release_year = 1976
SELECT COUNT(movie_id) FROM movies WHERE movie_release_year = 1976 AND director_name LIKE 'Felipe Cazals'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Moderate
5
What is the URL to the movie director page on Mubi of the movie titled "Red Blooded American Girl"
movie titled "Red Blooded American Girl" refers to movie_title = 'Red Blooded American Girl'
SELECT director_url FROM movies WHERE movie_title LIKE 'Red Blooded American Girl'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings_users ( user_id integer, ratin...
movie_platform
bird
Highly Complex
0
What is the name of the list that was updated most recently?
updated most recently refers to MAX(list_update_date_utc)
SELECT list_title FROM lists WHERE list_update_timestamp_utc = ( SELECT list_update_timestamp_utc FROM lists ORDER BY list_update_timestamp_utc DESC LIMIT 1 )
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE ratings ( movie_id integer, rating_id ...
movie_platform
bird
Simple
10
Who created the list that has 142 comments? Indicate the user id of the user, if there are multiple lists with 142 comments, list the user id of the person who created the list
list that has 142 comments refers to list_comments = 142
SELECT user_id FROM lists WHERE list_comments = 142
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Simple
10
Which date has the most ordered quantity? What is the total order quantity on that day?
total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(sum(qty))
SELECT ord_date, SUM(qty) FROM sales GROUP BY ord_date ORDER BY SUM(qty) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE pub_info ( pub_id text, logo blob, ...
book_publishing_company
bird
Simple
9
What is the title with the most ordered quantity in year 1992?
total quantity refers to qty; most ordered quantity refers to order with the highest quantity where MAX(count(qty)); date refers to ord_date; year 1992 refers to YEAR(ord_date) = 1992
SELECT T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y', T1.ord_date) = '1992' ORDER BY T1.qty DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE sales ( stor_id text, ord_num text, ...
book_publishing_company
bird
Moderate
6
List the title, price and publication date for all sales with 'ON invoice' payment terms.
publication date refers to pubdate; payment terms refers to payterms; payterms = 'ON invoice'
SELECT T2.title, T2.price, T2.pubdate FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE T1.payterms = 'ON invoice'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titles ( title_id text, title text, ...
book_publishing_company
bird
Simple
10
What is the title that have at least 10% royalty without minimum range amount.
at least 10% royalty refers to royalty > = 10; minimum range is synonym for low range which refers to lorange; without minimum range amount refers to lorange <> 0
SELECT T1.title FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange = 0 AND T2.royalty >= 10
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Highly Complex
0
State the title and royalty percentage for title ID BU2075 between 10000 to 50000 range.
lorange mean low range; hirange mean high range; range refers to between the low and high range; lorange>10000; hirange<12000
SELECT T1.title, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 10000 AND T2.hirange < 50000 AND T1.title_ID = 'BU2075'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE employee ( emp_id text, fname text, ...
book_publishing_company
bird
Highly Complex
0
Among the titles with royalty percentage, which title has the greatest royalty percentage. State it's minimum range to enjoy this royalty percentage.
minimum range is synonym for low range which refers to lorange
SELECT T1.title, T2.lorange FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id ORDER BY T2.royalty DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE discounts ( discounttype text, stor_id...
book_publishing_company
bird
Moderate
8
Provide a list of titles together with its publisher name for all publishers located in the USA.
publisher name refers to pub_name;
SELECT T1.title, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE jobs ( job_id integer, PRIMARY KEY (jo...
book_publishing_company
bird
Moderate
6
List all titles published in year 1991. Also provide notes details of the title and the publisher's name.
publisher name refers to pub_name; publication date refers to pubdate; published in year 1991 refers to YEAR(pubdate) = 1991
SELECT T1.title, T1.notes, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE pub_info ( pub_id text, logo blob, ...
book_publishing_company
bird
Highly Complex
0
List all titles with sales of quantity more than 20 and store located in the CA state.
qty is abbreviation for quantity; sales of quantity more than 20 refers to qty>20; store refers to stor_name
SELECT T1.title, T2.qty FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T2.stor_id = T3.stor_id WHERE T2.qty > 20 AND T3.state = 'CA'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE authors ( au_id text, au_lname text, ...
book_publishing_company
bird
Highly Complex
0
Name the store with the highest quantity in sales? What is the least quantity title from the store's sale?
qty is abbreviation for quantity; highest quantity refers to MAX(qty); least quantity refers to MIN(qty)
SELECT T3.stor_id, T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T3.stor_id = T1.stor_id WHERE T3.stor_id = ( SELECT stor_id FROM sales GROUP BY stor_id ORDER BY SUM(qty) DESC LIMIT 1 ) GROUP BY T3.stor_id, T2.title ORDER BY SUM(T1.qty) ASC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE sales ( stor_id text, ord_num text, ...
book_publishing_company
bird
Simple
10
Name the title and publisher for title ID BU 2075. Provide all the royalty percentage for all ranges.
name the publisher refers to pub_name
SELECT T1.title, T3.pub_name, T2.lorange, T2.hirange, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id INNER JOIN publishers AS T3 ON T1.pub_id = T3.pub_id WHERE T1.title_id = 'BU2075'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE sales ( stor_id text, ord_num text, ...
book_publishing_company
bird
Complex
3
Name the store with ID 7066 and calculate the percentage of the the quantity ordered that were on 'Net 30' payment terms.
store with ID 7066 refers to stor_ID = '7066'; 'Net 60' payment terms refers to payterm = 'Net 60'; qty is abbreviation for quantity; percentage = DIVIDE(payterms = 'Net 60', sum(qty))*100
SELECT T2.stor_name , CAST(SUM(CASE WHEN payterms = 'Net 30' THEN qty ELSE 0 END) AS REAL) * 100 / SUM(qty) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE T1.stor_id = '7066' GROUP BY T2.stor_name
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE employee ( emp_id text, lname text, ...
book_publishing_company
bird
Simple
9
State the publisher name for publisher ID 877? Calculate its average year to date sales.
publisher id refers to pub_id; publisher name refers to pub_name; average year to date sales = AVG(ytd_sales)
SELECT T2.pub_name, AVG(T1.ytd_sales) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.pub_id = '0877' GROUP BY T2.pub_name
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE jobs ( job_id integer, PRIMARY KEY (jo...
book_publishing_company
bird
Moderate
6
Name all employees who were hired before year 1990.
hired before year 1990 refers to YEAR(hire_date)<1990
SELECT fname, lname FROM employee WHERE STRFTIME('%Y', hire_date) < '1990'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE stores ( stor_id text, stor_name text,...
book_publishing_company
bird
Simple
10
Which employee has the lowest job level. State the first name, last name and when he /she was hired.
lowest job level refers to MIN(job_lvl)
SELECT fname, lname, hire_date FROM employee ORDER BY job_lvl LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE discounts ( stor_id text, discount rea...
book_publishing_company
bird
Complex
4
In which year has the most hired employees?
most hired employees refers to MAX(count(emp_id))
SELECT STRFTIME('%Y', hire_date) FROM employee GROUP BY STRFTIME('%Y', hire_date) ORDER BY COUNT(emp_id) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Highly Complex
0
List all employees who are at the maximum level in their job designation.
maximum level in their job designation refers to job_lvl = MAX(max_lvl)
SELECT T1.fname, T1.lname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl = T2.max_lvl
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE stores ( stor_id text, stor_name text,...
book_publishing_company
bird
Simple
9
Who are the employees working for publisher not located in USA? State the employee's name and publisher name.
not located at USA refers to country! = 'USA'
SELECT T1.fname, T1.lname, T2.pub_name FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country != 'USA'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE roysched ( title_id text, CONSTRAINT f...
book_publishing_company
bird
Moderate
5
List all employees working for publisher 'GGG&G'. State their name and job description.
name = fname, lname; job description refers to job_desc; publisher refers pub_name
SELECT T1.fname, T1.lname, T3.job_desc FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id INNER JOIN jobs AS T3 ON T1.job_id = T3.job_id WHERE T2.pub_name = 'GGG&G'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Moderate
8
For each publisher, state the type of titles they published order by the publisher name.
publisher name refers to pub_name
SELECT DISTINCT T2.pub_name, T1.type FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id ORDER BY T2.pub_name
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Moderate
6
Name the publisher which has the most titles published in 1991.
most title published refers to MAX(count(title_id); published in 1991 refers to YEAR(pubdate) = 1991
SELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991' GROUP BY T1.pub_id, T2.pub_name ORDER BY COUNT(T1.title_id) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE sales ( stor_id text, ord_num text, ...
book_publishing_company
bird
Simple
10
Name the title with the highest price published by 'Binnet & Hardley'.
published by refers to pub_name
SELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'Binnet & Hardley' ORDER BY T1.price DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE publishers ( pub_id text, city text, ...
book_publishing_company
bird
Simple
9
Among all employees, who have job level greater than 200. State the employee name and job description.
job level greater than 200 refers to job_lvl>200; job description refers to job_desc
SELECT T1.fname, T1.lname, T2.job_desc FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl > 200
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE roysched ( title_id text, CONSTRAINT f...
book_publishing_company
bird
Simple
9
Name all the authors for all business titles.
business title refers to title under business where type = 'business'
SELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.type = 'business'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE stores ( stor_id text, PRIMARY KEY (st...
book_publishing_company
bird
Highly Complex
0
List all the titles and year to date sales by author who are not on contract.
year to date sales refers to ytd_sales; not on contract refers to contract = 0
SELECT T1.title_id, T1.ytd_sales FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Simple
9
For all authors from CA who are not on contract, which title of his/hers has the most year to date sales.
year to date sales refers to ytd_sales; on contract refers to contract = 1
SELECT T1.title FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0 AND T3.state = 'CA' ORDER BY T1.ytd_sales DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE authors ( au_id text, au_lname text, ...
book_publishing_company
bird
Simple
9
Name all the authors for 'Sushi, Anyone?'.
most year to date sales refers to MAX(ytd_sales); on contract refers to contract = 1; name of author = au_fname, au_lname
SELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.title = 'Sushi, Anyone?'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE employee ( emp_id text, fname text, ...
book_publishing_company
bird
Simple
10
How many publishers are in the USA?
SELECT COUNT(pub_id) FROM publishers WHERE country = 'USA'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE titleauthor ( au_id text, title_id tex...
book_publishing_company
bird
Simple
10
What is the publisher's information of New Moon Books?
publisher name refers to pub_name; New Moon Books is a publisher name
SELECT T1.pr_info FROM pub_info AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'New Moon Books'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE discounts ( stor_id text, CONSTRAINT f...
book_publishing_company
bird
Moderate
8
Please list the first names of the employees who work as Managing Editor.
Managing Editor is a job description which refers to job_desc
SELECT T1.fname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Managing Editor'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE jobs ( job_id integer, PRIMARY KEY (jo...
book_publishing_company
bird
Simple
10
In which city is the store with the highest total sales quantity located?
qty is abbreviation for quantity; highest sales quantity refers to MAX(qty)
SELECT T2.city FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id GROUP BY T2.city ORDER BY SUM(T1.qty) DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE employee ( emp_id text, job_id integer...
book_publishing_company
bird
Simple
10
What is the price of the book that sells the best?
qty is abbreviation for quantity; sells the best mean with the most sales quantity; MAX(qty)
SELECT T2.price FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id ORDER BY T1.qty DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE sales ( stor_id text, ord_num text, ...
book_publishing_company
bird
Moderate
8
Please list the stores that ordered the book "Life Without Fear".
store name refers to stor_name
SELECT T2.stor_name FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T3.title = 'Life Without Fear'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE stores ( stor_id text, stor_name text,...
book_publishing_company
bird
Moderate
7
In which country is the publisher of the book "Life Without Fear" located?
Life Without Fear is book title
SELECT T2.country FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.title = 'Life Without Fear'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE discounts ( stor_id text, discount rea...
book_publishing_company
bird
Simple
10
What is the publisher that has published the most expensive book?
most expensive book refers to MAX(price)
SELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id ORDER BY T1.price DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE authors ( au_id text, au_fname text, ...
book_publishing_company
bird
Simple
10
Among the publishers in the USA, how many of them have published books that are over $15?
are over $15 refers to price>15
SELECT COUNT(DISTINCT T1.pub_id) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA' AND T1.price > 15
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE employee ( emp_id text, fname text, ...
book_publishing_company
bird
Simple
10
How many books on business have the bookstores in Massachusetts ordered?
Massachusetts is a state; business books refers to type = 'business'
SELECT SUM(T1.qty) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T2.state = 'Massachusetts' AND T3.type = 'business'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE discounts ( stor_id text, CONSTRAINT f...
book_publishing_company
bird
Simple
10
What is the average quantity of each order for the book "Life Without Fear"?
qty is abbreviation for quantity; average quantity order = AVG(qty)
SELECT CAST(SUM(T2.qty) AS REAL) / COUNT(T1.title_id) FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE T1.title = 'Life Without Fear'
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE stores ( stor_id text, stor_address te...
book_publishing_company
bird
Simple
9
What is the average level employees working as Managing Editor are at? How many levels are there between the average level and the highest level?
Managing Editor is a job description which refers to job_desc; job level refers to job_lvl; highest level job refers to max_lvl; levels between the average level and the highest level = SUBTRACT(max_lvl; AVG(job_lvl))
SELECT AVG(T2.job_lvl), T1.max_lvl - AVG(T2.job_lvl) FROM jobs AS T1 INNER JOIN employee AS T2 ON T1.job_id = T2.job_id WHERE T1.job_desc = 'Managing Editor' GROUP BY T2.job_id, T1.max_lvl
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE publishers ( pub_id text, pub_name tex...
book_publishing_company
bird
Moderate
6
Which one is the cheapest business book?
business books refers to type = 'business'; cheapest book refers to MIN(price)
SELECT title FROM titles WHERE type = 'business' ORDER BY price LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE pub_info ( pub_id text, logo blob, ...
book_publishing_company
bird
Simple
10
Which type of book had the most pre-paid amount?
most pre-paid amount refers to MAX(advance)
SELECT type FROM titles ORDER BY advance DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE publishers ( pub_id text, pub_name tex...
book_publishing_company
bird
Highly Complex
0
What's the royalty for the bestseller book?
qty is abbreviation for quantity; bestseller means with the most sales quantity; MAX(qty)
SELECT royalty FROM titles ORDER BY ytd_sales DESC LIMIT 1
Task Overview: You are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question. Database Engine: SQLite Database Schema: CREATE TABLE jobs ( job_id integer, job_desc text, ...
book_publishing_company
bird
Simple
10
Which job level is O'Rourke at?
job level refers to job_lvl
SELECT job_lvl FROM employee WHERE lname = 'O''Rourke'