db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
world_development_indicators | In 1960, what is largest population for country with upper middle income? | in 1960 refers to year = '1960'; the largest population refers to max(value where IndicatorName = 'Population, total'); country with upper middle income refers to incomegroup = 'Upper middle income' | SELECT MAX(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Upper middle income' AND T2.Year = 1960 AND T2.IndicatorName = 'Population, total' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Name the country in which the topic is about Poverty: Shared Prosperity. Indicate the long name of the country. | null | SELECT DISTINCT T1.LongName FROM Country AS T1 INNER JOIN footnotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.Topic = 'Poverty: Shared prosperity' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Please calculate the percentage of Sub-Saharan African countries which are in the Special trade system. | Sub-Saharan African is the name of the region; SystemOfTrade = 'Special trade system'; countries refer to CountryCode; DIVIDE(COUNT (CountryCode where SystemOfTrade = 'Special trade system' and Region = 'Sub-Saharan Africa'), COUNT(CountryCode where Region = 'Sub-Saharan Africa')) as percentage; | SELECT CAST(SUM(CASE WHEN Region = 'Sub-Saharan Africa' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE SystemOfTrade = 'Special trade system' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What country in the region of Sub-Saharan Africa has a series code of "SP.DYN.AMRT.FE"? Indicate the long name of the country | null | SELECT DISTINCT T3.LongName FROM SeriesNotes AS T1 INNER JOIN CountryNotes AS T2 ON T1.SeriesCode = T2.Seriescode INNER JOIN Country AS T3 ON T2.Countrycode = T3.CountryCode WHERE T3.Region = 'Sub-Saharan Africa' AND T1.SeriesCode = 'SP.DYN.AMRT.FE' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What upper middle income country under East Asia & Pacific region which covers the topic about Social Protection & Labor: Migration
? Indicate the short name of the said country. | upper middle income country refers to incomegroup = 'Upper middle income' | SELECT DISTINCT T1.ShortName FROM Country AS T1 INNER JOIN footnotes AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T1.IncomeGroup = 'Upper middle income' AND T1.Region = 'East Asia & Pacific' AND T3.Topic = 'Social Protection & Labor: Migration' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What country has the latest trade data with a series code of "SP.DYN.CDRT.IN
"? List the table name of the country. | the latest trade data refers to LatestTradeData = '2013'; with a series code of "SP.DYN.CDRT.IN
" refers to indicatorcode = 'SP.DYN.CDRT.IN' | SELECT DISTINCT T1.TableName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.LatestTradeData = 2013 AND T2.IndicatorCode = 'SP.DYN.CDRT.IN' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What South Asian nations have low incomes? Please include the entire names of the nations in your answer. | South Asian nations refers to region = 'South Asia'; have low incomes refers to incomegroup = 'Low income'; the entire names refers to longname | SELECT LongName FROM Country WHERE IncomeGroup = 'Low income' AND Region = 'South Asia' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | How many inspections were done in January 2011? | in January 2011 refers to inspection_date like '2011-01%' | SELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y-%m', inspection_date) = '2011-01' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | List the sources for the Net Migration in South American countries in 2002. | South American is the name of the region; Year contains '2002'; sources refer to Description; IndicatorName = 'Net migration'; | SELECT T2.Source FROM CountryNotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode INNER JOIN SeriesNotes AS T4 ON T2.SeriesCode = T4.Seriescode WHERE T4.Year LIKE '%2002%' AND T2.IndicatorName = 'Net migration' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Which country has had the highest proportion of CO2 emissions from transport? | the highest proportion of CO2 emissions from transport refers to max(value where indicatorname = 'CO2 emissions from transport (% of total fuel combustion)') | SELECT CountryName FROM Indicators WHERE IndicatorName LIKE 'CO2 emissions FROM transport%' ORDER BY Value DESC LIMIT 1 | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | Provide the categories and fines for the inspections done by Lisa Tillman in January 2014. | in January 2014 refers to inspection_date like '2014-01%' | SELECT DISTINCT T4.category, T3.fine FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T1.inspection_id = T3.inspection_id INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND strftime(... | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
movie_platform | How many users who created a list in the February of 2016 were eligible for trial when they created the list? Indicate the user id of the user who has the most number of followers in his list in February of 2016. | created a list in the February of 2016 refer to list_creation_date_utc BETWEEN 2/1/2016 and 2/29/2016; eligible for trial refers to user_eligible_for_trial = 1;
| SELECT T1.list_followers FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T1.list_id = T2.list_id WHERE T2.list_creation_date_utc BETWEEN '2016-02-01' AND '2016-02-29' AND T2.user_eligible_for_trial = 1 | 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 S... |
world_development_indicators | How many countries are using the same type of currency? Please list the short names of any 3 countries. | any 3 countries refers to count(shortname)>3 | SELECT ShortName FROM country WHERE currencyunit = 'U.S. dollar' LIMIT 3 | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Please provide full name of any two countries using special trade system. | full name refers to longname; using special trade system refers to systemoftrade = 'Special trade system' | SELECT LongName FROM Country WHERE SystemOfTrade = 'Special trade system' LIMIT 2 | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What are the subjects of series that have a restricted type of license? | subjects refers to topic; a restricted type of license refers to licenseType = 'Restricted' | SELECT DISTINCT Topic FROM Series WHERE LicenseType = 'Restricted' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | How many users, who were a paying subscriber when they rated the movie, gave the movie that was released in 1924 and directed by Erich von Stroheim a rating score of 5? | Directed by Buster Keaton refers to director_name; released in 1924 refers to movie_release_year = 1924; paying subscriber refers to user_has_payment_method = 1
| SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = 1924 AND T1.director_name = 'Erich von Stroheim' AND T2.rating_score = 5 AND T2.user_has_payment_method = 1 | 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 S... |
world_development_indicators | Which European countries had the highest private expenditure on health in 2005? List the top ten countries in descending order and find the source of the data. | Year = 2005; private expenditure on health refers to IndicatorName = 'Out-of-pocket health expenditure (% of private expenditure on health)'; the highest refers to MAX(Value); source refers to Description; | SELECT DISTINCT T1.CountryCode, T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T1.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Out-of-pocket health expenditure (% of private expenditure on health)' AND T2.Value > 0 AND T2.year ... | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What is the percentage of countries in the Middle East and North Africa that have finished reporting on their real external debt? | percentage = divide(count(countrycode where ExternalDebtReportingStatus = 'Actual' ), count(countrycode))*100%; in the Middle East and North Africa refers to region = 'Middle East & North Africa'; have finished reporting on their real external debt refers to ExternalDebtReportingStatus = 'Actual' | SELECT CAST(SUM(CASE WHEN ExternalDebtReportingStatus = 'Actual' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE region = 'Middle East & North Africa' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Which country has the lowest percentage of arable land? | which country refers to countryname; the lowest percentage of arable land refers to min(value where indicatorname = 'Arable land (% of land area)') | SELECT CountryName FROM Indicators WHERE IndicatorName LIKE 'Arable land (% of land area)' ORDER BY Value DESC LIMIT 1 | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Which countries in the upper middle income category still have unfinished external debt reporting? Please provide the country codes in your answer. | in the upper middle income category refers to incomegroup = 'Upper middle income'; still have unfinished external debt reporting refers to ExternalDebtReportingStatus = 'Preliminary' | SELECT CountryCode FROM Country WHERE IncomeGroup = 'Upper middle income' AND ExternalDebtReportingStatus = 'Preliminary' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | When did the creator of the list "250 Favourite Films" last updated a movie list? | 250 Favourite Films refers to list_title; last update refers to list_update_date_utc; | SELECT T2.list_update_date_utc FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films' ORDER BY T2.list_update_date_utc DESC LIMIT 1 | 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 S... |
world_development_indicators | Find the countries in south Asia which are in the low-income group. What is the source of their recent income and expenditure data? List it alongside the table name of the countries. | South Asia is the name of the region; IncomeGroup = 'Low income'; | SELECT TableName, SourceOfMostRecentIncomeAndExpenditureData FROM Country WHERE Region = 'South Asia' AND IncomeGroup = 'Low income' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | What's the description of user 85981819's movie list with the most followers? | user 85981819 refers to user_id = 85981819; most followers refers to Max(list_followers); description refers to list_descriptions; | SELECT T1.list_description FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 ORDER BY T1.list_followers DESC LIMIT 1 | 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 S... |
food_inspection_2 | Provide the names and inspection results of the facilities located in Burnham. | names refers to dba_name; inspection result refers to results; in Burnham refers to city = 'BURNHAM' | SELECT DISTINCT T1.dba_name, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'BURNHAM' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
movie_platform | How many movies directed by Francis Ford Coppola have a popularity of more than 1,000? Indicate what is the highest amount of likes that each critic per movie has received, if there's any. | Francis Ford Coppola refers to director_name; popularity of more than 1,000 refers to movie_popularity >1000;highest amount of likes that each critic per movie has received refers to MAX(critic_likes) | SELECT COUNT(T2.movie_title), T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Francis Ford Coppola' AND T2.movie_popularity > 1000 | 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 S... |
world_development_indicators | What proportion of Sub-Saharan Africa's countries have lower middle incomes? | proportion = divide(count(countrycode where incomegroup = 'Low income'), count(countrycode))*100%; Sub-Saharan Africa's countries refers to region = 'Sub-Saharan Africa'; have lower middle incomes refers to incomegroup = 'Low income' | SELECT SUM(CASE WHEN IncomeGroup = 'Lower middle income' THEN 1 ELSE 0 END) * 100.0 / COUNT(CountryCode) persentage FROM Country WHERE Region = 'Sub-Saharan Africa' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | What is the percentage of restaurants that paid a fine of 250 among all establishments? | a fine of 250 refers to fine = 250; percentage = divide(sum(license_no where fine = 250), count(license_no)) * 100% | SELECT CAST(COUNT(CASE WHEN T3.fine = 250 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.facility_type = 'Restaurant' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | Which form of government has more countries that have completed the actual external debt reporting between the two types of government accounting concepts, budgetary central government vs. consolidated central government? | have completed the actual external debt reporting refers to ExternalDebtReportingStatus = 'Actual' | SELECT SUM(CASE WHEN GovernmentAccountingConcept = 'Budgetary central government' THEN 1 ELSE 0 END), SUM(CASE WHEN GovernmentAccountingConcept = 'Consolidated central government' THEN 1 ELSE 0 END) central_nums FROM country WHERE ExternalDebtReportingStatus = 'Actual' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Please list the full names of any three countries that have their series code with a description of UN Energy Statistics (2014). | full name refers to longname | SELECT DISTINCT T2.LongName FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Description = 'Sources: UN Energy Statistics (2014)' LIMIT 3 | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | How many nations in East Asia and the Pacific have completed their external debt reporting on time? | in East Asia and the Pacific refers to region = 'East Asia & Pacific'; have completed their external debt reporting on time refers to ExternalDebtReportingStatus = 'Estimate' | SELECT COUNT(CountryCode) FROM Country WHERE Region = 'East Asia & Pacific' AND ExternalDebtReportingStatus = 'Estimate' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | What's the avatar image of the user who created the movie list "250 Favourite Films"? | 250 Favourite Films refers to list_title; avatar image refers to user_avatar_image_url; | SELECT T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films' | 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 S... |
movie_platform | Which year has the least number of movies that was released and what is the title of the movie in that year that has the highest number of rating score of 1? | least number of movies refers to MIN(movie_release_year); highest rating score refers to MAX(SUM(movie_id) where rating_score = '1')
| SELECT DISTINCT T1.movie_release_year, T1.movie_title FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = ( SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1 ) AND T2.rating_score = 1 | 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 S... |
food_inspection_2 | Among the employees that receive a salary between $75000 to $85000, what is the difference between the number of employees which undergone an inspection that fined 100 and 500? | salary between $75000 and $85000 refers to 75000 < = salary < = 80000; difference = subtract(count(inspection_id where fine = 100), count(inspection_id where fine = 500)) where 75000 < = salary < = 80000 | SELECT SUM(CASE WHEN T3.fine = 100 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.fine = 500 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.salary BETWEEN 75000 AND 80000 | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | What was the deposit interest rate in the Commonwealth of Australia in 1979 in percentage? | deposit interest rate refers to value where IndicatorName = 'Deposit interest rate (%)'; in the Commonwealth of Australia refers to LongName = 'Commonwealth of Australia'; in 1979 refers to Year = '1979' | SELECT T1.Value FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.LongName = 'Commonwealth of Australia' AND T1.IndicatorName = 'Deposit interest rate (%)' AND T1.Year = 1979 | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | Please provide the subject of series of Austria. | subject refers to topic; Austria refers to shortname = 'Austria' | SELECT DISTINCT T3.Topic FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode INNER JOIN Series AS T3 ON T1.Seriescode = T3.SeriesCode WHERE T2.ShortName = 'Austria' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | Which facilities were inspected by Sarah Lindsey on 20th November 2012? | facility name refers to dba_name; on 20th November 2012 refers to inspection_date = '2012-11-20' | SELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T2.inspection_date = '2012-11-20' AND T3.first_name = 'Sarah' AND T3.last_name = 'Lindsey' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | From 1961 to 1980, what was the highest percentage of land used for agriculture in the Republic of Benin? | from 1961 to 1980 refers to year between '1961' and '1980'; the highest percentage of land used for agriculture refers to max(value where IndicatorName = 'Agricultural land (% of land area)'); in the Republic of Benin refers to longname = 'Republic of Benin' | SELECT MAX(T1.Value) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year >= 1961 AND T1.Year < 1981 AND T1.IndicatorName LIKE 'Agricultural land (% of land area)' AND T2.LongName = 'Republic of Benin' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | Among the lists created by user 4208563, which one has the highest number of followers? Indicate how many followers it has and whether the user was a subscriber or not when he created the list. | User 4208563 refers to user_id;highest number of followers refers to MAX(list_followers); user_subscriber = 1 means that the user was a subscriber when he created the list; user_subscriber = 0 means the user was not a subscriber when he created the list (to replace) | SELECT T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563 ORDER BY T1.list_followers DESC LIMIT 1 | 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 S... |
world_development_indicators | How many countries are having their country's footnotes described as "unspecified"? Please provide the full names of any three of those countries. | described as "unspecified" refers to Description = 'Not specified'; full names refers to LongName | SELECT COUNT(DISTINCT T1.CountryCode) FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' UNION SELECT T1.LongName FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description ... | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | What is the percentage of establishments with a risk level of 1 among all of the establishments that passed the inspection? | a risk level of 1 refers to risk_level = 1; pass the inspection refers to results = 'Pass'; percentage = divide(sum(license_no where risk_level = 1), count(license_no)) * 100% where results = 'Pass' | SELECT CAST(COUNT(CASE WHEN T1.risk_level = 1 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results = 'Pass' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | What is the series code for Germany and what is its description? | Germany refers to shortname = 'Germany' | SELECT T1.Seriescode, T1.Description FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.ShortName = 'Germany' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What portion of the nations in Latin America and the Caribbean had more than 50% of their land used for agriculture in 1961? | portion = divide(count(CountryName where Year = '1961' and Value>50), count(CountryName))*100%; nations in Latin America and the Caribbean refers to region = 'Latin America & Caribbean'; more than 50% of their land used for agriculture refers to value where indicatorname = 'Agricultural land (% of land area)'>50; in 1... | SELECT CAST(SUM(CASE WHEN T1.Value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.CountryCode) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year = 1961 AND T2.Region = 'Latin America & Caribbean' AND indicatorname = 'Agricultural land (% of land area)' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | How many users rated the movie "The Magnificent Ambersons" gave a rating score of no more than 2? List all the URL to the rating on Mubi. | The Magnificent Ambersons refers to movie_title; rating score of no more than 2 refers to rating_score<2; URL to rating refers to rating_url | SELECT COUNT(T2.user_id), T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'The Magnificent Ambersons' AND T2.rating_score <= 2 | 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 S... |
world_development_indicators | What is the subject of the series SP.DYN.AMRT.MA and what does it pertain to? | subject refers to topic; pertain to refers to Description | SELECT DISTINCT T1.Topic, T2.Description FROM Series AS T1 INNER JOIN SeriesNotes AS T2 ON T1.SeriesCode = T2.Seriescode WHERE T1.SeriesCode = 'SP.DYN.AMRT.MA' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
movie_platform | What is the average number of movies added to the lists of user 8516503? Give the user profile image URL on Mubi. | user profile image URL refers to user_avatar_image_url; user 8516503 refers to user_id; Average refers to AVG(list_movie_number where user_id = 8516503)
| SELECT AVG(T1.list_movie_number), T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T2.user_id = 8516503 | 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 S... |
world_development_indicators | Which nation completed its external debt reporting in 1980 and had a Land under cereal production value of 3018500? | completed its external debt reporting refers to ExternalDebtReportingStatus = 'Actual'; in 1980 refers to year = 1980; Land under cereal production value of 3018500 refers to value = 3018500 | SELECT T2.CountryCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName LIKE 'Land under cereal production%' AND T1.Value = 3018500 AND T1.Year = 1980 AND T2.ExternalDebtReportingStatus = 'Actual' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What is the indicator code for Mobile Cellular Subscriptions of Brazil? | Mobile Cellular Subscriptions refers to indicatorname = 'Mobile cellular subscriptions'; Brazil refers to CountryName = 'Brazil' | SELECT DISTINCT IndicatorCode FROM Indicators WHERE CountryName = 'Brazil' AND IndicatorName = 'Mobile cellular subscriptions' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | How many inspections were done under the display of inspection report summary category? | under the display of inspection report summary category refers to category = 'Display of Inspection Report Summary' | SELECT COUNT(T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Display of Inspection Report Summary' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | What are the sources for the data of children who finished primary school education in North American countries? | North American is the name of the region; sources refer to Description; children who finished primary school education refer to IndicatorName = 'Out-of-school children of primary school age, both sexes (number)'; | SELECT DISTINCT T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T1.Region = 'North America' AND T2.IndicatorName = 'Out-of-school children of primary school age, both sexes (number)' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
world_development_indicators | What are the full names of the countries in South Asia that belongs to the low income group? | full name refers to longname; the countries in South Asia refer to region = 'South Asia'; belongs to the low income group refers to incomegroup = 'Low income' | SELECT LongName FROM Country WHERE IncomeGroup = 'Low income' AND Region = 'South Asia' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
food_inspection_2 | Compare the number of inspections under toxic items and no-smoking regulations. | under toxic items refers to category = 'Toxic Items'; no-smoking regulations refers to category = 'No Smoking Regulations' | SELECT COUNT(CASE WHEN T2.category = 'Toxic Items' THEN T1.inspection_id END) AS Tox_nums , COUNT(CASE WHEN T2.category = 'No Smoking Regulations' THEN T1.inspection_id END) AS NosmoNums FROM violation AS T1 INNER JOIN inspection_point AS T2 ON T1.point_id = T2.point_id | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
food_inspection_2 | Where does the employee named "Standard Murray" live? | address refers to address, city, state | SELECT address, city, state FROM employee WHERE first_name = 'Standard' AND last_name = 'Murray' | CREATE TABLE inspection
(
followup_to INTEGER, --
foreign key (employee_id) references employee(employee_id),
employee_id INTEGER, --
license_no INTEGER, --
foreign key (followup_to) references inspection(inspection_id),
foreign key (license_no) references establishment(license_no),
inspection_id INTEGER p... |
world_development_indicators | How many countries in Europe & Central Asia uses Danish krone as its currency? List the full names of those coutnries. | countries in Europe & Central Asia refer to region = 'Europe & Central Asia'; uses Danish krone refers to currencyunit = 'Danish krone'; full name refers to longname | SELECT COUNT(longname) FROM country WHERE region = 'Europe & Central Asia' AND currencyunit = 'Danish krone' UNION SELECT longname FROM country WHERE currencyunit = 'Danish krone' AND region = 'Europe & Central Asia' | CREATE TABLE CountryNotes
(
primary key (Countrycode, Seriescode),
FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode),
Seriescode TEXT NOT NULL, --
Countrycode TEXT NOT NULL, --
Description TEXT, --
FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode),
);
CREATE TABLE Series
(
BasePeriod TEXT, --... |
chicago_crime | What is the weekly average number of fraud incidents that were reported in January 2018? Provide the description of the location where the majority of fraud incidents occurred in the said month. | fraud incident refers to title = 'Fraud'; reported in January 2018 refers to Substr(date, 1, 1) = '1' AND Substr(date, 5, 4) = '2018'; description of location refers to location_description; weekly average refers to Divide (Count(report_no), 4); majority of incidents occurred refers to Max(Count(location_description)) | SELECT CAST(COUNT(T1.fbi_code_no) AS REAL) / 4 FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' | 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... |
works_cycles | Which sales areas are expected to have the highest yearly sales quota? | highest yearly sales quota refers to Max(SalesQuota); | SELECT T2.Name FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID GROUP BY T1.TerritoryID ORDER BY SUM(T1.SalesQuota) DESC LIMIT 1 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | Calculate the average of the total ordered quantity of products purchased whose shipping method was Cargo Transport 5. | shipping method was Cargo Transport 5 refers to Name = 'Cargo Transport 5'; average = DIVIDE(SUM(OrderQty where Name = 'Cargo Transport 5'), COUNT(ShipMethodID)) | SELECT CAST(SUM(IIF(T1.ShipMethodID = 5, T3.OrderQty, 0)) AS REAL) / COUNT(T3.ProductID) FROM ShipMethod AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.ShipMethodID = T2.ShipMethodID INNER JOIN PurchaseOrderDetail AS T3 ON T2.PurchaseOrderID = T3.PurchaseOrderID | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
regional_sales | Lists the name of the product and customer who placed an order on 10/21/18 and it was delivered on 11/21/19. | ordered on 10/21/18 refers to OrderDate = '10/21/18'; delivered on 11/21/19 refers to DeliveryDate = '11/21/19'; name of product refers to Product Name | SELECT T3.`Product Name`, T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products AS T3 ON T3.ProductID = T2._ProductID WHERE T2.OrderDate = '10/21/18' AND T2.DeliveryDate = '11/21/19' | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
chicago_crime | How many crime against society were reported in Englewood? | "Englewood" is the community_area_name; 'Society' is the crime_against | SELECT SUM(CASE WHEN T3.community_area_name = 'Englewood' THEN 1 ELSE 0 END) 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 T1.crime_against = 'Society' | 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... |
works_cycles | What bike subcategories are there? | bikes is product category | SELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN ProductCategory AS T2 ON T1.ProductCategoryID = T2.ProductCategoryID WHERE T2.name = 'Bikes' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | What is the percentage of the total products ordered were not rejected by Drill size? | rejected quantity refers to ScrappedQty; rejected by Drill size refers to Name in ('Drill size too small','Drill size too large'); percentage = DIVIDE(SUM(ScrappedQty) where Name in('Drill size too small','Drill size too large'), OrderQty) | SELECT CAST(SUM(CASE WHEN T2.VacationHours > 20 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.SickLeaveHours > 10 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
simpson_episodes | What are the titles of the episodes that have received more 7-star votes than the season average? | episodes that have received more 7-star votes than the season average refers to votes > DIVIDE(SUM(votes), COUNT(stars = 7)) | SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 AND T2.votes > 0.7 * ( SELECT CAST(COUNT(votes) AS REAL) / COUNT(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM Vote ); | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
regional_sales | What are the names of the sales teams that have served to customer Apotheca, Ltd? | name of sales team refers to Sales Team; 'Apotheca, Ltd' is the Customer Names | SELECT DISTINCT T3.`Sales Team` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T1.`Customer Names` = 'Apotheca, Ltd' | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
chicago_crime | In the South side community, what is the name of the community with the most reported incidents of unlawful taking, carrying, leading, or riding away of property from the possession or constructive possession of another person? | "unlawful taking, carrying, leading, or riding away of property from the possession or constructive possession of another person" is the description; name of community refer to community_area_name; most reported incidents refers to Max(Count(fbi_code_no)) | SELECT T3.community_area_name 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.side = 'South' AND T1.description = 'The unlawful taking, carrying, leading, or riding away of property FROM the possession ... | 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... |
works_cycles | What are the sales reasons for order 43718? | order refers to SalesOrderID | SELECT T2.Name FROM SalesOrderHeaderSalesReason AS T1 INNER JOIN SalesReason AS T2 ON T1.SalesReasonID = T2.SalesReasonID WHERE T1.SalesOrderID = 43718 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | What is the product cost end date with the highest weight in grams? | in grams refers to WeightUnitMeasureCode = 'G' | SELECT T2.EndDate FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WeightUnitMeasureCode = 'G' ORDER BY T1.Weight DESC LIMIT 1 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
simpson_episodes | List down person's name who has nickname. | has nickname refers to nickname is NOT NULL | SELECT name FROM Person WHERE nickname IS NOT NULL; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
chicago_crime | What is the precise coordinate of the location where simple assault incidents happened the most in Chatham? | precise coordinates refers to latitude, longitude; 'Simple Assault' is the title of incident; 'Chatham' is the community_area_name; most incident happened refers to Max(Count(latitude, longitude)) | SELECT T2.latitude, T2.longitude 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 T1.title = 'Simple Assault' AND T3.community_area_name = 'Chatham' AND T3.community_area_no = 44 ORDER BY T2.latitude DESC, ... | 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... |
works_cycles | How many shipments by truck were made? | shipment by truck refers to Name = 'XRQ - TRUCK GROUND'; | SELECT COUNT(*) FROM ShipMethod AS T1 INNER JOIN SalesOrderHeader AS T2 USING (ShipMethodID) WHERE T1.Name = 'XRQ - TRUCK GROUND' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | What is the name of the subcategory to which the gray product with the lowest safety stock level belongs? | gray is color of product | SELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 USING (ProductSubcategoryID) WHERE T2.Color = 'Grey' GROUP BY T1.Name | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
regional_sales | List all the cities where Shawn Torres sells Audio products. | "Shawn Torres" is the name of Sales Team; Audio product refers to Product Name = 'Audio' | SELECT T FROM ( SELECT DISTINCT CASE WHEN T4.`Product Name` = 'Audio' AND T3.`Sales Team` = 'Shawn Torres' THEN T1.`City Name` ELSE NULL END AS T FROM `Store Locations` T1 INNER JOIN `Sales Orders` T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` T3 ON T3.SalesTeamID = T2._SalesTeamID INNER JOIN Products T4 ON T... | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
chicago_crime | How many violation of laws are there where no arrest has been made? | "The violation of laws " is the description of incidents; no arrest has been made refers to arrest = 'FALSE' | SELECT SUM(CASE WHEN T1.description LIKE '%The violation of laws%' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.Arrest = 'FALSE' | 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... |
works_cycles | Which department, altogether, has the most personnel who work the evening shift? | evening shift also means night shift where Name = 'Night';most personnel in evening shift refers to Max(Count(Shift.ShiftID(Name = 'Night'))); | SELECT T3.Name FROM EmployeeDepartmentHistory AS T1 INNER JOIN Shift AS T2 ON T1.ShiftId = T2.ShiftId INNER JOIN Department AS T3 ON T1.DepartmentID = T3.DepartmentID WHERE T2.Name = 'Night' GROUP BY T3.Name ORDER BY COUNT(T1.BusinessEntityID) DESC LIMIT 1 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | What type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units? | yellow product refers to Color = 'Yellow'; minimum inventory stock of 500 units refers to SafetyStockLevel = 500 | SELECT DISTINCT T2.TransactionType FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Size = 62 AND T1.Color = 'Yellow' AND T1.SafetyStockLevel = 500 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
simpson_episodes | Calculate the percentage of people who were born after 1970 and from California. | born after 1970 refers to birthdate > 1970; from California refers to birth_region = 'California'; percentage = divide(count(birthdate > 1970 and birth_region = 'California'), total(birthdate)) * 100% | SELECT CAST(SUM(CASE WHEN birth_region = 'California' AND SUBSTR(birthdate, 1, 4) > '1970' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(birthdate) FROM Person; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
car_retails | Which product did Cruz & Sons Co. ask for the biggest amount in a single order? | Cruz & Sons Co. is name of customer; the biggest amount refers to MAX(quantityOrdered). | SELECT t4.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode WHERE t3.customerName = 'Cruz & Sons Co.' ORDER BY t1.priceEach * t1.quantityOrdered D... | CREATE TABLE offices
(
phone TEXT not null, -- Example Values: `+1 650 219 4782`, `+1 215 837 0825`, `+1 212 555 3000`, `+33 14 723 4404`, `+81 33 224 5000` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
addressLine1 TEXT not null, -- Example Values: `100 Market Street`, `1550 Court Place`, `523 ... |
chicago_crime | In the least populated community, what is the most common location of all the reported crime incidents? | least populated refers to Min(Population); community refers to community_area_no; most common location refers to Max(Count(location_description)) | SELECT T2.location_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.population = ( SELECT MIN(population) FROM Community_Area ) AND T2.location_description IS NOT NULL GROUP BY T2.location_description | 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... |
works_cycles | How many employees who began working in 2009 or later had night shifts? | began work in 2009 or later refers to StartDate> = 2009; | SELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Shift AS T2 ON T1.ShiftId = T2.ShiftId WHERE T2.ShiftId = 3 AND STRFTIME('%Y', T2.StartTime) >= '2009' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | If we discount the products that do not have any type of offer, how many different products have been sold in an amount greater than 2 units per order? | do not have any type of offer refers to Description = 'No Discount'; sold in an amount greater than 2 refers to OrderQty>2 | SELECT COUNT(DISTINCT T1.ProductID) FROM SalesOrderDetail AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID INNER JOIN SpecialOffer AS T3 ON T2.SpecialOfferID = T3.SpecialOfferID WHERE T1.OrderQty > 2 AND T1.UnitPriceDiscount = 0 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
simpson_episodes | What percentage of votes are from the nominated episodes? | nominated episodes refers to result = 'Nominee'; percentage of votes = DIVIDE(SUM(result = 'Nominee), SUM(Votes)) as percentage | SELECT CAST(SUM(CASE WHEN T1.result = 'Nominee' THEN T2.votes ELSE 0 END) AS REAL) * 100 / SUM(T2.votes) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
car_retails | What's the postal code of the office the VP Sales is at? | VP Sales refers to jobTitle | SELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales' | CREATE TABLE offices
(
phone TEXT not null, -- Example Values: `+1 650 219 4782`, `+1 215 837 0825`, `+1 212 555 3000`, `+33 14 723 4404`, `+81 33 224 5000` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
addressLine1 TEXT not null, -- Example Values: `100 Market Street`, `1550 Court Place`, `523 ... |
chicago_crime | What is the name of the district with the highest number of domestic violence cases? | domestic violence refers to domestic = 'TRUE'; highest number of case refers to Max(Count(district_no)); name of district refers to distric_name | SELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.domestic = 'TRUE' GROUP BY T2.district_name ORDER BY COUNT(T1.district_no) 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... |
works_cycles | How many vendors does Adventure Works still work with but are not preferable? | not preferable refers to PreferredVendorStatus = 0; still work refers to ActiveFlag = 1; | SELECT COUNT(BusinessEntityID) FROM Vendor WHERE PreferredVendorStatus = 0 AND ActiveFlag = 1 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | Calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status. | employee number 257 refers to EmployeeID = 257; pending shipment status refers to Status = 3 | SELECT SUM(T2.OrderQty) FROM PurchaseOrderHeader AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID WHERE T1.Status = 1 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
simpson_episodes | What is the average height of people from USA? | people from USA refers to birth_country = 'USA'; average height = AVG(height_meters) | SELECT AVG(height_meters) FROM Person WHERE birth_country = 'USA'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
regional_sales | How many Borough-type stores located in the city of Brooklyn have a population of less than 3 million? | "Brooklyn" is the CityName; population of less than 3 million refers to Population < 3000000 | SELECT SUM(CASE WHEN Population < 3000000 AND Type = 'Borough' AND `City Name` = 'Brooklyn' THEN 1 ELSE 0 END) FROM `Store Locations` | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
car_retails | Where can I find the office of the President of the company? | Where can I find the office refers to address, comprising of addressLine1 and addressLine2; President is a jobTitle | SELECT t2.addressLine1, t2.addressLine2 FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'President' | CREATE TABLE offices
(
phone TEXT not null, -- Example Values: `+1 650 219 4782`, `+1 215 837 0825`, `+1 212 555 3000`, `+33 14 723 4404`, `+81 33 224 5000` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
addressLine1 TEXT not null, -- Example Values: `100 Market Street`, `1550 Court Place`, `523 ... |
chicago_crime | How many arrests have been made due to forcible entry burglary that took place in a day care center? | "BURGLARY" is the primary_description; 'FORCIBLE ENTRY' is the secondary_description; 'DAY CARE CENTER' is the location_description; arrests have been made refers to arrest = 'TRUE' | SELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.location_description = 'DAY CARE CENTER' AND T1.secondary_description = 'FORCIBLE ENTRY' AND T1.primary_description = 'BURGLARY' | 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... |
works_cycles | Please list any 3 vendors that are not recommended by Adventure Works. | not recommended refers to PreferredVendorStatus = 0; | SELECT Name FROM Vendor WHERE PreferredVendorStatus = 0 LIMIT 3 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | Sum the total number of products rejected for having a trim length that is too long. | number of product rejected refers to ScrapedQty; trim length that is too long refers to scrap reason where Name = 'Trim length too long' | SELECT SUM(T2.ScrappedQty) FROM ScrapReason AS T1 INNER JOIN WorkOrder AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.Name = 'Trim length too long' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
simpson_episodes | What award did the episode that aired on 11/30/2008 win? | aired on 11/30/2008 refers to air_date = '11/30/2008'; win refers to result = 'Winner' | SELECT T1.award FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Winner' AND T2.air_date = '2008-11-30'; | CREATE TABLE Keyword
(
foreign key (episode_id) references Episode(episode_id),
keyword TEXT, --
primary key (episode_id, keyword),
episode_id TEXT, --
);
CREATE TABLE Vote
(
foreign key (episode_id) references Episode(episode_id),
votes INTEGER, --
episode_id TEXT, --
percent REAL, --
stars INTEGER... |
regional_sales | What sales channels are used the most in the 3 places with the highest median income? | highest median income refers to Max(Median Income) | SELECT `Sales Channel` FROM ( SELECT T1.`Sales Channel` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY T2.`Median Income` DESC LIMIT 3 ) GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1 | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
chicago_crime | Between Deering and Near West districts, which district reported the most number of crime incidents that happened in a library? | "Deering" and "Near West" are both district_name; 'LIBRARY' is the location_description; district with the most number of crime Max(Count(district_no)) | SELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name IN ('Deering', 'Near West') AND T2.location_description = 'LIBRARY' GROUP BY T1.district_name ORDER BY COUNT(T2.district_no) 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... |
works_cycles | Which work order transaction number has the highest product quantity? | work order transaction refers to TransactionType = 'W'; | SELECT TransactionID FROM TransactionHistory WHERE TransactionType = 'W' ORDER BY Quantity DESC LIMIT 1 | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | How many products are there if we add all those located in the Subassembly category? | located in the Subassembly category refers to Name = 'Subassembly' | SELECT COUNT(T1.LocationID) FROM Location AS T1 INNER JOIN ProductInventory AS T2 USING (LocationID) WHERE T1.Name = 'Subassembly' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
regional_sales | In which regions are the stores that have shipped products through the WARE-UHY1004 warehouse? | "WARE-UHY1004" is the WarehouseCode | SELECT T FROM ( SELECT DISTINCT CASE WHEN T3.WarehouseCode = 'WARE-UHY1004' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode INNER JOIN `Sales Orders` T3 ON T3._StoreID = T2.StoreID ) WHERE T IS NOT NULL | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
car_retails | What is the total price of the order made by Cruz & Sons Co. on 2003/3/3? | SUM(MULTIPLY(quantityOrdered, priceEach)) where orderDate = '2003-03-03'; customerName = 'Cruz & Sons Co.' | SELECT SUM(t1.priceEach * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03' | CREATE TABLE offices
(
phone TEXT not null, -- Example Values: `+1 650 219 4782`, `+1 215 837 0825`, `+1 212 555 3000`, `+33 14 723 4404`, `+81 33 224 5000` | Value Statics: Total count 7 - Distinct count 7 - Null count 0
addressLine1 TEXT not null, -- Example Values: `100 Market Street`, `1550 Court Place`, `523 ... |
chicago_crime | What are the general and specific descriptions of the most common crime incidents that happened in an aircraft? | in aircraft refers to location_description = 'AIRCRAFT'; general description refers to primary_description; specific description refers to secondary_description; most common crime incidents refers to Max(Count(iucr_no)) | SELECT T2.primary_description, T2.secondary_description FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.location_description = 'AIRCRAFT' GROUP BY T1.iucr_no ORDER BY COUNT(T1.iucr_no) 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... |
works_cycles | What are the sales tax records charged by multiple types of tax? | multiple types of tax refers to Name like '%+%';
| SELECT SalesTaxRateID FROM SalesTaxRate WHERE Name LIKE '%+%' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
works_cycles | List the first and last name of all unmarried male Production Supervisors. | unmarried refers to MaritalStatus = 'S', male refers to Gender = 'M', Production Supervisors is a job title | SELECT T2.FirstName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.MaritalStatus = 'S' AND T1.Gender = 'M' AND T1.JobTitle LIKE 'Production Supervisor%' | CREATE TABLE ProductSubcategory
(
ProductCategoryID INTEGER not null, -- Example Values: `1`, `2`, `3`, `4` | Value Statics: Total count 37 - Distinct count 4 - Null count 0
rowguid TEXT not null unique, --
ModifiedDate DATETIME default CURRENT_TIMESTAMP not null, -- Example Values: `2008-04-30 00:00:00.0` | Va... |
regional_sales | What is the highest discount applied by the store located in a city of the state of Colorado whose land area is 111039036. | highest discount applied refers to Max(Discount Applied) | SELECT MAX(T1.`Discount Applied`) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.State = 'Colorado' AND T2.`Land Area` = 111039036 | CREATE TABLE Regions
(
State TEXT, --
Region TEXT, -- Example Values: `South`, `West`, `Northeast`, `Midwest` | Value Statics: Total count 48 - Distinct count 4 - Null count 0
StateCode TEXT constraint Regions_pk primary key,
);
CREATE TABLE Sales Orders
(
OrderNumber TEXT constraint "Sales Orders_pk" primary... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.