db_id stringclasses 69
values | schema stringclasses 69
values | m_schema stringclasses 69
values | question stringlengths 24 325 | sql stringlengths 23 804 | evidence stringlengths 0 673 |
|---|---|---|---|---|---|
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Which genre contains the greatest number of non-English films? | SELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.isEnglish = 'F' GROUP BY T2.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1 | isEnglish = 'F' means non-English |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | List the cast and the director of the movie with the id 1949144. | SELECT T1.actorid, T2.directorid FROM movies2actors AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.movieid = 1949144 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Among the actors who acted in UK movies, what percentage of actors received a rating of at least 3? | SELECT CAST(SUM(IIF(T3.a_quality >= 3, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T1.country = 'UK' | UK is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What is the proportion of action movies directors who are called 'box office success paradox'? | SELECT CAST(SUM(IIF(T2.avg_revenue > T2.d_quality, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN directors AS T2 ON T1.directorid = T2.directorid WHERE T1.genre = 'Action' | 'box office success paradox' means average revenue exceeds their quality; The proportion can be computed by [(avg_revenue > d_quality) / ()] * 100% |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Please list the actor IDs whose movies have the newest published date. | SELECT T1.actorid FROM movies2actors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.year = 4 | Year contains relative value, higher year value refers to newer date; Year = 4 refers to newest date |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Who are cast members in an English movie which has a running time equal to 2? Please list their IDs. | SELECT T2.actorid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime = 2 AND T1.isEnglish = 'T' | isEnglish = 'T' means English movie |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Which actor has acted in at least 2 French films? Please list their IDs. | SELECT T2.actorid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'France' GROUP BY T2.actorid HAVING COUNT(T1.movieid) > 2 | France is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many American movies have cast number more than 1? | SELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T2.cast_num > 1 | USA is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Please list movie IDs which has the oldest publication date and the cast numbers are zero. | SELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 1 AND T2.cast_num = 0 | Year contains relative value, higher year value refers to newer date; Year = 1 refer to oldest date |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many actors have acted in both US or UK films? | SELECT COUNT(T1.actorid) FROM movies2actors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' OR T2.country = 'UK' | US and UK are 2 countries |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many directors with average revenue of 4 have made either action or adventure films? | SELECT COUNT(T1.directorid) FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.avg_revenue = 4 AND (T2.genre = 'Adventure' OR T2.genre = 'Action') | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Please list director IDs who have the quality of at least 3 and have made at least 2 different genres of movies. | SELECT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality >= 3 GROUP BY T1.directorid HAVING COUNT(T2.movieid) >= 2 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many American comedies are there? | SELECT COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T2.genre = 'comedy' | USA is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many latest released dramas and action movies? | SELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.year = 4 AND T1.genre IN ('Action', 'drama') | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What horror movies have a running time of at least 2? Please list movie IDs. | SELECT T1.movieid FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.runningtime >= 2 AND T1.genre = 'Horror' | Higher value of running time means running time is longer |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Please calculate negative critical reception of American movies | SELECT CAST(SUM(IIF(T1.rating = 1, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' | 'negative critical reception' refers to percentage of movies with a rating of 1, which = [count(rating = 1) / count(all movies)] * 100% |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What is the disparate number of the comedy films that got the 1 rating? | SELECT COUNT(DISTINCT T1.movieid) FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T2.rating = 1 AND T1.genre = 'comedy' | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What's different average revenue status for director who directed the movie that got the most 1 ratings? | SELECT DISTINCT T1.avg_revenue FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many French movies got the highest ranking? | SELECT COUNT(movieid) FROM movies WHERE country = 'France' AND movieid IN ( SELECT movieid FROM u2base WHERE rating = ( SELECT MAX(rating) FROM u2base ) ) | France is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | List the movie that has been rated most by 25 years old users. | SELECT T2.movieid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T1.age = 25 GROUP BY T2.movieid ORDER BY COUNT(T1.userid) DESC LIMIT 1 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many separate 35 year-old uesers have rated the movie from UK? | SELECT COUNT(DISTINCT T2.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T1.country = 'UK' AND T3.age = 35 | UK is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | List the user ids and ages who gave the rate 2 to the movie No. 2409051. | SELECT T1.userid, T1.age FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.movieid = '2409051' AND T2.rating = 2 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Please give the ids of the oldest films that got the most ratings. | SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5 AND T2.year = 1 | Films and movies share the same meaning; oldest film refers to the movie with year = 1 |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Which different movies from France got the least ratings? | SELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.rating = 1 | France is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many female actors have been played a role in any of French or USA movies? | SELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country IN ('France', 'USA') | French and USA are two countries; Female actors mean that a_gender = 'F' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many different actors have played a role in the highest rating movie? | SELECT COUNT(DISTINCT T2.actorid) FROM u2base AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5 | highest rating of a movie is 5 |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Which Crime film got the lowest average rating? | SELECT T2.movieid FROM u2base AS T2 INNER JOIN movies2directors AS T3 ON T2.movieid = T3.movieid WHERE T3.genre = 'Crime' GROUP BY T2.movieid ORDER BY AVG(T2.rating) LIMIT 1 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What's the ratio of gender in actors to actress in all the UK movies? | SELECT CAST(SUM(IIF(T3.a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(T3.a_gender = 'F', 1, 0)) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T1.country = 'UK' | UK is a country; Male actors mean that a_gender = 'M'; Female actors mean that a_gender = 'F'; ratio; ratio of gender in actors = count(a_gender = 'M') / a_gender = 'F' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many 35-year-old female users gave the movie 1711133 a rating of 3? | SELECT COUNT(T1.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.rating = 3 AND T2.movieid = '1711133' AND T1.age = 35 AND T1.u_gender = 'F' | Female users mean that u_gender = 'F' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many users have rated 1 each for the UK's second newest movies with a running time of 2? | SELECT COUNT(T2.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'UK' AND T1.runningtime = 2 AND T2.rating = 1 AND T1.year = 2 | second newest movies refers to year = 2 since year in this database is a relative value, less is the newer |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many unique directors with an average earnings of 2 and a quality of 3 have not made comedy films? List them. | SELECT DISTINCT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 3 AND T1.avg_revenue = 2 AND T2.genre != 'Comedy' | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Calculate the percentage of female actors and quality 2 who have appeared twice at the casting of the film 1672580. | SELECT CAST(SUM(IIF(T2.cast_num = 2 AND T1.a_quality = 2, 1, 0)) AS REAL) * 100 / COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1672580 AND T1.a_gender = 'F' | Female actors mean that a_gender = 'F'; percentage can be computed by [cast_num = 2 AND a_quality = 2 in female) / (all female actors)] * 100% |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many of the worst actors are men and how many of the worst actors are women? Indicate your answer in ratio form. | SELECT CAST(SUM(IIF(a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(a_gender = 'F', 1, 0)) FROM actors WHERE a_quality = 0 | The worst actors means a_quality = 0; Men and male share the same meaning; men actors refers to a_gender = 'M' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Which actor has appeared in the most films? | SELECT actorid FROM movies2actors GROUP BY actorid ORDER BY COUNT(movieid) DESC LIMIT 1 | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What is the most popular genre of film directed by directors? | SELECT genre FROM movies2directors GROUP BY genre ORDER BY COUNT(movieid) DESC LIMIT 1 | Most popular genre indicates that the genre has the most number of movies |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What are the most common film genres made by the worst directors? | SELECT T2.genre FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 0 GROUP BY T2.genre ORDER BY COUNT(T2.movieid) DESC LIMIT 1 | d_quality = 5 refers to the best directors, d_quality = 0 refers to the worst directors |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What non-English American film/s has received the lowest user ratings? Mention the movie's I.D. | SELECT T2.movieid FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.isEnglish = 'F' AND T1.country = 'USA' ORDER BY T2.rating LIMIT 1 | USA is a country; non-English means isEnglish = 'F' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What is the total average movie directed by the directors who's quality and revenue is 4? | SELECT CAST(SUM(CASE WHEN T1.d_quality = 4 AND T1.avg_revenue = 4 THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.movieid) FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid | |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Which movies have received the greatest ratings from female users whose occupations fall within the category of 3? | SELECT T2.movieid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T1.u_gender = 'F' AND T1.occupation = 3 AND T2.rating = 5 | Female users mean that u_gender = 'F' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many female actresses appeared in the movie 2312852, what country was it in, and what was it's running time? | SELECT SUM(IIF(T1.a_gender = 'F', 1, 0)) , T3.country, T3.runningtime FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T2.movieid = 2312852 GROUP BY T3.country, T3.runningtime | female actresses mean that a_gender = 'F' |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | How many horror movies were made by the worst directors? | SELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid INNER JOIN directors AS T3 ON T1.directorid = T3.directorid WHERE T1.genre = 'horror' AND T3.d_quality = 0 | d_quality = 5 refers to direct the best, d_quality = 0 refers to direct the worst |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What are the genres of all the English-language foreign films having a runtime of two hours or less? List each one. | SELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime <= 2 AND T1.isEnglish = 'T' AND T1.country = 'other' | isEnglish = 'T' means films in English; Film and movie share the same meaning |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | Among the English comedy movies produced in the UK, how many movies with a running time of 3 was rated the highest by users between the age 45-50? Indicate the movie names. | SELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN u2base AS T3 ON T1.movieid = T3.movieid INNER JOIN users AS T4 ON T3.userid = T4.userid WHERE T1.country = 'UK' AND T2.genre = 'Comedy' AND T1.runningtime = 3 AND T3.rating = 5 AND T4.age BETWEEN 45 AND ... | UK is a country |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What is the percentage difference of English and non-English-language crime movies in other countries in year 3? | SELECT CAST(SUM(IIF(T1.isEnglish = 'T', 1, 0)) - SUM(IIF(T1.isEnglish = 'F', 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'other' AND T1.year = 3 | non-English-language refers to isEnglish = 'F'; The percentage difference can be computed by [count(isEnglish = 'T' in movies) - count(isEnglish = 'F' in movies) / (all movies)] * 100% |
movielens | CREATE TABLE users
(
userid INTEGER default 0 not null
primary key,
age TEXT not null,
u_gender TEXT not null,
occupation TEXT not null
);
CREATE TABLE "directors"
(
directorid INTEGER not null
primary key,
d_quality INTEGER not null,
avg_revenue INTE... | 【DB_ID】 movielens
【Schema】
# Table: main.actors
[
(actorid:INTEGER, Primary Key, Examples: [4, 16, 28]),
(a_gender:TEXT, Examples: [M, F]),
(a_quality:INTEGER, Examples: [4, 0, 3])
]
# Table: main.directors
[
(directorid:INTEGER, Primary Key, Examples: [7387, 12945, 15725]),
(d_quality:INTEGER, Examples: [0, 1, 2]),
(a... | What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre. | SELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid =... | Female actors mean that a_gender = 'F'; Male actors mean that a_gender = 'M'; a_quality = 5 refers to act the best, a_quality = 0 refers to act the worst |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Please list the names of all the products ordered in order CA-2011-112326 in superstores in the center. | SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-112326' | names of all the products refers to "Product Name"; order CA-2011-112326 refers to "Order ID" = 'CA-2011-112326'; in the center refers to Region = 'Central'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Among all the orders made by Aimee Bixby, what was the longest shipment time? | SELECT MAX(strftime('%J', `Ship Date`) - strftime('%J', `Order Date`)) AS longestTimeDays FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; longest shipment time refers to MAX(SUM(SUTRACT(julianday("Ship Date"), julianday("Order Date")), 1)) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Among all the orders made by Aimee Bixby, how many of them chose the slowest delivery speed? | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T2.`Ship Mode` = 'Standard Class' | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; the slowest delivery speed refers to "Ship Mode" = 'Standard Class'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | How many orders has Aimee Bixby made? | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' | Aimee Bixby made refers to "Customer Name" = 'Aimee Bixby'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Please list the IDs of the orders made by Aimee Bixby with more than 3 kinds of products ordered. | SELECT DISTINCT T2.`Order ID` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' GROUP BY T2.`Product ID` HAVING COUNT(T2.`Product ID`) > 3 | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; with more than 3 kinds of products ordered refers to count("Product ID") > 3; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Among the orders made by Aimee Bixby, how many of them included at least one kind of product under the category "Furniture"? | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.Category = 'Furniture' AND T1.`Customer Name` = 'Aimee Bixby' | made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Please list the names of all the products ordered by Aimee Bixby in 2016. | SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND STRFTIME('%Y', T2.`Ship Date`) = '2016' | ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; ordered n 2016 refers to strftime('%Y', "Order Date") = '2016'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What is the total quantity of "Telescoping Adjustable Floor Lamp" ordered from central superstores? | SELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Telescoping Adjustable Floor Lamp' | "Telescoping Adjustable Floor Lamp" is a "Product Name"; from central superstores refers to Region = 'Central'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Please list the names of all the customers who had ordered the product "Telescoping Adjustable Floor Lamp". | SELECT DISTINCT T1.`Customer Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.`Product Name` = 'Telescoping Adjustable Floor Lamp' | "Telescoping Adjustable Floor Lamp" is a product name; names of all the customers refers to "Customer Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Among the customers who have ordered the product "Telescoping Adjustable Floor Lamp", how many of them are consumers? | SELECT COUNT(DISTINCT T1.`Customer Name`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.`Product Name` = 'Telescoping Adjustable Floor Lamp' AND T1.Segment = 'Consumer' | "Telescoping Adjustable Floor Lamp" is a "Product Name"; consumers refers to Segment = 'Consumer'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What was the quantity of Xerox 1952 ordered by Aimee Bixby on 2014/9/10? | SELECT SUM(T2.Quantity) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10' | Xerox 1952 is a "Product Name"; ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; on 2014/9/10 refers to "Order Date" = date('2014-09-10'); |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | For how many times has Aimee Bixby ordered the product Xerox 1952? | SELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' | Xerox 1952 is a "Product Name"; Aimee Bixby ordered refers to "Customer Name" = 'Aimee Bixby'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What was the original price of Xerox 1952 ordered by Aimee Bixby on 2014/9/10? | SELECT DISTINCT T2.Sales / (1 - T2.Discount) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10' | Xerox 1952 is a "Product Name"; ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; on 2014/9/10 refers to "Order Date" = date('2014-09-10'); original price refers to DIVIDE(Sales, SUTRACT(1, discount)) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What was the total cost of Xerox 1952 ordered by Aimee Bixby on 2014/9/10? | SELECT DISTINCT (T2.Sales / (1 - T2.discount)) * T2.Quantity - Profit FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Dat... | Xerox 1952 is a "Product Name"; ordered by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; on 2014/9/10 refers to "Order Date" = date('2014-09-10'); total cost refers to SUTRACT(MULTIPLY(DIVIDE(Sales, SUTRACT(1, discount)), Quantity), Profit) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | How many art products were ordered in 2013 in the east superstore? | SELECT COUNT(DISTINCT T1.`Product ID`) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' AND T1.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2013' | ordered in 2013 refers to strftime('%Y', "Order Date") = '2013'; art products refers to "Sub-Category" = 'Art' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Who is the customer who purchased the largest total cost of products in a single order? | SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` GROUP BY T1.`Order ID`, T2.`Customer Name` ORDER BY SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) DESC LIMIT 1 | largest total cost refers to MAX(SUTRACT(MULTIPLY(DIVIDE(Sales, SUTRACT(1, discount)), Quantity), Profit)) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What is the name of the product that has the highest original price? | SELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1 | has the highest original price refers to MAX(DIVIDE(Sales, SUTRACT(1, discount))); name of the product refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What is the name of the product that was ordered recently by Darren Powers? | SELECT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Darren Powers' ORDER BY T2.`Order Date` DESC LIMIT 1 | Darren Powers is the "Customer Name"; name of the product refers to "Product Name"; recently refers to MAX("Order Date") |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | How many quantities of Advantus plastic paper clips were ordered overall? | SELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Advantus Plastic Paper Clips' | Advantus plastic paper clips is the "Product Name"; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Which order of Logitech G600 MMO Gaming Mouse has the highest total cost? | SELECT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Logitech G600 MMO Gaming Mouse' GROUP BY T1.`Order ID` ORDER BY SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) DESC LIMIT 1 | Logitech G600 MMO Gaming Mouse refers to "Product Name"; highest total cost refers to MAX(SUTRACT(MULTIPLY(DIVIDE(Sales, SUTRACT(1, discount)), Quantity), Profit)) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What are the names of the products that were ordered by Alejandro Grove? | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Alejandro Grove' | ordered by Alejandro Grove refers to "Customer Name" = 'Alejandro Grove'; names of the products refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | How many customers in Chicago ordered at least 10 Cardinal EasyOpen D-Ring Binders in a single order? | SELECT COUNT(DISTINCT T1.`Customer ID`) FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Cardinal EasyOpen D-Ring Binders' AND T2.City = 'Chicago' AND T1.Quantity > 10 | at least 10 goods refers to Quantity > = 14; Cardinal EasyOpen D-Ring Binders refers to "Product Name"; customers in Chicago refers to City = 'Chicago' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What are the names of the products with a profit of no less than 1,000 in one single order? | SELECT DISTINCT T2.`Product Name` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.Profit > 1000 | profit of no less than 1,000 refers to Profit > = 1000; names of the products refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Name 10 products that were shipped first class from the East region. | SELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'First Class' AND T2.Region = 'East' LIMIT 10 | shipped first class refers to "Ship Mode" = 'First Class'; Region = 'East' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | List the products ordered by Becky Martin around the Central region. | SELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Becky Martin' AND T3.Region = 'Central' | ordered by Becky Martin refers to "Customer Name" = 'Becky Martin'; Region = 'Central'; products refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | List 5 customers in the West region who had their item shipped 'Second Class.' | SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' AND T1.`Ship Mode` = 'Second Class' LIMIT 5 | shipped 'Second Class.' refers to "Ship Mode" = 'Second Class'; customers refers to "Customer Name"; Region = 'West' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Add the total profit of Patrick Gardner in the Central region. | SELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Patrick Gardner' AND T1.Region = 'Central' | Patrick Gardner is the "Customer Name"; Region = 'Central' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Which item was shipped on 3/4/2013 and scheduled for same day delivery in the South region? | SELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2013-03-04' AND T2.Region = 'South' AND T1.`Order Date` = '2013-03-04' | shipped on 3/4/2013 refers to "Order Date" = date('2013-03-04'); same day delivery refers to "Ship Mode" = 'Same Day'; item refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What is the total sales of 'Avery Hi-Liter EverBold Pen Style Fluorescent Highlighters, 4/Pack' in the Central region? | SELECT SUM(T1.Sales) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Avery Hi-Liter EverBold Pen Style Fluorescent Highlighters, 4/Pack' AND T2.Region = 'Central' | 'Avery Hi-Liter EverBold Pen Style Fluorescent Highlighters, 4/Pack' is the "Product Name"; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Name the item ordered by Jonathan Doherty with the highest quantity in the East region. | SELECT T3.`Product Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Jonathan Doherty' AND T2.Region = 'East' ORDER BY T1.Quantity DESC LIMIT 1 | Jonathan Doherty is the "Customer Name"; highest quantity refers to MAX(Quantity); Region = 'East' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | How much is the total quantity of items from the East region shipped on 3/25/2015? Name the products. | SELECT SUM(T1.Quantity), T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2015-03-25' AND T2.Region = 'East' | shipped on 3/25/2015 refers to "Ship Date" = Date('2015-03-25'); |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Which customer ordered 'Global High-Back Leather Tilter, Burgundy' on 10/13/2013 in the East region? | SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Global High-Back Leather Tilter, Burgundy' AND T1.`Order Date` = '2013-10-13' AND T1.Region = 'East' | 'Global High-Back Leather Tilter, Burgundy' is the "Product Name"; on 10/13/2013 refers to "Order Date" = Date('2013-10-13'); Region = 'East' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What category does the item ordered by Katherine Murray on 11/4/2018 in the South region belong to? | SELECT DISTINCT T3.Category FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Katherine Murray' AND T1.`Order Date` = '2018-11-04' AND T2.Region = 'South' | ordered by Katherine Murray refers to "Customer Name" = 'Katherine Murray'; on 11/4/2018 refers to "Order Date" = Date('2018-11-04'); |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What percentage do items under the category of 'Furniture' make up the total number of items ordered that are shipped as standard in the West region? | SELECT CAST(SUM(CASE WHEN T2.Category = 'Furniture' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(T1.Quantity) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'West' AND T1.`Ship Mode` = 'Standard Class' | shipped as standard refers to "Ship Mode" = 'Standard Class'; Region = 'West'; percentage refers to DIVIDE(SUM(Quantity where Category = 'Furniture'), SUM(Quantity)) * 1.0 |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What is the ship date of the order by the customer named Ann Chong in the central region? | SELECT T2.`Ship Date` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Ann Chong' AND T1.Region = 'Central' | Ann Chong' is the "Customer Name"; Region = 'Central' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Give the customer segment from the West region that orders the order ID CA-2011-108189. | SELECT DISTINCT T2.Segment FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' AND T1.`Order ID` = 'CA-2011-108189' | Region = 'West' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What are the total sales of the accumulated orders of Hon Valutask Swivel Chairs in the West region? | SELECT SUM(T1.Sales) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Hon Valutask Swivel Chairs' AND T1.Region = 'West' | 'Hon Valutask Swivel Chairs' is the "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Provide the order ID of Frank Olsen of the South region. | SELECT T1.`Order ID` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T2.`Customer Name` = 'Frank Olsen' | Frank Olsen' is the "Customer Name"; Region = 'South' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What product was ordered in the Central region on April 26, 2018, and shipped by April 27, 2018? | SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order Date` = '2018-04-26' AND T1.`Ship Date` = '2018-04-27' AND T2.Region = 'Central' | on April 26, 2018 refers to "Order Date" = date('2018-04-26'); shipped by April 27, 2018 refers to "Ship Date" = date('2018-04-27'); |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | From which city and state does the customer that bought the product with the highest sales? | SELECT T5.City, T5.State FROM west_superstore AS T1 INNER JOIN east_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN central_superstore AS T3 ON T3.`Customer ID` = T2.`Customer ID` INNER JOIN south_superstore AS T4 ON T4.`Customer ID` = T3.`Customer ID` INNER JOIN people AS T5 ON T5.`Customer ID` = T4... | highest sales refers to max(Sales) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Who is the customer from the East region that purchased the order with the highest profit? | SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'East' ORDER BY T1.Profit DESC LIMIT 1 | highest profit refers to MAX(profit); Region = 'East' |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Among the customers from Chicago, Illinois, what is the highest quantity of products bought in a single order? | SELECT T1.Quantity FROM west_superstore AS T1 INNER JOIN east_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN central_superstore AS T3 ON T3.`Customer ID` = T2.`Customer ID` INNER JOIN south_superstore AS T4 ON T4.`Customer ID` = T3.`Customer ID` INNER JOIN people AS T5 ON T5.`Customer ID` = T4.`Cust... | from Chicago refers to City = 'Chicago'; Illinois refers to State = 'Illinois'; highest quantity refers to max(Quantity) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | What are the order date and product name of the order ID CA-2011-137274 from the Central region? | SELECT T1.`Order Date`, T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-137274' AND T2.Region = 'Central' | |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | List down the customers that purchased the product named Xerox 23 in the South region. | SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'South' AND T3.`Product Name` = 'Xerox 23' | product named Xerox 23 refers to "Product Name" = 'Xerox 23'; customers refers to "Customer Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Among the products under the office supplies category, what is the product that made the highest sales in the Central region? | SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Office Supplies' AND T2.Region = 'Central' ORDER BY T1.Sales DESC LIMIT 1 | made the highest sales refers to MAX(Sales) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Who is the customer from the West region that received the highest discount? | SELECT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' ORDER BY T1.Discount DESC LIMIT 1 | received the highest discount refers to MAX(discount); customer refers to "Customer Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Provide the names of the products with a profit greater than 98% of the average profit of all products in the East region. | SELECT DISTINCT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'East' AND T1.Profit > ( SELECT AVG(Profit) * 0.98 FROM east_superstore ) | names of the products refers to "Product Name"; profit greater than 98% of the average profit refers to Profit > MULTIPLY(AVG(Profit), 0.98) |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Name the customers from the Eastern region whose orders cost above 80000. | SELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'East' AND T1.Sales / (1 - T1.Discount) * T1.Quantity - T1.Profit > 80000 | cost above 80000 refers to SUTRACT(MULTIPLY(DIVIDE(Sales, SUTRACT(1, discount)), Quantity), Profit) > 80000 |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | How many orders were made by Maxwell Schwartz in 2015? | SELECT COUNT(DISTINCT T1.`Order ID`) FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.`Customer Name` = 'Maxwell Schwartz' AND STRFTIME('%Y', T1.`Order Date`) = '2015' | Maxwell Schwartz' is the "Customer Name"; in 2015 refers to strftime('%Y', "Order Date") = '2015'; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Who ordered the Bush Mission Pointe Library in the Central Region? | SELECT DISTINCT T2.`Customer Name` FROM central_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Bush Mission Pointe Library' AND T3.Region = 'Central' | Bush Mission Pointe Library' is the "Product Name"; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Calculate the total profit by Cisco SPA301 for all regions. | SELECT SUM(T1.Profit) + SUM(T2.Profit) + SUM(T3.Profit) + SUM(T4.Profit) AS totalProfit FROM west_superstore AS T1 INNER JOIN east_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN central_superstore AS T3 ON T3.`Customer ID` = T2.`Customer ID` INNER JOIN south_superstore AS T4 ON T4.`Customer ID` = T3... | Cisco SPA301' is the "Product Name"; all regions refers to central_superstore, south_superstore, west_superstore, east_superstore |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | List the products that were ordered by Anne McFarland from the Western store. | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Anne McFarland' | Anne McFarland' is the "Customer Name"; Western store refers to west_superstore; products refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | List the products ordered by customers in Coachella. | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.City = 'Coachella' | in Coachella refers to City = 'Coachella'; products refers to "Product Name" |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | Compare the numbers of orders between the Eastern and Western stores in 2015. | SELECT east, west FROM ( SELECT COUNT(`Order ID`) AS east , ( SELECT COUNT(`Order ID`) FROM west_superstore WHERE `Order Date` LIKE '2015%' ) AS west FROM east_superstore WHERE `Order Date` LIKE '2015%' ) | in 2015 refers to strftime('%Y', "Order Date") = '2015'; Eastern store refers to east_superstore; Western store refers west_superstore; |
superstore | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" T... | 【DB_ID】 superstore
【Schema】
# Table: main.central_superstore
[
(Row ID:INTEGER, Primary Key, Examples: [1, 2, 3]),
(Order ID:TEXT, Examples: [CA-2011-103800, CA-2011-112326, CA-2011-105417]),
(Order Date:DATE, Examples: [2013-01-03]),
(Ship Date:DATE, Examples: [2013-01-07]),
(Ship Mode:TEXT, Examples: [Standard Class,... | List the products ordered by Matt Abelman from the Western store in 2013. | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Matt Abelman' AND STRFTIME('%Y', T1.`Order Date`) = '2013' | ordered by Matt Abelman refers to "Customer Name" = 'Matt Abelman'; in 2013 refers to "Order Date" like '2013%' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.