db_id stringclasses 66 values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66 values |
|---|---|---|---|---|
movie_platform | How many films were released in 2007? | film released in 2007 refers to movie_release_year = 2007; film refers to movie | SELECT COUNT(*) FROM movies WHERE movie_release_year = 2007 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many ratings on the movie "A Way of Life" are made after the year 2011? | A Way of Life' is movie_title; rating after the year 2011 refers to rating_timestamp_utc > '2011'; | SELECT COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_timestamp_utc >= '2012-01-01' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many films did Åke Sandgren direct? | Ake Sandgren is the director name; film refers to movie | SELECT COUNT(movie_title) FROM movies WHERE director_name = 'Åke Sandgren' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Who was the director of the movie "Tokyo Eyes"? | Tokyo Eyes' is movie_title, director refers to director_name; | SELECT director_name FROM movies WHERE movie_title = 'Tokyo Eyes' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which of the films released in 2006 was the most popular among Mubi users? | released in 2006 refers to movie_release_year = 2006; most popular refers to Max(movie_popularity); film refers to movie; | SELECT movie_title FROM movies WHERE movie_release_year = 2006 ORDER BY movie_popularity DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | When was the movie Cops released? | Cops' is movie_title; released refers to movie_release_year; | SELECT movie_release_year FROM movies WHERE movie_title = 'Cops' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | User 58149469's critic on which film got 1 like and 2 comments? | user 58149469 refers to user_id = 58149469; critic with 1 like refers to critic_likes = 1; critic with 2 comments refers to critic_comments = 2; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 58149469 AND T1.critic_likes = 1 AND T1.critic_comments = 2 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please provide the ID of the user with the most followers on the list. | most followers refers to Max(list_followers); | SELECT user_id FROM lists ORDER BY list_followers DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which of the films directed by Álex de la Iclesia is the most popular among Mubi users? | Alex de la Iclesia is the director name; the most popular refers to Max(movie_popularity); films refers to movies; | SELECT movie_title FROM movies WHERE director_name = 'Åke Sandgren' ORDER BY movie_popularity DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which of the film released in 2008 scored the highest? | film released in 2008 refers to movie_release_year = 2008; scored the highest refers to Max(rating_score); film refers to movie; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 2008 ORDER BY T1.rating_score DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the id of the director of the movie "It's Winter". | It's Winter' is movie_title; | SELECT director_id FROM movies WHERE movie_title = 'It''s Winter' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please provide the title of the list with the most comments on the list. | the most comments refers to Max(list_comments); | SELECT list_title FROM lists GROUP BY list_title ORDER BY COUNT(list_comments) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Among the users who are trailists when rating the movie "When Will I Be Loved", how many of them have rated "1" on the movie? | When Will I Be Loved refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1;rated 1 on the movie refers to rating_score = 1; | SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.rating_score = 1 AND T1.user_trialist = 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the names of the top three movies in the number of likes related to the critic made by the user rating the movie. | likes related to the critic made by the user rating the movie refers to critic_likes; top refers to Max(critic_likes); | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 3 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list all the links to the ratings on the movie "A Way of Life" with a critic. | A Way of Life' refers to movie_title; with a critic refers to critic is not null, links to the ratings refers to rating_url; | SELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.critic IS NOT NULL | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many users in Mubi give the movie "White Night Wedding for 5"? | White Night Wedding' is movie_title; for 5 refers to rating_score = 5; | SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5 AND T2.movie_title = 'White Night Wedding' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many users have more than 100 followers in the list created by users in 2009? | more than 100 followers refers to list_followers >100; list created by the user in 2009 refers to list_creation_date_utc = '2009'; | SELECT COUNT(T1.user_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers > 100 AND T1.list_creation_date_utc LIKE '2009%' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What's the url of user 39115684's rating on the movie 'When Will I Be Loved'? | A Way of Life refers to movie_title; user 39115684 refers to userid = 39115684; url refers to rating_url; | SELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many followers does the list created by the user whose user_avatar_image_url is https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214 have? | followers refers to list_followers; | SELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_avatar_image_url = 'https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many users have rated the most popular movie? | most popular refers to Max(movie_popularity); | SELECT COUNT(rating_id) FROM ratings WHERE movie_id = ( SELECT movie_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 ) | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the names of the films released in 2003 among the films scored by user 2941 . | released in 2003 refers to movie_release_year = 2003; user 2941 refers to user_id = 2941; film refers to movie; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 2003 AND T1.user_id = 2941 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What's the cover image of the user who created the movie list 'Georgia related films'? | Play it cool' is list_title; cover image of user refers to user_cover_image_url; | SELECT T1.user_cover_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Georgia related films' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which movie has the highest average score in Mubi? | Highest average score refers to Max(Avg(rating_score)); | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the names of the movies that user 94978 scored as 5. | user 94978 refers to user_id = 94978; scored as 5 refers to rating_score = 5; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5 AND T1.user_id = 94978 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many users were not trialists when they rated the movie "Patti Smith: Dream of Life"? | Patti Smith: Dream of Life' is movie_title; the user was not a trialist when he created the list refers to user_trialist = 0; | SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Patti Smith: Dream of Life' AND T1.user_trialist = 0 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What was the title of the first list created by a user 85981819? And please provide the user_avatar_image_url. | user 85981819 refers to user_id = 85981819; first list created refers to Min (list_creation_date_utc); | SELECT T2.list_title, T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_id = 85981819 ORDER BY T2.list_creation_timestamp_utc LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many users were trialists when they rated the movie "A Way of Life"? | A Way of Life' refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1; | SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.user_trialist = 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What is the average score for the movie Versailles Rive-Gauche? | Versailles Rive-Gauche' is movie_title; average score refers to Avg(rating_score); | SELECT AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Versailles Rive-Gauche' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the names of the top three movies in the number comments related to the critic made by the user rating the movie. | number of comments related to the critic made by the user rating the movie refers to critic_comments; top movie refers to Max(critic_comments); | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_comments DESC LIMIT 3 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the names of the movies that received more than 20 likes? | received more than 20 likes refers to critic_likes>20; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic_likes > 20 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list the names of the movies that have been rated the most times in 2020. | in 2020 refers to rating_timestamp_utc = '2020%'; rated the most times refers to Max(Count(movie_title)); | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2020%' GROUP BY T2.movie_title ORDER BY COUNT(T2.movie_title) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which film rated by user 59988436 that received 21 comments? | user 59988436 refers to user_id = 59988436; received 21 comments refers to critic_comments = 21; film refers to movie; | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 59988436 AND T1.critic_comments = 21 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which user made a critic for the film "When Will I Be Loved" and got 2 comments for the critic? | When Will I Be Loved refers to movie_title; 2 comments for the critic refers to critic_comments = 2; | SELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.critic_comments = 2 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which of the film directed by director Abbas Kiarostami has the highest average score? | Abbas Kiarostami' is director_name; the highest Average score refers to Max(Avg(rating_score)); | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Abbas Kiarostami' GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What is the average score of the movie "The Fall of Berlin" in 2019? | The Fall of Berlin' is movie_title; in 2019 refers to rating_timestamp_utc = 2019; Average score refers to Avg(rating_score); | SELECT SUM(T1.rating_score) / COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2019%' AND T2.movie_title LIKE 'The Fall of Berlin' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What percentage of users rated the movie "Patti Smith: Dream of Life" by more than 3? | Patti Smith: Dream of Life' is movie_title; more than 3 refers to rating_score >3; percentage = Divide(Count(rating_score where rating_score >3), Count(rating_score))*100 | SELECT CAST(SUM(CASE WHEN T1.rating_score > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Patti Smith: Dream of Life' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which year had the most released films? | year refers to movie_release_year; most release films refers to MAX(COUNT(movie_id))
| SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Was user 39115684 a trialist when he or she rated the movie "A Way of Life"? | A Way of Life' refers to movie_title; user 39115684 refers to userid = 39115684; the user was a trialist when he rated the movie refers to user_trialist = 1; | SELECT T1.user_trialist FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many users liked the movie "A Way of Life" to the highest extent? | like the movie highest to the extent refers to rating_score = 5; A Way of Life refers to movie_title; | SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_score = 5 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | When did user 39115684 rate the movie "A Way of Life"? | A Way of Life' refers to movie_title; user 39115684 refers to userid = 39115684; when the user rate refers to rating_timestamp_utc; | SELECT T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Who is the director that made the most movies? Give the director's id. | director that made the most movies refers to MAX(COUNT(movie_id)) | SELECT director_id FROM movies GROUP BY director_id ORDER BY COUNT(movie_id) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Who was the earliest user created a list but didn't get any followers? Give the user ID. | earliest user created a list refers to MIN(list_creation_date_utc); didn't get any followers refers to user_subscriber = 0 | SELECT user_id FROM lists_users WHERE user_subscriber = 0 ORDER BY list_creation_date_utc LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What's the number of the paying subscribers when rating a movie after the year 2014? | paying subscribers refers to user_has_payment_method = 1; rating a movie after the year 2014 refers to rating_date_utc>'2014%' | SELECT COUNT(user_subscriber) FROM ratings_users WHERE user_has_payment_method = 1 AND rating_date_utc > '2014%' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many followers did the user who posted the list "Non-American Films about World War II" have? | the list "Non-American Films about World War II" refers to list_title = 'Non-American Films about World War II' | SELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Non-American Films about World War II' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many movies did the director of the highest movie popularity make? | highest movie popularity refers to MAX(movie_popularity) | SELECT COUNT(movie_id) FROM movies WHERE director_id = ( SELECT director_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 ) | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Give the number of followers for the user who posted the most lists. | number of followers refers to user_subscriber; posted the most lists refers to MAX(COUNT(list_id)) | SELECT SUM(T1.list_followers) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id GROUP BY T1.user_id ORDER BY COUNT(T1.list_id) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Give the name of the movie that got the most "5" ratings. | 5 ratings refers to rating_score = 5; name of the movie refers to movie_title | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Show the portrait picture of the user who created the list "Vladimir Vladimirovich Nabokov". | the list "Vladimir Vladimirovich Nabokov" refers to list_title = 'Vladimir Vladimirovich Nabokov'; portrait picture refers to user_avatar_image_url | SELECT T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Vladimir Vladimirovich Nabokov' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | What's the number of users gave the movie "Downfall" a rating of "4"? | movie "Downfall" refers to movie_title = 'Downfall'; rating of "4" refers to rating_score = 4 | SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Downfall' AND T1.rating_score = 4 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Show the avatar of the user who gave the rating at 2019/10/17 1:36:36. | at 2019/10/17 1:36:36 refers to rating_timestamp_utc = '2019/10/17 1:36:36'; avatar of the user refers to user_avatar_image_url
| SELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id WHERE T1.rating_timestamp_utc LIKE '2019-10-17 01:36:36' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Show the head portrait of the user who gave the most "5" ratings. | head portrait refers to user_avatar_image_url; "5" ratings refers to rating_score = 5 | SELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id WHERE T1.rating_score = 5 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Which movie got the most critic comments? Give the name of the movie. | name of the movie refers to movie_title; most critic comments refers to MAX(critic_comments) | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY COUNT(T1.critic_comments) DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | For the user who post the list that contained the most number of the movies, is he/she a paying subscriber when creating that list? | the list that contained the most number of the movies refers to MAX(list_movie_number); user_has_payment_method = 1 means the user was a paying subscriber when he created the list ;
user_has_payment_method = 0 means the user was not a paying subscriber when he created the list
| SELECT T1.user_has_payment_method FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number = ( SELECT MAX(list_movie_number) FROM lists ) | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Who gave a "4" rating to the movie "Freaks" at 2013/5/4 6:33:32? Give his/her user id. | 4 rating refers to rating_score = 4; the movie "Freaks" refers to movie_title = 'Freaks' ; at 2013/5/4 6:33:32 refers to rating_timestamp_utc = '2013-05-04 06:33:32' | SELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE rating_score = 4 AND rating_timestamp_utc LIKE '2013-05-04 06:33:32' AND T2.movie_title LIKE 'Freaks' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Please list all the critics made by the user rating the movie "A Way of Life". | A Way of Life refers to movie_title; | SELECT T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | For the 1998 movie which got the highest popularity, how many "4" rating did the movie get? | 1998 movie refers to movie_release_year = '1998'; the highest popularity refers to MAX(movie_popularity) ; "4" rating refers to rating_score = 4 | SELECT COUNT(T2.movie_title) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 4 AND T2.movie_release_year = 1998 ORDER BY T2.movie_popularity DESC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many critics were given to the movie that got the most movie popularity number. | most movie popularity number refers to MAX(movie_popularity) | SELECT COUNT(T1.critic) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_popularity = ( SELECT MAX(movie_popularity) FROM movies ) | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | Give the url of movie which was rated 5 on 2013/5/3 5:11:17. | rated 5 refers to rating_score = 5; on 2013/5/3 5:11:17 refers to rating_timestamp_utc = '2013-05-03 05:11:17' | SELECT T2.movie_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE rating_score = 5 AND rating_timestamp_utc LIKE '2013-05-03 05:11:17' | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | From all the movies that got more than 13000 popularity number, which one had the least ratings. | more than 13000 popularity number refers to movie_popularity > 13000; least ratings refers to MIN(rating_score) | SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_popularity > 13000 ORDER BY T1.rating_score LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
movie_platform | How many critics of the movie "Imitation of Life" got more than 1 like? | Imitation of Life refers to movie_title; critics got more than 1 like refers to critic_likes >1; | SELECT COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Imitation of Life' AND T1.critic_likes > 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_id INTEGER references lists_users (user_id), --
);
CREATE TABLE movies
(
director_name TEXT, --
movie_title TEXT, --
director_id TEXT, --
movie_image_url TEXT, --
movie_title_language TEXT, -- Example Values: `en` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
director_url TEXT, --
movie_popularity INTEGER, --
movie_url TEXT, --
movie_release_year INTEGER, --
movie_id INTEGER not null primary key,
);
CREATE TABLE lists
(
list_creation_timestamp_utc TEXT, --
list_third_image_url TEXT, --
list_cover_image_url TEXT, --
list_description TEXT, --
list_movie_number INTEGER, --
list_first_image_url TEXT, --
user_id INTEGER references lists_users (user_id), --
list_title TEXT, --
list_comments INTEGER, --
list_second_image_url TEXT, --
list_update_timestamp_utc TEXT, --
list_id INTEGER not null primary key,
list_url TEXT, --
list_followers INTEGER, --
);
CREATE TABLE lists_users
(
list_update_date_utc TEXT, --
user_subscriber INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_eligible_for_trial TEXT, -- Example Values: `0`, `1` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
user_has_payment_method TEXT, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
foreign key (list_id) references lists(list_id),
foreign key (user_id) references lists(user_id),
user_avatar_image_url TEXT, --
user_cover_image_url TEXT, --
primary key (user_id, list_id),
user_id INTEGER not null, --
user_trialist INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 80311 - Distinct count 2 - Null count 0
list_id INTEGER not null, --
list_creation_date_utc TEXT, --
);
CREATE TABLE ratings
(
user_subscriber INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
movie_id INTEGER, --
rating_url TEXT, --
user_eligible_for_trial INTEGER, -- Example Values: `1`, `0` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (rating_id) references ratings(rating_id),
critic TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (movie_id) references movies(movie_id),
foreign key (user_id) references lists_users(user_id),
foreign key (user_id) references lists_users(user_id),
rating_score INTEGER, -- Example Values: `3`, `2`, `4`, `5`, `1` | Value Statics: Total count 99731 - Distinct count 5 - Null count 269
critic_likes INTEGER, --
foreign key (user_id) references ratings_users(user_id),
foreign key (user_id) references ratings_users(user_id),
rating_id INTEGER, --
rating_timestamp_utc TEXT, --
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
critic_comments INTEGER, --
user_id INTEGER, --
); |
chicago_crime | To which community area does the neighborhood Albany Park belong? | community area refers to community_area_name; the neighborhood Albany Park refers to neighborhood_name = 'Albany Park' | SELECT T2.community_area_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.neighborhood_name = 'Albany Park' | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | What city in Russia has the least population? | Russia is a name of country; least population refers to MIN(Population); | SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Russian Federation' ORDER BY T2.Population ASC LIMIT 1 | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | Identify the total number of orders processed by Northwind employee named Andrew Fuller. What percent of those orders was shipped to Austria? | 'Andrew Fuller' is the full name of an employee; full name refers to FistName, LastName; Austria refers to ShipCountry; calculation = DIVIDE(SUM(ShipCountry = 'Austria'), COUNT(OrderID)) * 100 | SELECT CAST(COUNT(CASE WHEN T2.ShipCountry = 'Austria' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Andrew' AND T1.LastName = 'Fuller' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
superstore | What was the original price of Xerox 1952 ordered by Aimee Bixby on 2014/9/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)) | 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' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | Give the body height status of Mr. Vincent Wyman on 2010/8/2. | body height status refers to DESCRIPTION = 'Body Height' from observations; on 2010/8/2 refers to DATE = '2010-08-02'; | SELECT T2.description, T2.VALUE, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Vincent' AND T1.last = 'Wyman' AND T2.date = '2010-08-02' AND T2.description = 'Body Height' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
chicago_crime | What is the email address to contact the administrator of Central Chicago? | email address refers to email; Central Chicago refers to district_name = 'Central' | SELECT email FROM District WHERE district_name = 'Central' | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | How many unofficial languages are used in Italy? | unofficial languages refers to IsOfficial = 'F'; Italy is a name of country; | SELECT SUM(CASE WHEN T2.IsOfficial = 'F' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Italy' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | How many companies do ship Northwind's orders? | companies refers to ShipperID | SELECT COUNT(ShipperID) FROM Shippers | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Please list the coach IDs who received the award twice from 1970 to 1990. | from 1970 to 1990 refers to year between 1970 and 1990; received award twice refers to coachID where Count(coachID) = 2 | SELECT coachID FROM awards_coaches WHERE year BETWEEN 1970 AND 1990 GROUP BY coachID, award HAVING COUNT(award) = 2 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | What was the total cost of Xerox 1952 ordered by Aimee Bixby on 2014/9/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'); total cost refers to SUTRACT(MULTIPLY(DIVIDE(Sales, SUTRACT(1, discount)), Quantity), Profit) | 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 Date` = '2014-09-10' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | Provide the body weight of Elly Koss in every observation. | body weight VALUE and UNITS where DESCRIPTION = 'Body Weight' from observations; | SELECT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.DESCRIPTION = 'Body Weight' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
chicago_crime | Who is the person responsible for the crime cases in Central Chicago? | the person responsible for the crime cases refers to commander; Central Chicago refers to district_name = 'Central' | SELECT commander FROM District WHERE district_name = 'Central' | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | Who is the head of state of the country where the city of Pyongyang is under? | null | SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Pyongyang' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | Who is the Sales Agent for the company 'Eastern Connection'? | 'Eastern Connection' is a CompanyName; 'Sales Agent' is a ContactTitle | SELECT ContactName FROM Customers WHERE CompanyName = 'Eastern Connection' AND ContactTitle = 'Sales Agent' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
superstore | What was the quantity of Xerox 1952 ordered by Aimee Bixby on 2014/9/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'); | 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' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | What was the condition of Elly Koss on 2009/1/8? | condition on 2009/1/8 refers to DESCRIPTION from conditions where START = '2009-01-08'; | SELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.START = '2009-01-08' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
chicago_crime | Which community area has the least population? | community area refers to community_area_name; the least population refers to min(population) | SELECT community_area_name FROM Community_Area ORDER BY population ASC LIMIT 1 | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | List all the languages used in Europe. | Europe refers to Continent = 'Europe'; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Europe' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | What products are no longer sold by Northwind? | no longer sold refers to Discontinued = 1; products refers to ProductName | SELECT ProductName FROM Products WHERE Discontinued = 1 | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | Please list the last names and first names of all-star players who are higher than 75 inch. | higher than 75 inch refers to height > 75 | SELECT DISTINCT T1.lastName, T1.firstName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.height > 75 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | How many art products were ordered in 2013 in the east superstore? | ordered in 2013 refers to strftime('%Y', "Order Date") = '2013'; art products refers to "Sub-Category" = 'Art' | 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' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | Provide the patients' full names who received the extraction of wisdom tooth. | patient's full name refers to first, last; extraction of wisdom tooth refers to DESCRIPTION = 'Extraction of wisdom tooth' from procedures; | SELECT T1.first, T1.last FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Extraction of wisdom tooth' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
chicago_crime | Which district in Chicago has the most community areas? | district refers to side; the most community areas refers to max(count(side)) | SELECT side FROM Community_Area GROUP BY side ORDER BY COUNT(side) DESC LIMIT 1 | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | What is the capital city of the Philippines? | capital city refers to Capital; Philippines is a name of country; | SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Philipiines' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | How many suppliers does Northwind have in USA? | 'USA' is a country; supplier refers to CompanyName | SELECT COUNT(SupplierID) FROM Suppliers WHERE Country = 'USA' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | From 1962 to 2011, how many coaches received both NBA and ABA awards? | from 1962 to 2011 refers to year between 1960 and 2011; received both NBA and ABA award refers to coachID where award LIKE 'NBA%' and 'ABA%' | SELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'ABA Coach of the Year' AND coachID IN ( SELECT coachID FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'NBA Coach of the Year' ) | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
superstore | For how many times has Aimee Bixby ordered the product Xerox 1952? | Xerox 1952 is a "Product Name"; Aimee Bixby ordered refers to "Customer Name" = 'Aimee Bixby'; | 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' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Second Class`, `Standard Class`, `First Class`, `Same Day` | Value Statics: Total count 6406 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
Sales REAL, --
Quantity INTEGER, -- Example Values: `3`, `5`, `4`, `10`, `2` | Value Statics: Total count 6406 - Distinct count 14 - Null count 0
Discount REAL, -- Example Values: `0.0`, `0.15`, `0.2`, `0.7`, `0.5` | Value Statics: Total count 6406 - Distinct count 5 - Null count 0
"Ship Date" DATE, --
);
CREATE TABLE people
(
Region TEXT, -- Example Values: `Central`, `East`, `West`, `South` | Value Statics: Total count 2501 - Distinct count 4 - Null count 0
Country TEXT, -- Example Values: `United States` | Value Statics: Total count 2501 - Distinct count 1 - Null count 0
State TEXT, --
primary key ("Customer ID", Region),
City TEXT, --
Segment TEXT, -- Example Values: `Consumer`, `Home Office`, `Corporate` | Value Statics: Total count 2501 - Distinct count 3 - Null count 0
"Customer ID" TEXT, --
"Postal Code" INTEGER, --
"Customer Name" TEXT, --
);
CREATE TABLE product
(
"Product ID" TEXT, --
Region TEXT, -- Example Values: `Central`, `South`, `West`, `East` | Value Statics: Total count 5298 - Distinct count 4 - Null count 0
"Sub-Category" TEXT, -- Example Values: `Bookcases`, `Chairs`, `Furnishings`, `Tables`, `Appliances` | Value Statics: Total count 5298 - Distinct count 17 - Null count 0
Category TEXT, -- Example Values: `Furniture`, `Office Supplies`, `Technology` | Value Statics: Total count 5298 - Distinct count 3 - Null count 0
"Product Name" TEXT, --
primary key ("Product ID", Region),
);
CREATE TABLE central_superstore
(
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 4646 - Distinct count 4 - Null count 0
Quantity INTEGER, -- Example Values: `2`, `3`, `7`, `1`, `5` | Value Statics: Total count 4646 - Distinct count 14 - Null count 0
"Ship Date" DATE, --
"Order Date" DATE, --
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Product ID" TEXT, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Profit REAL, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.2`, `0.8`, `0.6`, `0.0`, `0.1` | Value Statics: Total count 4646 - Distinct count 9 - Null count 0
Region TEXT, -- Example Values: `Central` | Value Statics: Total count 4646 - Distinct count 1 - Null count 0
);
CREATE TABLE east_superstore
(
"Row ID" INTEGER primary key,
Region TEXT, -- Example Values: `East` | Value Statics: Total count 5696 - Distinct count 1 - Null count 0
"Order ID" TEXT, --
"Product ID" TEXT, --
Sales REAL, --
foreign key ("Product ID", Region) references product("Product ID",Region),
Discount REAL, -- Example Values: `0.2`, `0.0`, `0.7`, `0.5`, `0.4` | Value Statics: Total count 5696 - Distinct count 7 - Null count 0
Quantity INTEGER, -- Example Values: `3`, `2`, `7`, `4`, `6` | Value Statics: Total count 5696 - Distinct count 14 - Null count 0
Profit REAL, --
foreign key ("Customer ID", Region) references people("Customer ID",Region),
"Ship Mode" TEXT, -- Example Values: `Standard Class`, `First Class`, `Second Class`, `Same Day` | Value Statics: Total count 5696 - Distinct count 4 - Null count 0
"Customer ID" TEXT, --
"Order Date" DATE, --
"Ship Date" DATE, --
);
CREATE TABLE south_superstore
(
"Product ID" TEXT, --
Profit REAL, --
Sales REAL, --
"Order Date" DATE, --
"Customer ID" TEXT, --
Discount REAL, -- Example Values: `0.0`, `0.7`, `0.2`, `0.5`, `0.45` | Value Statics: Total count 3240 - Distinct count 6 - Null count 0
Region TEXT, -- Example Values: `South` | Value Statics: Total count 3240 - Distinct count 1 - Null count 0
"Ship Date" DATE, --
foreign key ("Product ID", Region) references product("Product ID",Region),
foreign key ("Customer ID", Region) references people("Customer ID",Region),
Quantity INTEGER, -- Example Values: `3`, `9`, `2`, `4`, `1` | Value Statics: Total count 3240 - Distinct count 14 - Null count 0
"Order ID" TEXT, --
"Row ID" INTEGER primary key,
"Ship Mode" TEXT, -- Example Values: `First Class`, `Standard Class`, `Second Class`, `Same Day` | Value Statics: Total count 3240 - Distinct count 4 - Null count 0
); |
synthea | Give the number of claims did Ms. Abbie Cole have in the year of 2011. | in the year of 2011 refers to BILLABLEPERIOD between '2010-12-31' and '2012-01-01'; | SELECT COUNT(T2.BILLABLEPERIOD) FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Abbie' AND T1.last = 'Cole' AND T2.BILLABLEPERIOD BETWEEN '2010-12-31' AND '2012-01-01' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
chicago_crime | Which district is the community area Lincoln Square grouped into? | district refers to side; community area Lincoln Square refers to community_area_name = 'Lincoln Square' | SELECT side FROM Community_Area WHERE community_area_name = 'Lincoln Square' | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | What is the form of government that the city of Manila has? | form of government refers to GovernmentForm; | SELECT T1.GovernmentForm FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Manila' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | What is the salary range for sales representative in Northwind? | salary range is BETWEEN max(Salary) AND min(Salary); sales representative is a title | SELECT ( SELECT MIN(Salary) FROM Employees WHERE Title = 'Sales Representative' ) AS MIN , ( SELECT MAX(Salary) FROM Employees WHERE Title = 'Sales Representative' ) AS MAX | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | In 1975, what was the average point of all-star players coming from the USA? | in 1975 refers to season_id = 1975; coming from USA refers to birthCountry = 'USA'; average point refers to Divide (Sum(points), Count(playerID)) | SELECT AVG(T2.points) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1975 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | What is the glucose level of the patient that lives at 365 Della Crossroad Suite 202, Deerfield, MA 01342 US? | glucose level refers to VALUE, UNITS where DESCRIPTION = 'Glucose' from observations; lives at 365 Della Crossroad Suite 202, Deerfield, MA 01342 US refers to address = '365 Della Crossroad Suite 202 Deerfield MA 01342 US'; | SELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Glucose' AND T1.address = '365 Della Crossroad Suite 202 Deerfield MA 01342 US' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
chicago_crime | How many community areas are there in Central Chicago? | Central Chicago refers to side = 'Central' | SELECT COUNT(*) FROM Community_Area WHERE side = 'Central' | CREATE TABLE District
(
district_no INTEGER primary key,
email TEXT, --
phone TEXT, --
address TEXT, --
fax TEXT, --
district_name TEXT, --
tty TEXT, --
commander TEXT, --
zip_code INTEGER, --
twitter TEXT, --
);
CREATE TABLE Community_Area
(
population TEXT, --
side TEXT, -- Example Values: `Far North `, `North `, `Central`, `Northwest `, `West ` | Value Statics: Total count 77 - Distinct count 9 - Null count 0
community_area_no INTEGER primary key,
community_area_name TEXT, --
);
CREATE TABLE Ward
(
ward_office_address TEXT, --
ward_office_zip TEXT, --
city_hall_office_phone TEXT, --
alderman_first_name TEXT, --
ward_no INTEGER primary key,
ward_email TEXT, --
ward_office_fax TEXT, --
alderman_last_name TEXT, --
Population INTEGER, --
alderman_name_suffix TEXT, -- Example Values: `Jr.` | Value Statics: Total count 5 - Distinct count 1 - Null count 45
ward_office_phone TEXT, --
city_hall_office_room INTEGER, -- Example Values: `200`, `305`, `300`, `302` | Value Statics: Total count 50 - Distinct count 4 - Null count 0
city_hall_office_fax TEXT, --
);
CREATE TABLE IUCR
(
iucr_no TEXT primary key,
index_code TEXT, -- Example Values: `I`, `N` | Value Statics: Total count 401 - Distinct count 2 - Null count 0
primary_description TEXT, --
secondary_description TEXT, --
);
CREATE TABLE FBI_Code
(
description TEXT, --
fbi_code_no TEXT primary key,
crime_against TEXT, -- Example Values: `Persons`, `Property`, `Society`, `Persons and Society` | Value Statics: Total count 26 - Distinct count 4 - Null count 0
title TEXT, --
);
CREATE TABLE Neighborhood
(
foreign key (community_area_no) references Community_Area(community_area_no),
community_area_no INTEGER, --
neighborhood_name TEXT primary key,
);
CREATE TABLE Crime
(
case_number TEXT, --
longitude TEXT, --
foreign key (fbi_code_no) references FBI_Code(fbi_code_no),
fbi_code_no TEXT, --
date TEXT, --
arrest TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
foreign key (community_area_no) references Community_Area(community_area_no),
location_description TEXT, --
latitude TEXT, --
block TEXT, --
ward_no INTEGER, --
domestic TEXT, -- Example Values: `FALSE`, `TRUE` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
district_no INTEGER, --
report_no INTEGER primary key,
iucr_no TEXT, --
foreign key (ward_no) references Ward(ward_no),
community_area_no INTEGER, --
foreign key (district_no) references District(district_no),
foreign key (iucr_no) references IUCR(iucr_no),
beat INTEGER, --
); |
world | How many percent of the population of China used Chinese as their language? | percent refers to Percentage; China is a name of country; use Chinese as their language refers to Language = 'Chinese'; | SELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'China' AND T2.Language = 'Chinese' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
retail_world | How many boxes of 'Pavlova' did Northwind sell? | 'Pavlova' is a ProductName | SELECT COUNT(T2.Quantity) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Pavlova' | CREATE TABLE Products
(
CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0
Unit TEXT, --
ReorderLevel INT, --
ProductName TEXT, --
Price REAL DEFAULT 0, --
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID),
SupplierID INTEGER, --
ProductID INTEGER PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
);
CREATE TABLE Customers
(
ContactName TEXT, --
Country TEXT, --
Address TEXT, --
City TEXT, --
CustomerID INTEGER PRIMARY KEY AUTOINCREMENT,
PostalCode TEXT, --
CustomerName TEXT, --
);
CREATE TABLE EmployeeTerritories
(
TerritoryID INT, --
EmployeeID INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE OrderDetails
(
Quantity INTEGER, --
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
OrderID INTEGER, --
FOREIGN KEY (ProductID) REFERENCES Products (ProductID),
OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT,
ProductID INTEGER, --
);
CREATE TABLE Shippers
(
ShipperID INTEGER PRIMARY KEY AUTOINCREMENT,
ShipperName TEXT, -- Example Values: `Speedy Express`, `United Package`, `Federal Shipping` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
Phone TEXT, -- Example Values: `(503) 555-9831`, `(503) 555-3199`, `(503) 555-9931` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE Territory
(
TerritoryDescription TEXT, --
RegionID INTEGER, --
TerritoryID INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE EmployeeDetails
(
EmployeeID INT PRIMARY KEY,
Title TEXT, --
Salary INT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
);
CREATE TABLE Categories
(
CategoryID INTEGER PRIMARY KEY AUTOINCREMENT,
CategoryName TEXT, -- Example Values: `Beverages`, `Condiments`, `Confections`, `Dairy Products`, `Grains/Cereals` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
Description TEXT, -- Example Values: `Soft drinks, coffees, teas, beers, and ales`, `Sweet and savory sauces, relishes, spreads, and seasonings`, `Desserts, candies, and sweet breads`, `Cheeses`, `Breads, crackers, pasta, and cereal` | Value Statics: Total count 8 - Distinct count 8 - Null count 0
);
CREATE TABLE Employees
(
Photo TEXT, -- Example Values: `EmpID1.pic`, `EmpID2.pic`, `EmpID3.pic`, `EmpID4.pic`, `EmpID5.pic` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
Notes TEXT, -- Example Values: `Education includes a BA in psychology from Colorado State University. She also completed (The Art of the Cold Call). Nancy is a member of 'Toastmasters International'.`, `Andrew received his BTS commercial and a Ph.D. in international marketing from the University of Dallas. He is fluent in French and Italian and reads German. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.`, `Janet has a BS degree in chemistry from Boston College). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate and was promoted to sales representative.`, `Margaret holds a BA in English literature from Concordia College and an MA from the American Institute of Culinary Arts. She was temporarily assigned to the London office before returning to her permanent post in Seattle.`, `Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. Upon joining the company as a sales representative, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London, where he was promoted to sales manager. Mr. Buchanan has completed the courses 'Successful Telemarketing' and 'International Sales Management'. He is fluent in French.` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
BirthDate DATE, -- Example Values: `1968-12-08`, `1952-02-19`, `1963-08-30`, `1958-09-19`, `1955-03-04` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT,
FirstName TEXT, -- Example Values: `Nancy`, `Andrew`, `Janet`, `Margaret`, `Steven` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
LastName TEXT, -- Example Values: `Davolio`, `Fuller`, `Leverling`, `Peacock`, `Buchanan` | Value Statics: Total count 10 - Distinct count 10 - Null count 0
);
CREATE TABLE Suppliers
(
PostalCode TEXT, --
Address TEXT, --
SupplierID INTEGER PRIMARY KEY AUTOINCREMENT,
City TEXT, --
Country TEXT, -- Example Values: `UK`, `USA`, `Japan`, `Spain`, `Australia` | Value Statics: Total count 29 - Distinct count 16 - Null count 0
Discontinued INTEGER DEFAULT 0, -- Example Values: `0` | Value Statics: Total count 29 - Distinct count 1 - Null count 0
ContactName TEXT, --
Phone TEXT, --
SupplierName TEXT, --
);
CREATE TABLE EmployeesExtra
(
Salary INTEGER, --
Title TEXT, --
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID),
EmployeeID INTEGER PRIMARY KEY,
);
CREATE TABLE discontinued_products
(
Discontinued INTEGER, --
ProductID INTEGER PRIMARY KEY,
);
CREATE TABLE Orders
(
OrderID INTEGER PRIMARY KEY AUTOINCREMENT,
CustomerID INTEGER, --
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (ShipperID) REFERENCES Shippers (ShipperID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
ShipperID INTEGER, -- Example Values: `3`, `1`, `2` | Value Statics: Total count 196 - Distinct count 3 - Null count 0
OrderDate DATETIME, --
EmployeeID INTEGER, -- Example Values: `5`, `6`, `4`, `3`, `9` | Value Statics: Total count 196 - Distinct count 9 - Null count 0
);
CREATE TABLE Territories
(
TerritoryDescription TEXT, --
RegionDescription TEXT, --
);
CREATE TABLE ShippingInfo
(
ShipCountry TEXT, --
ShippedDate DATETIME, --
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
OrderID INTEGER PRIMARY KEY,
); |
professional_basketball | What is the name of the coach during whose period of coaching, a team has the most numbers of games won in the post-season games? | the most number of game won in post season refers to Max(post_wins); coach refers to coachID | SELECT coachID FROM coaches ORDER BY post_wins DESC LIMIT 1 | CREATE TABLE players_teams
(
PostGS INTEGER, --
PostdRebounds INTEGER, --
PostPF INTEGER, --
tmID TEXT, --
threeAttempted INTEGER, --
PostRebounds INTEGER, --
assists INTEGER, --
threeMade INTEGER, --
PostBlocks INTEGER, --
PostTurnovers INTEGER, --
GP INTEGER, --
lgID TEXT, -- Example Values: `NBA`, `NBL`, `ABA`, `ABL1`, `NPBL` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
PostfgMade INTEGER, --
steals INTEGER, --
oRebounds INTEGER, --
PostftAttempted INTEGER, --
ftAttempted INTEGER, --
ftMade INTEGER, --
points INTEGER, --
PostfgAttempted INTEGER, --
PostftMade INTEGER, --
note TEXT, -- Example Values: `C` | Value Statics: Total count 43 - Distinct count 1 - Null count 23708
dRebounds INTEGER, --
PostSteals INTEGER, --
blocks INTEGER, --
PostAssists INTEGER, --
minutes INTEGER, --
fgAttempted INTEGER, --
playerID TEXT not null references players on update cascade on delete cascade, --
PostthreeMade INTEGER, --
PostPoints INTEGER, --
year INTEGER, --
PF INTEGER, --
fgMade INTEGER, --
PostthreeAttempted INTEGER, --
rebounds INTEGER, --
id INTEGER primary key autoincrement,
stint INTEGER, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 23751 - Distinct count 6 - Null count 0
PostMinutes INTEGER, --
PostGP INTEGER, --
turnovers INTEGER, --
PostoRebounds INTEGER, --
GS INTEGER, --
);
CREATE TABLE awards_coaches
(
award TEXT, -- Example Values: `NBA Coach of the Year`, `ABA Coach of the Year` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
id INTEGER primary key autoincrement,
note TEXT, -- Example Values: `tie` | Value Statics: Total count 4 - Distinct count 1 - Null count 57
coachID TEXT, --
lgID TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 61 - Distinct count 2 - Null count 0
foreign key (coachID, year) references coaches (coachID, year) on update cascade on delete cascade,
year INTEGER, --
);
CREATE TABLE draft
(
draftOverall INTEGER null, --
lgID TEXT null, -- Example Values: `ABA`, `NBA` | Value Statics: Total count 8621 - Distinct count 2 - Null count 0
suffixName TEXT null, -- Example Values: `Jr.` | Value Statics: Total count 2 - Distinct count 1 - Null count 8619
draftYear INTEGER null, --
draftSelection INTEGER null, --
tmID TEXT null, --
draftRound INTEGER null, --
lastName TEXT null, --
playerID TEXT null, --
draftFrom TEXT null, --
id INTEGER default 0 not null primary key,
firstName TEXT null, --
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmID, draftYear) references teams (tmID, year) on update cascade on delete cascade,
);
CREATE TABLE player_allstar
(
rebounds INTEGER null, --
playerID TEXT not null, --
season_id INTEGER not null, --
assists INTEGER null, --
conference TEXT null, -- Example Values: `East`, `West`, `Weset`, `Allstars`, `Denver` | Value Statics: Total count 1608 - Distinct count 5 - Null count 0
points INTEGER null, --
personal_fouls INTEGER null, -- Example Values: `3`, `2`, `0`, `1`, `5` | Value Statics: Total count 540 - Distinct count 8 - Null count 1068
ft_attempted INTEGER null, -- Example Values: `2`, `4`, `0`, `6`, `3` | Value Statics: Total count 1561 - Distinct count 17 - Null count 47
fg_attempted INTEGER null, --
league_id TEXT null, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 1608 - Distinct count 2 - Null count 0
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
fg_made INTEGER null, -- Example Values: `4`, `8`, `5`, `7`, `3` | Value Statics: Total count 1561 - Distinct count 18 - Null count 47
ft_made INTEGER null, -- Example Values: `2`, `3`, `0`, `1`, `4` | Value Statics: Total count 1561 - Distinct count 13 - Null count 47
steals INTEGER null, -- Example Values: `3`, `0`, `1`, `2`, `5` | Value Statics: Total count 398 - Distinct count 7 - Null count 1210
games_played INTEGER null, -- Example Values: `1` | Value Statics: Total count 1608 - Distinct count 1 - Null count 0
first_name TEXT null, --
d_rebounds INTEGER null, -- Example Values: `2`, `5`, `0`, `1`, `4` | Value Statics: Total count 493 - Distinct count 14 - Null count 1115
last_name TEXT null, --
primary key (playerID, season_id),
turnovers INTEGER null, -- Example Values: `1`, `0`, `3`, `2`, `4` | Value Statics: Total count 493 - Distinct count 9 - Null count 1115
three_made INTEGER null, -- Example Values: `0`, `1`, `3`, `5`, `4` | Value Statics: Total count 566 - Distinct count 7 - Null count 1042
minutes INTEGER null, --
blocks INTEGER null, -- Example Values: `2`, `0`, `1`, `3`, `5` | Value Statics: Total count 398 - Distinct count 6 - Null count 1210
three_attempted INTEGER null, -- Example Values: `0`, `1`, `6`, `7`, `10` | Value Statics: Total count 540 - Distinct count 12 - Null count 1068
o_rebounds INTEGER null, -- Example Values: `1`, `2`, `0`, `3`, `4` | Value Statics: Total count 493 - Distinct count 10 - Null count 1115
);
CREATE TABLE awards_players
(
foreign key (playerID) references players (playerID) on update cascade on delete cascade,
year INTEGER not null, --
pos TEXT null, -- Example Values: `C`, `F`, `G`, `F/G`, `F/C` | Value Statics: Total count 833 - Distinct count 5 - Null count 886
primary key (playerID, year, award),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `NBL`, `ABL1` | Value Statics: Total count 1719 - Distinct count 4 - Null count 0
award TEXT not null, --
playerID TEXT not null, --
note TEXT null, -- Example Values: `tie` | Value Statics: Total count 37 - Distinct count 1 - Null count 1682
);
CREATE TABLE series_post
(
tmIDLoser TEXT, --
id INTEGER primary key autoincrement,
series TEXT, -- Example Values: `O`, `M`, `N`, `A`, `K` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
tmIDWinner TEXT, --
round TEXT, -- Example Values: `F`, `QF`, `SF`, `DT`, `DF` | Value Statics: Total count 775 - Distinct count 11 - Null count 0
year INTEGER, --
foreign key (tmIDLoser, year) references teams (tmID, year) on update cascade on delete cascade,
foreign key (tmIDWinner, year) references teams (tmID, year) on update cascade on delete cascade,
W INTEGER, -- Example Values: `4`, `2`, `1`, `3`, `0` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
lgIDLoser TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
lgIDWinner TEXT, -- Example Values: `NBA`, `ABA` | Value Statics: Total count 775 - Distinct count 2 - Null count 0
L INTEGER, -- Example Values: `1`, `0`, `2`, `3`, `4` | Value Statics: Total count 775 - Distinct count 5 - Null count 0
);
CREATE TABLE players
(
nameGiven TEXT null, -- Example Values: `nameGiven`, `Mort`, `Robert`, `Jim`, `Mike` | Value Statics: Total count 10 - Distinct count 9 - Null count 5052
lastseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
hsCountry TEXT null, --
firstName TEXT null, --
hsCity TEXT null, --
firstseason INTEGER null, -- Example Values: `0`, `1951` | Value Statics: Total count 5047 - Distinct count 2 - Null count 15
weight INTEGER null, --
birthCountry TEXT null, --
race TEXT null, -- Example Values: `B`, `W`, `O`, `1`, `r` | Value Statics: Total count 4903 - Distinct count 5 - Null count 159
lastName TEXT null, --
birthDate DATE null, --
collegeOther TEXT null, --
birthState TEXT null, --
useFirst TEXT null, --
pos TEXT null, -- Example Values: `F-C`, `C`, `G`, `G-F`, `C-F` | Value Statics: Total count 4880 - Distinct count 14 - Null count 182
playerID TEXT not null primary key,
college TEXT null, --
highSchool TEXT null, --
hsState TEXT null, --
height REAL null, --
deathDate DATE null, --
nameSuffix TEXT null, -- Example Values: `Jr.`, `III`, `nameSuffix`, `II`, `IV` | Value Statics: Total count 324 - Distinct count 6 - Null count 4738
nameNick TEXT null, --
fullGivenName TEXT null, --
birthCity TEXT null, --
middleName TEXT null, --
);
CREATE TABLE teams
(
d_pts INTEGER null, --
name TEXT null, --
homeLost INTEGER null, --
o_ftm INTEGER null, --
franchID TEXT null, --
tmID TEXT not null, --
awayWon INTEGER null, --
primary key (year, tmID),
o_fgm INTEGER null, --
year INTEGER not null, --
awayLost INTEGER null, --
arena TEXT null, --
confID TEXT null, -- Example Values: `EC`, `WC` | Value Statics: Total count 1064 - Distinct count 2 - Null count 472
games INTEGER null, --
lost INTEGER null, --
divID TEXT null, -- Example Values: `EA`, `WE`, `ED`, `WD`, `SO` | Value Statics: Total count 1498 - Distinct count 13 - Null count 38
lgID TEXT null, -- Example Values: `NBL`, `NBA`, `PBLA`, `NPBL`, `ABL1` | Value Statics: Total count 1536 - Distinct count 6 - Null count 0
homeWon INTEGER null, --
confRank INTEGER null, -- Example Values: `0`, `4`, `3`, `5`, `7` | Value Statics: Total count 1536 - Distinct count 16 - Null count 0
o_pts INTEGER null, --
`rank` INTEGER null, -- Example Values: `1`, `2`, `4`, `5`, `6` | Value Statics: Total count 1536 - Distinct count 10 - Null count 0
playoff TEXT null, -- Example Values: `CF`, `WC`, `LC`, `CS`, `F` | Value Statics: Total count 901 - Distinct count 15 - Null count 635
won INTEGER null, --
);
CREATE TABLE coaches
(
primary key (coachID, year, tmID, stint),
lgID TEXT null, -- Example Values: `NBA`, `ABA`, `ABL1`, `PBLA`, `NPBL` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
post_losses INTEGER null, -- Example Values: `3`, `9`, `7`, `8`, `0` | Value Statics: Total count 1649 - Distinct count 12 - Null count 40
year INTEGER not null, --
won INTEGER null, --
foreign key (tmID, year) references teams (tmID, year) on update cascade on delete cascade,
post_wins INTEGER null, -- Example Values: `0`, `12`, `9`, `13`, `1` | Value Statics: Total count 1649 - Distinct count 17 - Null count 40
coachID TEXT not null, --
tmID TEXT not null, --
lost INTEGER null, --
stint INTEGER not null, -- Example Values: `2`, `1`, `4`, `5`, `3` | Value Statics: Total count 1689 - Distinct count 5 - Null count 0
); |
synthea | Among the patients with acute bronchitis, what is the percentage of Asian women? | DIVIDE(COUNT(PATIENT where gender = 'F' and race = 'asian'), COUNT(PATIENT)) as percentage where DESCRIPTION = 'Acute bronchitis (disorder)' ; | SELECT CAST(SUM(CASE WHEN T2.gender = 'F' AND T2.race = 'asian' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.gender) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Acute bronchitis (disorder)' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE DATE, --
primary key (DATE, PATIENT, ENCOUNTER, CODE),
DESCRIPTION TEXT, -- Example Values: `Influenza seasonal injectable preservative free`, `Td (adult) preservative free`, `meningococcal MCV4P`, `Tdap`, `HPV quadrivalent` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
);
CREATE TABLE allergies
(
CODE INTEGER, -- Example Values: `232347008`, `300916003`, `419474003`, `424213003`, `300913006` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
foreign key (ENCOUNTER) references encounters(ID),
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
primary key (PATIENT, ENCOUNTER, CODE),
STOP TEXT, -- Example Values: `12/22/14`, `4/21/10`, `10/15/11`, `3/17/10`, `5/26/08` | Value Statics: Total count 16 - Distinct count 11 - Null count 556
START TEXT, --
DESCRIPTION TEXT, -- Example Values: `Allergy to dairy product`, `Allergy to tree pollen`, `Allergy to grass pollen`, `Dander (animal) allergy`, `House dust mite allergy` | Value Statics: Total count 572 - Distinct count 15 - Null count 0
);
CREATE TABLE observations
(
DATE DATE, --
ENCOUNTER TEXT, --
VALUE REAL, --
UNITS TEXT, -- Example Values: `cm`, `kg`, `kg/m2`, `mmHg`, `Cel` | Value Statics: Total count 78444 - Distinct count 17 - Null count 455
DESCRIPTION TEXT, --
CODE TEXT, --
PATIENT TEXT, --
foreign key (PATIENT) references patients(patient),
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE medications
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, --
PATIENT TEXT, --
STOP DATE, --
START DATE, --
REASONDESCRIPTION TEXT, --
DESCRIPTION TEXT, --
primary key (START, PATIENT, ENCOUNTER, CODE),
foreign key (PATIENT) references patients(patient),
REASONCODE INTEGER, --
ENCOUNTER TEXT, --
);
CREATE TABLE careplans
(
START DATE, --
STOP DATE, --
ID TEXT, --
REASONCODE INTEGER, --
REASONDESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
DESCRIPTION TEXT, --
CODE REAL, --
ENCOUNTER TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
);
CREATE TABLE encounters
(
DATE DATE, --
REASONCODE INTEGER, --
CODE INTEGER, --
ID TEXT primary key,
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
REASONDESCRIPTION TEXT, --
);
CREATE TABLE procedures
(
foreign key (PATIENT) references patients(patient),
REASONDESCRIPTION TEXT, --
PATIENT TEXT, --
foreign key (ENCOUNTER) references encounters(ID),
DATE DATE, --
DESCRIPTION TEXT, --
ENCOUNTER TEXT, --
CODE INTEGER, --
REASONCODE INTEGER, --
);
CREATE TABLE patients
(
suffix TEXT, -- Example Values: `PhD`, `JD`, `MD` | Value Statics: Total count 45 - Distinct count 3 - Null count 1417
prefix TEXT, -- Example Values: `Mr.`, `Mrs.`, `Ms.` | Value Statics: Total count 1166 - Distinct count 3 - Null count 296
deathdate DATE, --
ethnicity TEXT, --
race TEXT, -- Example Values: `black`, `white`, `hispanic`, `asian` | Value Statics: Total count 1462 - Distinct count 4 - Null count 0
address TEXT, --
birthplace TEXT, --
passport TEXT, --
maiden TEXT, --
birthdate DATE, --
marital TEXT, -- Example Values: `S`, `M` | Value Statics: Total count 1033 - Distinct count 2 - Null count 429
gender TEXT, -- Example Values: `F`, `M` | Value Statics: Total count 1462 - Distinct count 2 - Null count 0
drivers TEXT, --
first TEXT, --
last TEXT, --
patient TEXT primary key,
ssn TEXT, --
);
CREATE TABLE claims
(
ENCOUNTER TEXT references encounters, --
PATIENT TEXT references patients, --
ORGANIZATION TEXT, -- Example Values: `temp organization` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
TOTAL INTEGER, -- Example Values: `100` | Value Statics: Total count 20523 - Distinct count 1 - Null count 0
BILLABLEPERIOD DATE, --
DIAGNOSIS TEXT, --
ID TEXT primary key,
);
CREATE TABLE conditions
(
START DATE, --
DESCRIPTION TEXT, --
foreign key (PATIENT) references patients(patient),
PATIENT TEXT, --
CODE INTEGER, --
ENCOUNTER TEXT, --
STOP DATE, --
foreign key (ENCOUNTER) references encounters(ID),
foreign key (DESCRIPTION) references all_prevalences(ITEM),
);
CREATE TABLE all_prevalences
(
"POPULATION TYPE" TEXT, -- Example Values: `LIVING` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
"POPULATION COUNT" INTEGER, -- Example Values: `1000` | Value Statics: Total count 244 - Distinct count 1 - Null count 0
ITEM TEXT primary key,
"PREVALENCE PERCENTAGE" REAL, --
"PREVALENCE RATE" REAL, --
OCCURRENCES INTEGER, --
); |
software_company | Among the reference ID of under 10 who got response by marketing department, compare their education status. | reference ID of under 10 refers to REFID < 10; got response refers to RESPONSE = 'true'; education status refers to EDUCATIONNUM; | SELECT T1.EDUCATIONNUM FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T2.REFID < 10 AND T2.RESPONSE = 'true' | CREATE TABLE Customers
(
EDUCATIONNUM INTEGER, -- Example Values: `7`, `3`, `4`, `11`, `5` | Value Statics: Total count 100000 - Distinct count 17 - Null count 0
MARITAL_STATUS TEXT, -- Example Values: `Never-married`, `Married-civ-spouse`, `Divorced`, `Widowed`, `Other` | Value Statics: Total count 100000 - Distinct count 5 - Null count 0
ID INTEGER constraint Customers_pk primary key,
SEX TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
OCCUPATION TEXT, -- Example Values: `Machine-op-inspct`, `Handlers-cleaners`, `Exec-managerial`, `Farming-fishing`, `Other-service` | Value Statics: Total count 100000 - Distinct count 8 - Null count 0
age INTEGER, --
GEOID INTEGER constraint Customers_Demog_GEOID_fk references Demog, --
);
CREATE TABLE Mailings1_2
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
REFID INTEGER constraint Mailings1_2_pk primary key constraint Mailings1_2_Customers_ID_fk references Customers,
REF_DATE DATETIME, -- Example Values: `2007-02-01 12:00:00.0`, `2007-03-01 12:00:00.0` | Value Statics: Total count 60000 - Distinct count 2 - Null count 0
);
CREATE TABLE Sales
(
REFID INTEGER references Customers, --
EVENT_DATE DATETIME, --
AMOUNT REAL, --
EVENTID INTEGER constraint Sales_pk primary key,
);
CREATE TABLE Demog
(
A_VAR1 REAL, --
A_VAR2 REAL, --
A_VAR14 REAL, --
A_VAR8 REAL, --
A_VAR12 REAL, --
A_VAR6 REAL, --
A_VAR17 REAL, --
A_VAR15 REAL, --
A_VAR10 REAL, --
A_VAR16 REAL, --
INHABITANTS_K REAL, --
A_VAR3 REAL, --
A_VAR7 REAL, --
A_VAR4 REAL, --
A_VAR5 REAL, --
A_VAR13 REAL, --
A_VAR9 REAL, --
INCOME_K REAL, --
GEOID INTEGER constraint Demog_pk primary key,
A_VAR18 REAL, --
A_VAR11 REAL, --
);
CREATE TABLE mailings3
(
RESPONSE TEXT, -- Example Values: `false`, `true` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
REF_DATE DATETIME, -- Example Values: `2007-07-01 12:00:00.0` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
REFID INTEGER constraint mailings3_pk primary key,
); |
world | What is the official language of China? | official language refers to IsOfficial = 'T'; China is a name of country; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'China' AND T2.IsOfficial = 'T' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INTEGER NOT NULL DEFAULT 0, --
`Code` TEXT NOT NULL DEFAULT '', --
`GNP` REAL DEFAULT NULL, --
`HeadOfState` TEXT DEFAULT NULL, --
`IndepYear` INTEGER DEFAULT NULL, --
`Capital` INTEGER DEFAULT NULL, --
`LifeExpectancy` REAL DEFAULT NULL, --
`Code2` TEXT NOT NULL DEFAULT '', --
PRIMARY KEY (`Code`),
`LocalName` TEXT NOT NULL DEFAULT '', --
`GovernmentForm` TEXT NOT NULL DEFAULT '', --
`Region` TEXT NOT NULL DEFAULT '', --
`GNPOld` REAL DEFAULT NULL, --
);
CREATE TABLE City
(
`Population` INTEGER NOT NULL DEFAULT 0, --
`District` TEXT NOT NULL DEFAULT '', --
`Name` TEXT NOT NULL DEFAULT '', --
`ID` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`CountryCode` TEXT NOT NULL DEFAULT '', --
);
CREATE TABLE CountryLanguage
(
PRIMARY KEY (`CountryCode`,`Language`),
`Percentage` REAL NOT NULL DEFAULT 0.0, --
`Language` TEXT NOT NULL DEFAULT '', --
FOREIGN KEY (`CountryCode`) REFERENCES `Country` (`Code`),
`IsOfficial`TEXT NOT NULL DEFAULT 'F', -- Example Values: `T`, `F` | Value Statics: Total count 984 - Distinct count 2 - Null count 0
`CountryCode` TEXT NOT NULL DEFAULT '', --
); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.