db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
talkingdata | How many events in total have happened on the devices in 2016? | in 2016 refers to `timestamp` LIKE '2016%'; | SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which two countries have the border in length of 803 km? Give the full names of the countries. | null | SELECT T1.Name, T3.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 WHERE T2.Length = 803 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Calculate the percentage of the app user IDs under Industry tag category. | percentage = DIVIDE(MULTIPLY(CONCAT(COUNT(app_id WHERE category = 'Industry tag'), 100), COUNT(app_id)),'%'); | SELECT SUM(IIF(T1.category = 'Industry tag', 1, 0)) * 100 / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which religion has the majority of the people in Japan? | Japan is a country | SELECT T2.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan' ORDER BY T2.Percentage DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | How many users of the app were not active when event no.2 happened? | not active refers to is_active = 0; event no. refers to event_id; event_id = 2; | SELECT COUNT(event_id) FROM app_events WHERE event_id = 2 AND is_active = 0 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | In which country is the city of Grozny? Give the full name of the country. | Grozny is a province | SELECT T1.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Grozny' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | How many device users are male? | male refers to gender = 'M'; | SELECT COUNT(device_id) FROM gender_age WHERE gender = 'M' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which non capital city has the most people of all? | null | SELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | Which city has most population other than its capital in Bangladesh? | Bangladesh is a country | SELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Bangladesh' AND T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
computer_student | Which professor teaches the highest number of professional or master/graduate courses? | professor refers to taughtBy.p_id; highest number of professional or master/graduate courses refers to max(count(taughtBy.course_id)) where courseLevel = 'Level_500' | SELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1 | CREATE TABLE course
(
course_id INTEGER constraint course_pk primary key,
courseLevel TEXT, -- Example Values: `Level_500`, `Level_300`, `Level_400` | Value Statics: Total count 132 - Distinct count 3 - Null count 0
);
CREATE TABLE advisedBy
(
p_id INTEGER, --
constraint advisedBy_pk primary key (p_id, p_id_d... |
mondial_geo | What is the total number of cities that Japan have? | Japan is a country | SELECT COUNT(T3.Name) FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Japan' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Among the female users of the devices, how many of them are under 30? | female refers to gender = 'F'; under 30 refers to age < 30; | SELECT COUNT(device_id) FROM gender_age WHERE age < 30 AND gender = 'F' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | For all the countries that is smaller than 100 square kilometres, which one has the most GDP? | null | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Area < 100 ORDER BY T2.GDP DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | How many events have happened on device no.29182687948017100 in 2016? | device no. refers to device_id; device_id = 29182687948017100; in 2016 refers to `timestamp` LIKE '2016%'; | SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016' AND device_id = 29182687948017100 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the longitude of the island on which Mount Olympos is located? | null | SELECT T3.Longitude FROM mountain AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Mountain INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Name = 'Olympos' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | In which Country is the second highest volcanic mountain located in? Give the code of the country. | null | SELECT T3.Country FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province ORDER BY T1.Height DESC LIMIT 1, 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | What is the age of the oldest device user? | oldest device user refers to MAX(age); | SELECT MAX(age) FROM gender_age | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Among all the rivers finally flows to the sea of 540m in depth, which one has the longest length? | null | SELECT T2.Name FROM sea AS T1 INNER JOIN river AS T2 ON T2.Sea = T1.Name WHERE T1.Depth = 540 ORDER BY T2.Length DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | How many cities in France have a population of more than 100,000? | null | SELECT COUNT(T2.Name) FROM country AS T1 INNER JOIN city AS T2 ON T2.Country = T1.Code WHERE T1.Name = 'France' AND T2.Population > 100000 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Please list the ages of all the users who use a Galaxy Note 2. | Galaxy Note 2 refers to device_model = 'Galaxy Note 2'; | SELECT T2.age FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.device_model = 'Galaxy Note 2' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which country became independent on 1492-01-01? Give the full name of the country. | null | SELECT T1.Name FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1492-01-01' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
computer_student | How many professional or master/graduate courses are there? | professional or master/graduate courses refers to courseLevel = 'Level_500' | SELECT COUNT(*) FROM course WHERE courseLevel = 'Level_500' | CREATE TABLE course
(
course_id INTEGER constraint course_pk primary key,
courseLevel TEXT, -- Example Values: `Level_500`, `Level_300`, `Level_400` | Value Statics: Total count 132 - Distinct count 3 - Null count 0
);
CREATE TABLE advisedBy
(
p_id INTEGER, --
constraint advisedBy_pk primary key (p_id, p_id_d... |
mondial_geo | Which three countries does the Amazonas flow through? Give the full name of the countries. | Amazonas flow is a river | SELECT DISTINCT T4.Name FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River INNER JOIN country AS T4 ON T4.Code = T2.Country WHERE T3.Name = 'Amazonas' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | How much sea is around the island where Kerinci Mountain is located? | null | SELECT COUNT(T4.Sea) FROM mountain AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Mountain INNER JOIN island AS T3 ON T3.Name = T2.Island INNER JOIN islandIn AS T4 ON T4.Island = T3.Name WHERE T1.Name = 'Kerinci' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | To which user group do most of the users who uses a vivo device belong? | user group where most of the users belong refers to MAX(COUNT(group)); vivo device refers to phone_brand = 'vivo'; | SELECT T.`group` FROM ( SELECT T2.`group`, COUNT(`group`) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' GROUP BY T2.`group` ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the capital of the country that has the Licancabur Mountain? | null | SELECT T4.Capital FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Province = T3.Name WHERE T1.Name = 'Licancabur' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Among the users who use a Galaxy Note 2, how many of them are female? | Galaxy Note 2 refers to device_model = 'Galaxy Note 2'; female refers to gender = 'F'; | SELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T2.gender = 'F' AND T1.device_model = 'Galaxy Note 2' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | For the countries have the population north of a billion, which one has the lowest GDP? Give the full name of the country. | billion = 1000000000 | SELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Population > 1000000000 ORDER BY T2.GDP ASC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | Which country was the source of Pjandsh River? Give the full name of the country. | null | SELECT T1.Name FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country WHERE T2.River = 'Pjandsh' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | What is the device model of the device used by the oldest user? | oldest user refers to MAX(age); | SELECT device_model FROM phone_brand_device_model2 WHERE device_id IN ( SELECT device_id FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age ) ) | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What's the percentage of people in Cayman Islands speak English? | Cayman Islands is a country | SELECT T1.Percentage FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Cayman Islands' AND T1.Name = 'English' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | What is the main spoken language in MNE? | MNE is one country | SELECT Name FROM language WHERE Country = 'MNE' ORDER BY Percentage DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | What's the name of the second biggest desert? | null | SELECT Name FROM desert ORDER BY Area DESC LIMIT 1, 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | To which categories does app user no.1977658975649780000 belong? | app no. refers to app_id; app_id = 1977658975649780000; | SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = 1977658975649780000 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the capital of the 3rd most populated country in Asia and what is the capital city's ratio in percentage (%) against the overall population of the country? | null | SELECT T4.Capital, CAST(T3.Population AS REAL) * 100 / T4.Population FROM city AS T3 INNER JOIN ( SELECT T1.Capital , T1.Population FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia' ORDER BY T1.Population DESC LIMIT 2, 1 ) AS T4 ON T3.Name = T4.Capital | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | Which federal republic country in Europe has the most provinces, and what proportion of GDP is devoted to services?
Calculate the population density as well. | Republic is on of government forms; Percentage of Services of the GDP was mentioned in economy.Service; Population Density = Population / Area | SELECT T1.Country, T2.Service , SUM(T1.Population) / SUM(T1.Area) FROM province AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country WHERE T1.Country IN ( SELECT Country FROM encompasses WHERE Continent = 'Europe' ) GROUP BY T1.Country, T2.Service ORDER BY COUNT(T1.Name) DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
computer_student | Among the students being advised by Advisor 5, how many students are in the 5th year? | Advisor 5 refers to p_id_dummy = 5; are in the 5th year refers to yearsInProgram = 'Year_5' | SELECT COUNT(*) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy = 5 AND T2.student = 1 AND T2.yearsInProgram = 'Year_5' | CREATE TABLE course
(
course_id INTEGER constraint course_pk primary key,
courseLevel TEXT, -- Example Values: `Level_500`, `Level_300`, `Level_400` | Value Statics: Total count 132 - Distinct count 3 - Null count 0
);
CREATE TABLE advisedBy
(
p_id INTEGER, --
constraint advisedBy_pk primary key (p_id, p_id_d... |
mondial_geo | What is the proportion of English-speaking citizens in the countries that rely on the United States compared to the total number of citizens in those countries? | null | SELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country WHERE T3.Dependent = 'USA' AND T2.Name = 'English' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | What are the names of the cities along the Euphrat River's course? Indicate the capital city of the nation where the Euphrat River flows. | null | SELECT T2.City, T1.Capital FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = 'Euphrat' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Please list the location coordinates of all the devices with an inactive app user when event no.2 happened. | location coordinates = longitude, latitude; inactive refers to is_active = 0; event no. refers to event_id; event_id = 2; | SELECT DISTINCT T2.longitude, T2.latitude FROM app_events AS T1 INNER JOIN events AS T2 ON T2.event_id = T1.event_id WHERE T2.event_id = 2 AND T1.is_active = 0 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the total number of Afro-Asian people in the most populous Asian country governed by a monarchy? | Total Number of People = Percentage * Population | SELECT T5.Percentage * T6.Population FROM ethnicGroup AS T5 INNER JOIN country AS T6 ON T5.Country = T6.Code WHERE Country = ( SELECT T3.Code FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN politics AS T4 ON T4.Country = T3.Code WHE... | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | How many people reside in the nation's capital city, which is situated in the nation that attained independence on 8/15/1947? | null | SELECT T3.Population FROM politics AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN city AS T3 ON T3.Name = T2.Capital WHERE T1.Independence = '1947-08-15' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | How many app users belong to the category of Securities? | null | SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id WHERE T2.category = 'Securities' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What are the names of the three nations where the longest river that empties into the Atlantic Ocean stretches to? | Empties into the Atlantic Ocean = flows to the Atlantic Ocean | SELECT DISTINCT T1.Country FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = ( SELECT Name FROM river WHERE Sea = 'Atlantic Ocean' ORDER BY Length DESC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | What are the names of the sea that can be found on the island with the biggest area? | null | SELECT T2.Name FROM islandIn AS T1 INNER JOIN sea AS T2 ON T2.Name = T1.Sea WHERE T1.Island = ( SELECT Name FROM island ORDER BY Area DESC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Please list the categories of the app users who are not active when event no.2 happened. | not active refers to is_active = 0; event no. refers to event_id; event_id = 2; | SELECT DISTINCT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the difference in population between the two nations where the tallest peak is located? | null | SELECT * FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Country = T2.Country INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T1.Name = ( SELECT Name FROM mountain ORDER BY Height DESC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Please list the IDs of the events happened on all the vivo devices. | IDs of the events refers to event_id; vivo devices refers to phone_brand = 'vivo'; | SELECT T2.event_id FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which religion is most prevalent in Asia? | Most prevalent religion refers to the religion with the most population percentage | SELECT T4.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN religion AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Asia' GROUP BY T4.Name ORDER BY SUM(T4.Percentage) DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | How many lakes are there in the 4th most populous African country with a republican form of government? | null | SELECT COUNT(*) FROM geo_lake WHERE Country = ( SELECT T4.Code FROM ( SELECT T2.Code, T2.Population FROM encompasses AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN politics AS T3 ON T1.Country = T3.Country WHERE T1.Continent = 'Africa' AND T1.Percentage = 100 AND T3.Government = 'republic' ORDER BY P... | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
computer_student | How many students are under advisor 415? | advisor 415 refers to p_id_dummy = 415 | SELECT COUNT(*) FROM advisedBy WHERE p_id_dummy = 415 | CREATE TABLE course
(
course_id INTEGER constraint course_pk primary key,
courseLevel TEXT, -- Example Values: `Level_500`, `Level_300`, `Level_400` | Value Statics: Total count 132 - Distinct count 3 - Null count 0
);
CREATE TABLE advisedBy
(
p_id INTEGER, --
constraint advisedBy_pk primary key (p_id, p_id_d... |
mondial_geo | What provinces encompass the world's biggest desert in terms of overall area? | null | SELECT Province FROM geo_desert WHERE Desert = ( SELECT Name FROM desert ORDER BY Area DESC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | Which Arabic-speaking country has the smallest population? | Arabic-speaking country = country that speaks 100% Arabic | SELECT T1.Name FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Arabic' AND T2.Percentage = 100 ORDER BY T1.Population ASC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Please list the time when event no.2 happened on a vivo device. | time refers to timestamp; event no. refers to event_id; event_id = '2'; vivo device refers to phone_brand = 'vivo'; | SELECT T1.timestamp FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.event_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T1.event_id = '2' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the smallest border's length, and what form of government do the two nations bordering it have? | null | SELECT T1.Government, T3.Government FROM politics AS T1 INNER JOIN borders AS T2 ON T1.Country = T2.Country1 INNER JOIN politics AS T3 ON T3.Country = T2.Country2 ORDER BY T2.Length ASC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
mondial_geo | Which nation has the greatest infant mortality rate among those that attained independence in 1960? | null | SELECT T1.Country FROM politics AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE STRFTIME('%Y', T1.Independence) = '1960' ORDER BY T2.Infant_Mortality DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Among all the times event no.2 happened when the app user was not active, when was the earliest time this situation happened? | event no. refers to event_id; event_id = 2; not active refers to is_active = 0; earliest time refers to MIN(timestamp); | SELECT T2.timestamp FROM app_events AS T1 INNER JOIN events AS T2 ON T2.event_id = T1.event_id WHERE T1.is_active = 0 AND T2.event_id = 2 ORDER BY T2.timestamp LIMIT 1 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What kind of political system is in place in the country with the highest inflation rate? | Political system refers to government form | SELECT T1.Government FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country ORDER BY T2.Inflation DESC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Among the devices with event no.2 happening, how many of them are vivo devices? | event no. refers to event_id; event_id = 2; vivo devices refers to phone_brand = 'vivo'; | SELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' AND T2.event_id = 2 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which nation's GDP is the lowest among those that are communist states? | Communist is a government form | SELECT T2.Country FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country WHERE T1.Government = 'Communist state' ORDER BY T2.GDP ASC LIMIT 1 | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | Among the users who uses a vivo device, how many of them are female and under 30? | vivo device refers to phone_brand = 'vivo'; female refers to gender = 'F'; under 30 refers to age < 30; | SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.phone_brand = 'vivo' AND T1.age < 30 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which sea is the shallowest and which country surrounds it? | Shallow sea refers to the sea with less depth | SELECT DISTINCT T2.Name FROM located AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE Sea = ( SELECT Name FROM sea ORDER BY Depth ASC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
computer_student | List any five of course IDs with professor IDs who taught master courses. | professor IDs refers to taughtBy.p_id; master course refers to courseLevel = 'Level_500' | SELECT T1.course_id, T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' LIMIT 5 | CREATE TABLE course
(
course_id INTEGER constraint course_pk primary key,
courseLevel TEXT, -- Example Values: `Level_500`, `Level_300`, `Level_400` | Value Statics: Total count 132 - Distinct count 3 - Null count 0
);
CREATE TABLE advisedBy
(
p_id INTEGER, --
constraint advisedBy_pk primary key (p_id, p_id_d... |
mondial_geo | How many mountains are there in the country with the most land area? | null | SELECT COUNT(Mountain) FROM geo_mountain WHERE Country = ( SELECT Code FROM country ORDER BY Area DESC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | What is the brand of the device used by the youngest female user? | brand of the device refers to phone_brand; youngest refers to MIN(age); female refers to gender = 'F'; | SELECT phone_brand FROM phone_brand_device_model2 WHERE device_id IN ( SELECT * FROM ( SELECT device_id FROM gender_age WHERE gender = 'F' ORDER BY age LIMIT 1 ) AS T ) | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | How many people in Montenegro speaks Serbian? | Serbian is one language; Montenegro is a country located in Southeastern Europe | SELECT T1.Percentage * T2.Population FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Serbian' AND T2.Name = 'Montenegro' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | How many events in total have happened on all the vivo devices in the year 2016? | vivo devices refers to phone_brand = 'vivo'; in the year 2016 refers to year(timestamp) = 2016; | SELECT COUNT(T1.event_id) FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.event_id = T2.device_id WHERE STRFTIME('%Y', T1.timestamp) = '2016' AND T2.phone_brand = 'vivo' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | Which country is home to the world's tiniest desert, and what are its longitude and latitude? | null | SELECT T2.Country, T1.Latitude, T1.Longitude FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert WHERE T1.Name = ( SELECT Name FROM desert ORDER BY Area ASC LIMIT 1 ) | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | What is the category that the most app users belong to? | most app users refers to MAX(COUNT(app_id)); | SELECT T.category FROM ( SELECT T1.category, COUNT(T2.app_id) AS num FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id GROUP BY T1.label_id ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | What is the average area of Asian countries? | Asia is a continent | SELECT AVG(Area) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
talkingdata | How many users in user group M23-26 use a vivo device? | user group M23-26 refers to group = 'M23-26'; vivo device refers to phone_brand = 'vivo'; | SELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26' AND T2.phone_brand = 'vivo' | CREATE TABLE app_events
(
`is_active` INTEGER NOT NULL, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
`is_installed` INTEGER NOT NULL, -- Example Values: `1` | Value Statics: Total count 100000 - Distinct count 1 - Null count 0
`event_id` INTEGER NOT NULL, --... |
mondial_geo | How many Jewish residents are there in Moldova? | Moldova is one country located in Eastern Europe; The number of residents can be computed by percentage * population | SELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Moldova' AND T2.Name = 'Jewish' | CREATE TABLE politics
(
Government TEXT, --
Country TEXT default '' not null primary key constraint politics_ibfk_1 references country on update cascade on delete cascade,
Independence DATE, --
Dependent TEXT constraint politics_ibfk_2 references country on update cascade on delete cascade, -- Example Values: `... |
computer_student | How many non-faculty members are not undergoing the phase of qualifications? | non-faculty members refers to hasPosition = 0; are not undergoing the phase of qualifications refers to inPhase = 0 | SELECT COUNT(*) FROM person WHERE hasPosition = 0 AND inPhase = 0 | CREATE TABLE course
(
course_id INTEGER constraint course_pk primary key,
courseLevel TEXT, -- Example Values: `Level_500`, `Level_300`, `Level_400` | Value Statics: Total count 132 - Distinct count 3 - Null count 0
);
CREATE TABLE advisedBy
(
p_id INTEGER, --
constraint advisedBy_pk primary key (p_id, p_id_d... |
sales_in_weather | On which day was the weather more windy in station no.1, 2012/1/1 or 2012/1/2? | station no.1 refers to station_nbr = 1; 2012/1/1 refers to date = '2012-01-01'; 2012/1/2 refers to date = '2012-01-02'; more windy refers to Max(avgspeed) | SELECT CASE WHEN (SUM(CASE WHEN `date` = '2012-01-01' THEN avgspeed ELSE 0 END) - SUM(CASE WHEN `date` = '2012-01-02' THEN avgspeed ELSE 0 END)) > 0 THEN '2012-01-01' ELSE '2012-01-02' END FROM weather WHERE station_nbr = 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreig... |
olympics | Which sport did John Aalberg participate in? | 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 = 'John Aalberg' | 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... |
movies_4 | List down five movie titles that were released before 2000. | released before 2000 refers to release_date < '2000-01-01' | SELECT title FROM movie WHERE CAST(STRFTIME('%Y', release_date) AS INT) < 2000 LIMIT 5 | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
sales_in_weather | Please list the dates on which the temperature of station no.2 was above the 30-year normal. | temperature above the 30-year normal refers to depart > 0; station no.2 refers to station_nbr = 2 | SELECT `date` FROM weather WHERE station_nbr = 2 AND depart > 0 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreig... |
olympics | Mention the height of people who belong to region id 7. | null | SELECT T2.height FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T1.region_id = 7 | 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... |
movies_4 | What percentage of movies that came from Japan belong in the 'animation' genre? | from Japan refers to country_name = 'Japan'; in the 'animation' genre refers to genre_name = 'animation'; percentage = divide(sum(movie_id) when genre_name = 'animation', count(movie_id)) as percentage | SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Animation' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INN... | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
sales_in_weather | What was the temperature range of station no.1 on 2012/1/1? | on 2012/1/1 refers to date = '2012-01-01'; temperature range refers to Subtract (tmax, tmin); station no.1 refers to station_nbr = 1 | SELECT tmax - tmin AS temrange FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-01' | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreig... |
olympics | How many athletes took part in the Olympic games held in Barcelona? | Barcelona refers to city_name = 'Barcelona'; | SELECT COUNT(T1.person_id) FROM games_competitor AS T1 INNER JOIN games_city AS T2 ON T1.games_id = T2.games_id INNER JOIN city AS T3 ON T2.city_id = T3.id WHERE T3.city_name = 'Barcelona' | 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... |
movies_4 | Look for the movie title with the keyword of "angel". | keyword of "angel" refers to keyword_name = 'angel' | SELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'angel' | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
sales_in_weather | What is the ID of the item that sold the best on 2012/1/1 in store no.1? | sold on 2012/1/1 refers to date = '2012-01-01'; in store no.1 refers to store_nbr = 1; item sold the best refers to Max(units) | SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreig... |
olympics | How many people who are below 30 and participated in the summer season? | people who are below 30 refer to person_id where age < 30; the summer season refers to season = 'Summer'; | SELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' AND T2.age < 30 | 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... |
movies_4 | What is the ratio between male and female cast members of the movie 'Iron Man?' Count how many have unspecified genders. | male refers to gender = 'Male'; female refers to gender = 'Female'; movie 'Iron Man' refers to title = 'Iron Man'; ratio = divide(sum(gender = 'Female'), sum(gender = 'Male')) | SELECT CAST(COUNT(CASE WHEN T3.gender = 'Male' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T3.gender = 'Female' THEN 1 ELSE NULL END) AS RATIO , COUNT(CASE WHEN T3.gender = 'Unspecified' THEN 1 ELSE NULL END) AS UNGENDERS FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender A... | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
sales_in_weather | How many units of item no.9 were sold in store no.1 in total in January, 2012? | store no. 1 refers to store_nbr = 1; item no. 9 refers to item_nbr = 9; in January refers to SUBSTR(date, 1, 4) = '2012' and SUBSTR(date, 6, 2) = '01' | SELECT SUM(units) FROM sales_in_weather WHERE SUBSTR(`date`, 6, 2) = '01' AND SUBSTR(`date`, 1, 4) = '2012' AND item_nbr = 9 AND store_nbr = 1 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreig... |
olympics | How many Belgian men have competed in an Olympic Games? | Belgian men refer to gender = 'M' where 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... |
movies_4 | What is the keyword ID of the movie with the title of "Sin City"? | title of "Sin City" refers to title = 'Sin City' | SELECT T2.keyword_id FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Sin City' | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
sales_in_weather | How many units of item no.9 were sold in store no.1 on 2012/1/1? | store no. 1 refers to store_nbr = 1; item no. 9 refers to item_nbr = 9; on 2012/1/1 refers to date = '2012-01-01' | SELECT units FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 AND item_nbr = 9 | CREATE TABLE sales_in_weather
(
primary key (store_nbr, date, item_nbr),
store_nbr INTEGER, --
units INTEGER, --
item_nbr INTEGER, --
date DATE, --
);
CREATE TABLE relation
(
store_nbr INTEGER primary key,
station_nbr INTEGER, --
foreign key (store_nbr) references sales_in_weather(store_nbr),
foreig... |
olympics | What is the region id of Christine Jacoba Aaftink? | null | SELECT T1.region_id FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T2.full_name = 'Christine Jacoba Aaftink' | 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... |
movies_4 | Provide the genre ID of the movie with the title of "The Dark Knight". | movie with the title of "The Dark Knight" refers to title = 'The Dark Knight' | SELECT T2.genre_id FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Dark Knight' | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
university | List the names of universities with a score less than 28% of the average score of all universities in 2015. | in 2015 refers to year = 2015; score less than 28% refers to score < MULTIPLY(avg(score), 0.28) where year = 2015; names of universities refers to university_name | SELECT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 AND T1.score * 100 < ( SELECT AVG(score) * 28 FROM university_ranking_year WHERE year = 2015 ) | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
... |
olympics | What were the cities in which John Aalberg competed? | cities refer to city_name; | SELECT T4.city_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T1.full_name = 'John Aalberg' | 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... |
university | Calculate the difference between the total number of students and the number of international international students in Univeristy of Tokyo from 2011 to 2014. | international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); difference refers to SUBTRACT(SUM(num_students), SUM(DIVIDE(MULTIPLY(num_students, pct_international_students), 100))); in University of Tokyo refers to university_name = 'University of Tokyo'; from 2011 to 2014 refers to ... | SELECT SUM(T1.num_students) - SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year BETWEEN 2011 AND 2014 AND T2.university_name = 'University of Tokyo' | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
... |
movies_4 | Write down five rumoured movie titles within the genre of Drama. | rumoured movie refers to movie_status = 'rumoured'; genre of Drama refers to genre_name = 'Drama' | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.movie_status = 'Rumored' AND T3.genre_name = 'Drama' LIMIT 5 | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
university | Among the universities in United States of America, what is the percentage of female students in year 2016? | female students refers to DIVIDE(MULTIPLY(num_students, pct_female_students), 100); in United States of America refers to country_name = 'United States of America'; percentage refers to DIVIDE(SUM(DIVIDE(MULTIPLY(num_students, pct_female_students), 100)), SUM(num_students)) | SELECT SUM(CAST(T2.pct_female_students * T2.num_students AS REAL) / 100) * 100 / SUM(T2.num_students) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'United States of America' AND T2.year = 2016 | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
... |
olympics | What are the id of the games held in London? | London refers to city_name = 'London'; | SELECT 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... |
movies_4 | Which keywords belong to the movie titles with the highest popularity? | Which keywords refers to keyword_name; highest popularity refers to max(popularity) | SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id ORDER BY T1.popularity DESC LIMIT 1 | CREATE TABLE production_company
(
company_name TEXT default NULL, --
company_id INTEGER not null primary key,
);
CREATE TABLE gender
(
gender TEXT default NULL, -- Example Values: `Unspecified`, `Female`, `Male` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
gender_id INTEGER not null primar... |
university | How many universities scored 40 in teaching criteria? | scored 40 refers to score = 40; in teaching refers to criteria_name = 'Teaching' | SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.score = 40 AND T1.criteria_name = 'Teaching' AND T2.score = 40 | CREATE TABLE ranking_system
(
id INTEGER not null primary key,
system_name TEXT default NULL, -- Example Values: `Times Higher Education World University Ranking`, `Shanghai Ranking`, `Center for World University Rankings` | Value Statics: Total count 3 - Distinct count 3 - Null count 0
);
CREATE TABLE country
(
... |
olympics | How many different football events are there? | events refer to event_name; football refers to sport_name = 'Football'; | SELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Football' | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.