db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
olympics | In which Olympic Games have the largest number of women participation? | the largest number of women participation refers to MAX(COUNT(gender = 'F')); In which Olympic Games refer to games_year; | SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.gender = 'F' GROUP BY T1.games_name ORDER BY COUNT(T2.person_id) DESC LIMIT 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Among the movies directed by Wolfgang Reitherman, how many of them were released in December? | Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; released in December refers to (release_date, instr(release_date, '-') + 1, 3) = 'Dec'; | SELECT COUNT(movie_title) FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(release_date, INSTR(release_date, '-') + 1, 3) = 'Dec' AND T2.director = 'Wolfgang Reitherman' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
book_publishing_company | What is the publisher's information of New Moon Books? | publisher name refers to pub_name; New Moon Books is a publisher name | SELECT T1.pr_info FROM pub_info AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'New Moon Books' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | How many incidents are considered "severe" in the IUCR classification? | severe refers to index_code = 'I'; incidents refers to iucr_no | SELECT COUNT(*) FROM IUCR WHERE index_code = 'I' | 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 Va... |
world | What are the districts that belong to the country with the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = ( SELECT Name FROM Country ORDER BY SurfaceArea DESC 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` INT... |
public_review_platform | List the active business ID and its stars of the businesses fall under the category of Pets. | active business refers to active = 'true'; 'Pets' is the category_name | SELECT T1.business_id, T1.stars FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T3.category_name LIKE 'Pets' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | Name all the authors for 'Sushi, Anyone?'. | most year to date sales refers to MAX(ytd_sales); on contract refers to contract = 1; name of author = au_fname, au_lname | SELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.title = 'Sushi, Anyone?' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | How many incidents have the general description of "ASSAULT" in the IUCR classification? | general description refers to primary_description; 'ASSAULT' is the primary_description; incidents refers to iucr_no | SELECT COUNT(*) FROM IUCR WHERE primary_description = 'ASSAULT' | 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 Va... |
world | How many languages are there in the country where Tocantins district belongs? | null | SELECT COUNT(DISTINCT T2.Language) FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.District = 'Tocantins' | 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` INT... |
sales | How many sales people managed to sell Headlights - Weatherproof? | Headlights - Weatherproof' is name of product | SELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Headlights - Weatherproof' | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | How many males from Belgium have participated in an Olympic Games? | males refer to gender = 'M'; Belgium refers to region_name = 'Belgium'; | SELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Belgium' AND T3.gender = 'M' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | What is the genre of the movie whose villain is Commander Rourke? | FALSE; | SELECT T2.genre FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T1.villian = 'Commander Rourke' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | How many Yelp_Business in Anthem are under the category of "Food"? | in Anthem refers to city = 'Anthem'; the category of "Food" refers to category_name = 'Food' | SELECT COUNT(T3.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name LIKE 'Food' AND T3.city LIKE 'Anthem' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | How many publishers are in the USA? | null | SELECT COUNT(pub_id) FROM publishers WHERE country = 'USA' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | What is the ward ID of the most crowded ward? | most crowded ward refers to Max(Population) | SELECT ward_no FROM Ward ORDER BY Population 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 Va... |
world | What is the average surface area of all countries? | average surface area = AVG(SurfaceArea); | SELECT AVG(SurfaceArea) FROM Country | 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` INT... |
sales | Identify the name of the sales person with employee ID 7. | name of the sales person = FirstName, MiddleInitial, LastName; | SELECT FirstName, MiddleInitial, LastName FROM Employees WHERE EmployeeID = 7 | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | What is the name of the competitor who has won the most medals? | name of the competitor refers to full_name; won the most medals refer to MAX(COUNT(medal_id)); | SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.id != 4 GROUP BY T1.full_name ORDER BY COUNT(T4.id) DESC LIMIT 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Please list the movies directed by Wolfgang Reitherman that can be watched by the general audience. | directed by Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; movies refer to movie_title; general audience refers to MPAA_rating = 'G'; | SELECT T1.movie_title FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.MPAA_rating = 'G' AND T2.director = 'Wolfgang Reitherman' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | Count the active businesses that has an attribute of Wi-Fi with medium review count. | active business refers to active = 'true'; 'Wi-Fi' is the attribute_name; medium review count refers to review_count = 'Medium' | SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Wi-Fi' AND T1.active LIKE 'TRUE' AND T1.review_count LIKE 'Medium' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | What is the highest level of job to get to for the employee who got hired the earliest? | highest job level refers to MAX(job_lvl); hired the earliest refers to MIN(hire_date) | SELECT T2.max_lvl FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id ORDER BY T1.hire_date LIMIT 1 | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | What is the full name of the alderman of ward no.21? | full name of alderman refers to alderman_first_name, alderman_last_name, alderman_name_suffix | SELECT alderman_first_name, alderman_last_name, alderman_name_suffix FROM Ward WHERE ward_no = 21 | 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 Va... |
world | How many countries have no GNP? | no GNP refers to GNP = 0; | SELECT COUNT(*) FROM Country WHERE GNP = 0 | 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` INT... |
sales | How many sales transactions were given by the customer named Joe L. Lopez? | sales transactions refers to SalesID; | SELECT COUNT(T1.SalesID) FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Joe' AND T2.MiddleInitial = 'L' AND T2.LastName = 'Lopez' | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | Which sport does the event "Shooting Women's Trap" belong to? | sport refers to sport_name; event "Shooting Women's Trap" refers to event_name = 'Shooting Women''s Trap'; | SELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T2.event_name LIKE 'Shooting Women%s Trap' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Give the name of the movie which the song "I Thought I Lost You" is associated with. | name of the movie refers to movie_title; | SELECT movie_title FROM characters WHERE song = 'I Thought I Lost You' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | In users yelping since 2011 to 2013, how many of them have high count of fans? | In users yelping since 2011 to 2013 refers to user_yelping_since_year > = 2011 AND user_yelping_since_year < 2014 | SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year BETWEEN 2011 AND 2013 AND user_fans LIKE 'High' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | List all titles which have year to date sales higher than the average order by pubisher name. | year to date sales refers to ytd_sales; average order = AVG(ytd_sales) | SELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.ytd_sales > ( SELECT AVG(ytd_sales) FROM titles ) | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | Among the crimes happened in the neighborhood called "Avalon Park", what is the percentage of crimes that happened inside the house? | "Avalon Park" is the neghborhood_name; happened inside the house refers to location_description = 'HOUSE'; percentage = Divide (Count(location_description = 'HOUSE'), Count(location_description)) * 100 | SELECT CAST(SUM(CASE WHEN T2.location_description = 'HOUSE' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.location_description) AS persent FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.... | 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 Va... |
world | What is the year of independence of Brunei? | year of independence refers to IndepYear; Brunei is a name of country; | SELECT IndepYear FROM Country WHERE Name = 'Brunei' | 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` INT... |
sales | How many sales people are handling all the customers? | null | SELECT COUNT(EmployeeID) FROM Employees | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | What was the medal that Coleen Dufresne got? | What medal refers to medal_name; | SELECT T4.medal_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Coleen Dufresne (-Stewner)' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
book_publishing_company | Please list the first names of the employees who work as Managing Editor. | Managing Editor is a job description which refers to job_desc | SELECT T1.fname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Managing Editor' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | List down the report number of crimes associated with the district commander named Jill M. Stevens. | report number refers report_no; 'Jill M. Stevens" is the commander | SELECT SUM(CASE WHEN T1.commander = 'Jill M. Stevens' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no | 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 Va... |
world | What country has the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT Name FROM Country ORDER BY SurfaceArea DESC 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` INT... |
olympics | For how many times has London held the Olympic games? | London refers to city_name = 'London'; how many times refer to COUNT(games_id); | SELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Who is the villain of the movie "Beauty and the Beast"? | Beauty and the Beast refers to movie_title = 'Beauty and the Beast'; | SELECT villian FROM characters WHERE movie_title = 'Beauty and the Beast' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | What is the category of the business with short review length and highest review stars within business ID from 5 t0 10? | short review length refers to review_length = 'Short'; highest review stars refers to Max(review_stars); business ID from 5 to 10 refers to business_id BETWEEN 5 AND 10; category of business refers to category_name | SELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Short' AND T2.business_id BETWEEN 5 AND 10 ORDER BY ... | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | What is the price of the book that sells the best? | qty is abbreviation for quantity; sells the best mean with the most sales quantity; MAX(qty) | SELECT T2.price FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id ORDER BY T1.qty DESC LIMIT 1 | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | What is the FBI description of the crime for report number 23778? | "23778" is the report_no; FBI description refers to description | SELECT T1.description FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.report_no = 23843 | 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 Va... |
world | Provide the district of the city with a population of 201843. | null | SELECT District FROM City WHERE population = 201843 | 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` INT... |
beer_factory | List out the root beers bought by Tim Ocel and Dawn Childress. | FALSE; | SELECT T2.RootBeerID FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T2.CustomerID = T1.CustomerID WHERE (T1.First = 'Tim' AND T1.Last = 'Ocel') OR (T1.First = 'Dawn' AND T1.Last = 'Childress') | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist... |
olympics | Tell the number of swimming related events. | swimming refers to sport_name = 'Swimming'; | SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Swimming' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Please list the villains of all the movies directed by Wolfgang Reitherman. | Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; | SELECT T2.villian FROM director AS T1 INNER JOIN characters AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Wolfgang Reitherman' AND T2.villian IS NOT NULL | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | How many active businesses are located at Phoenix, Arizona? | active business refers to active = 'true'; 'Phoenix' is the city | SELECT COUNT(business_id) FROM Business WHERE city LIKE 'Phoenix' AND active LIKE 'True' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
chicago_crime | Name the neighborhood of the community area in crime with report number 23843? | neighborhood refers to neighborhood_name; '23778' is the report_no | SELECT T3.neighborhood_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T2.report_no = 23778 | 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 Va... |
world | What city has the highest population? | highest population refers to MAX(Population); | SELECT Name FROM City ORDER BY Population DESC 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` INT... |
sales | Among all the customers who have purchased ML Bottom Bracket, identify the percentage of sales by Albert I. Ringer? | ML Bottom Bracket' is name of product; percentage = MULTIPLY(DIVIDE(SUM(CustomerID WHERE FirstName = 'Albert' AND MiddleInitial = 'I' AND LastName = 'Ringer'), COUNT(CustomerID)), 1.0); | SELECT CAST(SUM(IIF(T3.FirstName = 'Albert' AND T3.MiddleInitial = 'I' AND T3.LastName = 'Ringer', 1, 0)) AS REAL) * 100 / COUNT(T2.CustomerID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T1.Name = 'ML Bottom Bracket' | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | For Peter Kohnke, show the name of his/her region. | name of his/her region refers to region_name; | SELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Peter Kohnke' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
public_review_platform | Among the active businesses located at Mesa, AZ, list the category and attributes of business with a low review count. | active business refers to active = 'true': 'Mesa' is the name of city; 'AZ' is the state; low review count refers to review_count = 'Low'; category refers to category_name | SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T1.review_count = 'Low' AND T1.city = 'Mesa' AND T1.active = 'true' AND T1.state = 'AZ' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | Among the stores that have ordered the book "Life Without Fear", how many of them are located in Massachusetts? | Massachusetts is a state | SELECT COUNT(T1.stor_id) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T2.state = 'Massachusetts' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | What is the neighborhood name in the community area of Lake View? | "Lake View" is the community_area_name | SELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name = 'Lake View' | 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 Va... |
world | What is the district of Zaanstad? | Zaanstad is a name of city; | SELECT District FROM City WHERE name = 'Zaanstad' | 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` INT... |
sales | Find the number of customers handled by each of the sales people. | null | SELECT COUNT(CustomerID) FROM Sales GROUP BY SalesPersonID | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | How many persons in total have participated in 12 meter Mixed Sailing competitions? | 12 meter Mixed Sailing competitions refer to event_name = 'Sailing Mixed 12 metres'; | SELECT COUNT(T1.competitor_id) FROM competitor_event AS T1 INNER JOIN event AS T2 ON T1.event_id = T2.id INNER JOIN sport AS T3 ON T2.sport_id = T3.id WHERE T2.event_name = 'Sailing Mixed 12 metres' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Which song is associated with the most popular Disney movie in 1970s? | the most popular movie refers to movie_title where MAX(total_gross); in 1970s refers to (cast(SUBSTR(release_date, instr(release_date, ', ') + 1) as int) between 1970 and 1979); | SELECT T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE CAST(SUBSTR(T1.release_date, INSTR(T1.release_date, ', ') + 1) AS int) BETWEEN 1970 AND 1979 ORDER BY CAST(REPLACE(SUBSTR(T1.total_gross, 2), ',', '') AS float) DESC LIMIT 1 | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | In businesses with a category of mexican, how many of them has a star rating below 4? | category of mexican refers to category_name = 'Mexican'; star rating below 4 refers to stars < 4 | SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars < 4 AND T3.category_name LIKE 'Mexican' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | In which city is the store with the highest total sales quantity located? | qty is abbreviation for quantity; highest sales quantity refers to MAX(qty) | SELECT T2.city FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id GROUP BY T2.city ORDER BY SUM(T1.qty) DESC LIMIT 1 | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | List down the district's commander associated with the crime that happened at the yard and has a beat of 532. | beat of 532 refers to beat = 532; happened in the Yard refers to location_description = 'YARD'; district commander refers to commander | SELECT T2.address, T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.location_description = 'YARD' AND T1.beat = 532 | 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 Va... |
world | What is the GNP growth rate by the country of Shanghai? | GNP growth rate = DIVIDE(SUBTRACT(GNP, GNPOld), GNPOld); Shanghai is a name of city; | SELECT CAST((T1.GNP - T1.GNPOld) AS REAL) / T1.GNPOld FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Shanghai' | 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` INT... |
sales | Indicate the quantity of Blade products sold. | Blade' is name of product; | SELECT DISTINCT T2.Quantity FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Blade' | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | What is the name of all the sports Chin Eei Hui has competed in? | name of the sport refers to sport_name; | SELECT DISTINCT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T5.full_name = 'Chin Eei Hui' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Which character is the villain of the most popular movie? | the most popular movie refers to movie_title where MAX(total_gross); | SELECT T2.villian FROM `movies_total_gross` AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title ORDER BY T1.total_gross DESC LIMIT 1 | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
book_publishing_company | Please list the stores that ordered the book "Life Without Fear". | store name refers to stor_name | SELECT T2.stor_name FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T3.title = 'Life Without Fear' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | Provide at least 5 ward office addresses associated with the crimes that happened in the community of Montclare. | "Montclare" is the community_area_name | SELECT T3.ward_office_address FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Ward AS T3 ON T2.ward_no = T3.ward_no WHERE T1.community_area_name = 'Montclare' GROUP BY T3.ward_office_address LIMIT 5 | 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 Va... |
world | What is the average life expentancy of countries that speak Arabic? | average life expectancy = AVG(LifeExpectancy); speak Arabic refers to `Language` = 'Arabic'; | SELECT AVG(T1.LifeExpectancy) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic' | 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` INT... |
sales | Name the most expensive and the least expensive products available, excluding free gifts. | most expensive product refers to MAX(Price); least expensive product refers to MIN(Price); excluding free gifts refers to not including Price = 0; | SELECT Name FROM Products WHERE Price IN (( SELECT MAX(Price) FROM Products ), ( SELECT MIN(Price) FROM Products )) | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
disney | Who is the voice actor of the hero character from the movie The Little Mermaid? | The Little Mermaid refers to movie_title = 'The Little Mermaid'; | SELECT T2.`voice-actor` FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T1.movie_title = 'The Little Mermaid' AND T2.character = T1.hero | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | What is the closing and opening time of businesses located at Gilbert with highest star rating? | "Gilbert" is the name of city; highest star rating refers to Max(stars) | SELECT T2.closing_time, T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Gilbert' ORDER BY T1.stars DESC LIMIT 1 | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | What is the publisher that has published the most expensive book? | most expensive book refers to MAX(price) | SELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id ORDER BY T1.price DESC LIMIT 1 | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | Give the FBI code for the crime described by "The killing of one human being by another." | "The killing of one human being by another" is the description; FBI code refers to fbi_code_no | SELECT fbi_code_no FROM FBI_Code WHERE description = 'The killing of one human being by another.' | 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 Va... |
world | What are the cities for country called "´Uman" in local name. | null | SELECT T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.LocalName = '´Uman' | 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` INT... |
sales | What is the name of the product that is most sold by sale person id 20? | most sold refers to MAX(Quantity); | SELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.SalesPersonID = 20 ORDER BY T2.Quantity DESC LIMIT 1 | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | What is the name of the oldest person who participated in the Olympic Games? | the oldest person refers to person_id where MAX(age); name refers to full_name; | SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age DESC LIMIT 1 | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
public_review_platform | Among the businesses in Chandler, list the attribute of the business with a low review count. | in Chandler refers to city = 'Chandler'; attribute refers to attribute_name | SELECT DISTINCT T3.attribute_id, T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.attribute_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.review_count = 'Low' AND T1.city = 'Chandler' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
chicago_crime | What is the beat and location description of the case JB112212? | case JB112212 refers to case_number = 'JB112212' | SELECT beat, location_description FROM Crime WHERE case_number = 'JB112212' | 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 Va... |
world | List down all cities of China. | China is a name of country; | SELECT T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = 'China' | 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` INT... |
sales | How many customers have the first name Abigail? | null | SELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Abigail' | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | Which city was the host of 1936 Winter Olympic Games? | Which city refers to city_name; 1936 Winter Olympic refers to games_name = '1936 Winter'; | SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1936 Winter' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Who is the voice actor of the character "Binkie Muddlefoot"? | FALSE; | SELECT `voice-actor` FROM `voice-actors` WHERE character = 'Binkie Muddlefoot' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | Find the location of businesses that has business hours from 9 am to 9 pm every Saturday. | 9 am refers to opening_time = '9AM'; 9 pm refers to closing_time = '9PM'; every Saturday refers to day_of_week = 'Saturday'; location refers to city | SELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time LIKE '9PM' AND T2.opening_time LIKE '9AM' AND T3.day_of_week LIKE 'Saturday' GROUP BY T1.city | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | Please give more detailed information about the first three books that sell the best. | qty is abbreviation for quantity; sells the best mean with the most sales quantity; MAX(qty) | SELECT T1.notes FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id ORDER BY T2.qty DESC LIMIT 3 | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | Provide the ward number with the highest population. | highest population refers to Max(Population); ward number refers to ward_no | SELECT ward_no FROM Ward ORDER BY Population 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 Va... |
world | How many countries have a life expectancy of 75.1? | null | SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.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` INT... |
sales | List the full name of the customer who purchased the most quantity of products. | full name of the customer = FirstName, LastName; most quantity refers to MAX(Quantity); | SELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID ORDER BY T2.Quantity DESC LIMIT 1 | CREATE TABLE Sales
(
CustomerID INTEGER not null, --
SalesID INTEGER not null primary key,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
foreign key (SalesPersonID) references Employees (EmployeeID) on update cascade on delete cascade,
SalesPersonID INTEGER no... |
olympics | In which cities beginning with the letter M have the Olympic Games been held? | cities beginning with the letter M refer to city_name LIKE 'M%'; | SELECT city_name FROM city WHERE city_name LIKE 'M%' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Who is the director of the adventure movie which was released on 2007/3/30? | released on 2007/3/30 refers to release_date = 'Mar 30, 2007'; adventure movie refers to genre = 'Adventure' ; | SELECT T1.director FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.name WHERE T2.genre = 'Adventure' AND T2.release_date = 'Mar 30, 2007' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
book_publishing_company | In which country is the publisher of the book "Life Without Fear" located? | Life Without Fear is book title | SELECT T2.country FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.title = 'Life Without Fear' | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | What is the percentage of crime cases that have been classified as "drug abuse" by the FBI and happened on the street? | "Drug Abuse" is the title of crime; happened on the street refers to location_description = 'STREET'; percentage = Divide (Count(fbi_code_no where location_description = 'STREET'), Count(fbi_code_no)) * 100 | SELECT CAST(SUM(CASE WHEN T2.title = 'Drug Abuse' AND T1.location_description = 'STREET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.fbi_code_no) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no | 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 Va... |
world | Which country has the smallest surface area and the most crowded city? | smallest surface area refers to MIN(smallest surface area); most crowded city refers to MAX(Population); | SELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC, T2.SurfaceArea DESC 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` INT... |
beer_factory | What is the credit card type used by Kenneth Walton? | FALSE; | SELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Kenneth' AND T1.Last = 'Walton' | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist... |
olympics | Please list the names of the Olympic games that were held in London. | held in London refers to city_name = 'London'; | SELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London' | CREATE TABLE event
(
event_name TEXT default NULL, --
sport_id INTEGER default NULL, --
foreign key (sport_id) references sport(id),
id INTEGER not null primary key,
);
CREATE TABLE sport
(
id INTEGER not null primary key,
sport_name TEXT default NULL, --
);
CREATE TABLE city
(
city_name TEXT default NUL... |
disney | Who is the hero character of the movie whose total gross was $222,527,828? | FALSE; | SELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.total_gross = '$222,527,828' | CREATE TABLE movies_total_gross
(
MPAA_rating TEXT, -- Example Values: `G`, ``, `Not Rated`, `PG`, `R` | Value Statics: Total count 579 - Distinct count 6 - Null count 0
release_date TEXT, --
total_gross TEXT, --
foreign key (movie_title) references characters(movie_title),
movie_title TEXT, --
genre TEX... |
public_review_platform | How many Yelp_Businesses do not provide alcohol? | do not provide alcohol refers to attribute_name = 'Alcohol'and attribute_value = 'none'
| SELECT COUNT(T1.attribute_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Alcohol' AND T2.attribute_value LIKE 'none' | CREATE TABLE Attributes
(
attribute_name TEXT, --
attribute_id INTEGER constraint Attributes_pk primary key,
);
CREATE TABLE Elite
(
year_id INTEGER constraint Elite_Years_year_id_fk references Years, -- Example Values: `2010`, `2011`, `2012`, `2013`, `2014` | Value Statics: Total count 16366 - Distinct count 10 ... |
book_publishing_company | Among the publishers in the USA, how many of them have published books that are over $15? | are over $15 refers to price>15 | SELECT COUNT(DISTINCT T1.pub_id) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA' AND T1.price > 15 | CREATE TABLE jobs
(
max_lvl INTEGER not null, -- Example Values: `10`, `250`, `225`, `200`, `175` | Value Statics: Total count 14 - Distinct count 8 - Null count 0
job_desc TEXT not null, -- Example Values: `New Hire - Job not specified`, `Chief Executive Officer`, `Business Operations Manager`, `Chief Financial O... |
chicago_crime | At which district did the multiple homicide case number JB120039 occurred? | multiple homicide refers to Count(case_number) > 1; district refers to district_name | SELECT T1.district_no, T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB120039' GROUP BY T1.district_no, T1.district_name | 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 Va... |
world | Within the 5 most crowded cities in the world, which country has the most languages used? | most crowded cities refers to MAX(Population); has the most languages used refers to MAX(COUNT(Language)); | SELECT Name FROM ( SELECT T1.Name, T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode GROUP BY T1.Name, T1.Population, T2.Language ORDER BY T1.Population DESC ) AS T3 GROUP BY t3.Name ORDER BY COUNT(Language) DESC 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` INT... |
beer_factory | What is the best seller root beer brand and what is the average star rating for this root beer? | best seller root beer refers to MAX(COUNT(BrandID)); average star rating = AVG(StarRating); | SELECT T1.BrandID, AVG(T1.StarRating) FROM rootbeerreview AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID GROUP BY T3.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1 | CREATE TABLE rootbeerbrand
(
Website TEXT, --
State TEXT, -- Example Values: `CA`, `MA`, `LA`, `WA`, `QLD` | Value Statics: Total count 23 - Distinct count 14 - Null count 1
Twitter TEXT, -- Example Values: `https://twitter.com/ilovedads`, `https://twitter.com/1919rootbeer` | Value Statics: Total count 2 - Dist... |
chicago_crime | What was the major type of crime that happened in the Rogers Park community area? | "Rogers Park" is the community_area_name; major type of crime refers to title | SELECT T1.fbi_code_no, T1.title FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.community_area_name = 'Rogers Park' GROUP BY T1.fbi_code_no, T1.title | 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 Va... |
world | What is the GNP of the least crowded city in the world? | least crowded city refers to MIN(Population); | SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.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` INT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.