db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
car_retails | Determine the email and Code of employee who are working at United State, state MA | code of employee refers to employeeNumber; United States of America refers to country = 'USA'; | SELECT T1.email, T1.employeeNumber FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.state = 'MA' AND T2.country = 'USA' | 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 ... |
talkingdata | How many events were participated by the users at longitude of "-156"? | null | SELECT COUNT(event_id) FROM events WHERE longitude = -156 | 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, --... |
movie_3 | Please give the description of the movie starring JENNIFER DAVIS. | null | SELECT T3.description FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id WHERE T1.first_name = 'JOHNNY' AND T1.last_name = 'DAVIS' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Among the papers published in 2009, pick 10 and list down the conference's short name of these papers. | published in 2009 refers to Year = 2009 | SELECT T2.PaperId, T4.ShortName FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId INNER JOIN Paper AS T3 ON T2.PaperId = T3.Id INNER JOIN Conference AS T4 ON T3.ConferenceId = T4.Id WHERE T3.Year = 2009 LIMIT 10 | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | Compared with the orders happened on 2005-04-08 and two days later, which day's order had a higher value? | 2005-04-08 and two days later refer to orderDate = '2005-04-08' and orderDate = '2005-04-10'; order with a higher value refers to MAX(Total price) = MULTIPLY(quantityOrdered, priceEach); | SELECT T2.orderDate FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE STRFTIME('%Y-%m-%d', T2.orderDate) = '2005-04-08' OR STRFTIME('%Y-%m-%d', T2.orderDate) = '2005-04-10' ORDER BY T1.quantityOrdered * T1.priceEach DESC LIMIT 1 | 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 ... |
talkingdata | What is the ratio of active and inactive app users of the event ID "58"? | ratio = DIVIDE(SUM(is_active = 1), SUM(is_active = 0)); active refers to is_active = 1; inactive refers to is_active = 0; | SELECT SUM(IIF(is_active = 1, 1, 0)) / SUM(IIF(is_active = 0, 1, 0)) AS per FROM app_events WHERE event_id = 58 | 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, --... |
movie_3 | Give the full name of the actor with the highest rental rate. | full name refers to first_name, last_name; the highest rental rate refers to max(rental_rate) | SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id ORDER BY T3.rental_rate DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Among papers that were published in 2005, provide the author name of paper with key words of "LOAD; IDE; SNP; haplotype; asso- ciation studies". | in 2005 refers to Year = '2005'; key words of "LOAD; IDE; SNP; haplotype; asso- ciation studies" refers to Keyword = 'LOAD; IDE; SNP; haplotype; asso- ciation studies' | SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 2005 AND T1.Keyword = 'KEY WORDS: LOAD IDE SNP haplotype asso- ciation studies' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | How many orders which expected profits greater than 100? | expected profits greater than 100 = (SUBTRACT(msrp, buyPrice))>100; | SELECT COUNT(T1.productCode) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.MSRP - T2.buyPrice > 100 | 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 ... |
talkingdata | Calculate the percentage of male users among all device users. | percentage = DVIDE(SUM(gender = 'M'), COUNT(device_id)); male refers to gender = 'M'; | SELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per 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, --... |
movie_3 | Which category does BABY HALL film belong to? | category refers to name; BABY HALL film refers to title = 'BABY HALL' | SELECT T3.`name` FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BABY HALL' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | What are the conference name and journal name of paper written by Shueh-Lin Yau? List down the name of co-authors and provide the title of that paper. | Shueh-Lin Yau is the name of author; | SELECT T1.ConferenceId, T1.JournalId, T2.Name, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id INNER JOIN Journal AS T4 ON T1.JournalId = T4.Id WHERE T2.Name = 'Shueh-Lin Yau' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
talkingdata | How many category names start with the word "game"? | category names refers to category; start with the word game refers to category like 'game%'; | SELECT COUNT(label_id) FROM label_categories WHERE category LIKE 'game%' | 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, --... |
movie_3 | How many id movies have category id 11? | id movies refers to film_id | SELECT COUNT(film_id) FROM film_category WHERE category_id = 11 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | Where's Foon Yue Tseng's office located at? Give the detailed address. | Detailed address comprises addressLine1 and addressLine2; | SELECT T1.addressLine1, T1.addressLine2 FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.firstName = 'Foon Yue' AND T2.lastName = 'Tseng' | 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 ... |
talkingdata | What is the age of the youngest female user of the app? | youngest user refers to MIN(age); female refers to gender = 'F'; | SELECT MIN(age) FROM gender_age WHERE 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, --... |
movie_3 | Please indicate the full name of actor id 5. | full name refers to first_name, last_name | SELECT first_name, last_name FROM actor WHERE actor_id = 5 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
video_games | In games that can be played on Wii, what is the percentage of games released in 2007? | Wii refers to platform_name = 'Wii'; percentage = MULTIPLY(DIVIDE(SUM(release_year = 2007), COUNT(release_year)), 100.0); released in 2007 refers to release_year = 2007; | SELECT CAST(COUNT(CASE WHEN T2.release_year = 2007 THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'Wii' | CREATE TABLE region_sales
(
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (region_id) references region(id),
region_id INTEGER default NULL, -- Example Values: `1`, `... |
talkingdata | List down the labels' IDs and categories of the app ID "5758400314709850000". | null | SELECT T1.label_id, T2.category FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T1.app_id = 5758400314709850000 | 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, --... |
movie_3 | What percentage of films are horror films? | horror' is a name of a category; calculation = DIVIDE(SUM(name = 'Horror'), COUNT(film_id)) * 100 | SELECT CAST(SUM(IIF(T2.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | How much did Petit Auto pay on 2004-08-09? | Petit Auto is name of customer; paymentDate = '2004-08-09'; | SELECT t1.amount FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Petit Auto' AND t1.paymentDate = '2004-08-09' | 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 ... |
talkingdata | How many app users belong to label ID of "48"? | null | SELECT COUNT(app_id) FROM app_labels WHERE label_id = 48 | 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, --... |
movie_3 | Which actor acted in the most films? | actor refers to first_name, last_name; the most film refers to MAX(SUM(film_id)) | SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, SUM(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | List the names of all authors affiliated with Birkbeck University of London. | affiliated with Birkbeck University of London refers to Affiliation = 'Birkbeck University of London' | SELECT Name FROM Author WHERE Affiliation = 'Birkbeck University of London' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | Which different vendor has the most amount of orders? Calculate the total estimated earnings. | amount of order refers to quantityOrdered; most amount of orders refers to SUM(QuantityOrdered); estimated earnings refers to expected profits; expected profits = SUBTRACT(msrp, buyPrice); | SELECT DISTINCT T1.productVendor, T1.MSRP - T1.buyPrice FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode GROUP BY T1.productVendor, T1.MSRP, T1.buyPrice ORDER BY COUNT(T2.quantityOrdered) DESC LIMIT 1 | 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 ... |
talkingdata | Provide the number of events participated by the device users at coordinates of (80,37). | coordinates of (80,37) refers to longitude = 80 and latitude = 37; | SELECT COUNT(event_id) FROM events WHERE longitude = 80 AND latitude = 37 | 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, --... |
movie_3 | What is the city with the most customers? | the most customers refers to MAX(COUNT(customer_id)) | SELECT T.city FROM ( SELECT T1.city, COUNT(T3.customer_id) AS num FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id GROUP BY T1.city ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | How many products with the highest expected profits were sold in total? | Products refer to productCode; Expected profits = SUBTRACT(MSRP, buyPrice); | SELECT SUM(t2.quantityOrdered) FROM orderdetails AS t2 INNER JOIN ( SELECT t1.productCode FROM products AS t1 ORDER BY t1.MSRP - t1.buyPrice DESC LIMIT 1 ) AS t3 ON t2.productCode = t3.productCode | 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 ... |
talkingdata | What are the label IDs and app IDs of the Chinese Classical Mythology category? | null | SELECT T1.label_id, T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Chinese Classical Mythology' | 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, --... |
movie_3 | List all the animation titles. | 'animation' is a name of a category | SELECT T3.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | How many sales representatives who have office code is 1? | sales representative refers to jobTitle = 'Sales Rep'; | SELECT COUNT(officeCode) FROM employees WHERE jobTitle = 'Sales Rep' AND officeCode = 1 | 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 ... |
talkingdata | List 5 device models that users use to install the app and are active in using the app. | install refers to is_installed = 1; active refers to is_active = 1; | SELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.event_id INNER JOIN app_events AS T3 ON T2.event_id = T3.event_id WHERE T3.is_active = 1 AND T3.is_installed = 1 LIMIT 5 | 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, --... |
movie_3 | What are the addresses for the stores? | null | SELECT T2.address FROM store AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Who are the co-authors for Jei Keon Chae and what is the title of paper written by them? | 'Jei Keon Chee' is the name of author; | SELECT T2.AuthorId, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Jei Keon Chae' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | Which customer made the order No. 10160? Give the contact name. | null | SELECT t2.contactFirstName, t2.contactLastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10160' | 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 ... |
talkingdata | Provide the locations and times of the events of app ID "8715964299802120000". | locations = longitude, latitude; times of the events refers to timestamp; | SELECT T1.longitude, T1.latitude, T1.timestamp FROM events AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.app_id = 8715964299802120000 | 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, --... |
movie_3 | Which country does Sasebo belong to? | 'Sasebo' is a city | SELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Sasebo' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | How many journals do not have a website? | do not have a website refers to HomePage = '' | SELECT COUNT(HomePage) FROM Journal WHERE HomePage = '' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
movie_3 | List the top 5 most-rented films. | film refers to title; most rented refers to MAX(inventory_id) | SELECT T.title FROM ( SELECT T3.title, COUNT(T2.inventory_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 5 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | Please calculate the total payment amount of customers who come from the USA. | USA is a country; total amount payment refers to SUM(amount); | SELECT SUM(T1.amount) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.country = 'USA' | 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 ... |
talkingdata | List down the app IDs under the category of game-Rowing . | null | SELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-Rowing' | 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, --... |
movie_3 | Who is the customer with the largest payment for rental films? | Who refers to first_name, last_name; the largest payment for rental refers to MAX(SUM(amount)) | SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T2.amount) AS num FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
talkingdata | Describe the number of app IDs and location of the event ID "79641". | location = longitude, latitude; | SELECT COUNT(T1.app_id), T2.longitude, T2.latitude FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 79641 GROUP BY T2.longitude, T2.latitude | 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, --... |
movie_3 | Provide the cast for the film "Jason trap". | 'Jason trap' is a title of a film; cast means actor; actor refers to first_name, last_name | SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'JASON TRAP' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | How many papers were preprinted between the years 1990 and 2000? | years 1990 and 2000 refers to Year BETWEEN '1990' AND '2000'; papers refers to COUNT(id) | SELECT COUNT(id) FROM Paper WHERE Year BETWEEN '1990' AND '2000' AND ConferenceId = 0 AND JournalId = 0 | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | What was the contact name for the check "NR157385"? | Contact name refers to customerName; | SELECT t2.contactFirstName, t2.contactLastName FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'NR157385' | 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 ... |
talkingdata | What is the ratio of male and female users of vivo X5pro model? | ratio = DIVIDE(SUM(gender = 'M' WHERE device_model = 'X5Pro'), SUM(gender = 'F' WHERE device_model = 'X5Pro')); male refers to gender = 'M'; female refers to gender = 'F'; vivo X5pro model refers to phone_brand = 'vivo' AND device_model = 'X5Pro'; | SELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T2.device_model = 'X5Pro' | 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, --... |
movie_3 | Which category is the most common? | most common category refers to MAX(COUNT(category.name)) | SELECT T.name FROM ( SELECT T2.name, COUNT(T2.name) AS num FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T2.name ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | List the short name of all conferences whose full name begins with International Symposium. | full name refers to FullName LIKE 'International Symposium%' | SELECT ShortName FROM Conference WHERE FullName LIKE 'International Symposium%' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | Please calculate the average total price of orders from Exoto Designs Vendor in 2005. | average total price = DIVIDE(SUM(MULTIPLY(quantityOrdered, priceEach))), COUNT(orderNumber)); year(orderDate) = '2005'; | SELECT SUM(T2.quantityOrdered * T2.priceEach) / COUNT(T3.orderNumber) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber WHERE T1.productVendor = 'Exoto Designs' AND STRFTIME('%Y', T3.orderDate) = '2005' | 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 ... |
talkingdata | What is the age of the oldest male user of the app? | oldest user refers to MAX(age); male refers to gender = 'M'; | SELECT MAX(age) 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, --... |
movie_3 | What are the addresses of the inactive customers? | inactive customers refers to active = 0; | SELECT T2.address FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.active = 0 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | List author affiliation for papers whose topic is Quantum Physics. | topic is Quantum Physics refers to Keyword = 'Quantum Physics' | SELECT T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Keyword = 'Quantum Physics' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | For the productline where the product No.S18_2949 was produced, what's the text description for that product line? | null | SELECT t1.textDescription FROM productlines AS t1 INNER JOIN products AS t2 ON t1.productLine = t2.productLine WHERE t2.productCode = 'S18_2949' | 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 ... |
talkingdata | List the phone brands and models of the users under 10 years of age. | models refers to device_model; under 10 years of age refers to age < 10; | SELECT T2.phone_brand, T2.device_model FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age < 10 | 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, --... |
movie_3 | Who is the manager of the store with the largest collection of films? | Who refers to first_name, last_name; the largest collection of films refers to MAX(film_id) | SELECT T.first_name, T.last_name FROM ( SELECT T3.first_name, T3.last_name, COUNT(T1.film_id) AS num FROM inventory AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.manager_staff_id = T3.staff_id GROUP BY T3.first_name, T3.last_name ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | What are the total payments of customers with no credit limit in 2003? | total payment refers to SUM(amount); no credit limit refers to creditLimit = 0; year(paymentDate) = '2003'; | SELECT SUM(amount) FROM payments WHERE STRFTIME('%Y', paymentDate) = '2003' AND customerNumber IN ( SELECT customerNumber FROM customers WHERE creditLimit = 0 ) | 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 ... |
talkingdata | How many OPPO users participated in events which were held around 12 AM on 1st May,2016? | OPPO refers to phone_brand = 'OPPO'; around 12 AM on 1st May, 2016 refers to timestamp is '2016-05-01' | SELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' AND STRFTIME('%Y-%m-%d', T1.`timestamp`) = '2016-05-01' | 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, --... |
movie_3 | How many films did a customer named Francis Sikes rent? | 'Francis Sikes' is a full name of a customer; full name refers to first_name, last_name; | SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'FRANCIS' AND T1.last_name = 'SIKES' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
video_games | List down at least five publishers of the games with number of sales less than 10000. | publishers refers to publisher_name; number of sales less than 10000 refers to num_sales < 0.1; | SELECT T.publisher_name FROM ( SELECT DISTINCT T5.publisher_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHE... | CREATE TABLE region_sales
(
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (region_id) references region(id),
region_id INTEGER default NULL, -- Example Values: `1`, `... |
car_retails | Where was the order No. 10383 shipped to? Show me the address. | Address comprises addressLine1 and addressLine2; | SELECT t2.addressLine1, t2.addressLine2 FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10383' | 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 ... |
talkingdata | How many females use ZUK Z1 phones in the age group under 23? | females refers to gender = 'F'; ZUK Z1 refers to phone_brand = 'ZUK' AND device_model = 'Z1'; under 23 refers to `group` = 'F23-' ; | 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.device_model = 'Z1' AND T1.`group` = 'F23-' AND T2.phone_brand = 'ZUK' | 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, --... |
movie_3 | List all the films with the word "Lacklusture" in their description. | films refers to title | SELECT title FROM film_text WHERE description LIKE '%Lacklusture%' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Identify by papers title those in which conferences have been published that do not have a website.. | do not have a website refers to HomePage IS NULL OR HomePage = '' | SELECT T2.Title FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.HomePage = '' AND T2.Title <> '' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | What was the total price of the products shipped to Rovelli Gifts Distributors Ltd. between 1/1/2003 and 12/31/2003? | Mini Gifts Distributors Ltd. Is the customer name; shippedDate between '2003-01-01' and '2003-12-31'; total price = MULTIPLY(quantityOrdered, priceEach); | SELECT T3.priceEach * T3.quantityOrdered FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber INNER JOIN orderdetails AS T3 ON T2.orderNumber = T3.orderNumber WHERE T1.customerName = 'Rovelli Gifts' AND T2.status = 'Shipped' AND STRFTIME('%Y', T2.shippedDate) = '2003' | 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 ... |
talkingdata | Which phone brand and model was used for event ID "6701"? | model refers to device_model; | SELECT T2.phone_brand, T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.event_id = 6701 | 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, --... |
movie_3 | What is the largest number of films rented per customer? | the largest number of films refers to MAX(rental_id) | SELECT COUNT(rental_id) FROM rental GROUP BY customer_id ORDER BY COUNT(rental_id) DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | List author name for articles that are preprinted but not published. | articles that are preprinted but not published refers to Year = 0 | SELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 0 | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | How many French customers does Gerard Hernandez take care of? | Gerakd Hermandez is an employee; French customer refers to customer from France where country = 'France' | SELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.country = 'France' AND t2.firstName = 'Gerard' AND t2.lastName = 'Hernandez' | 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 ... |
talkingdata | How many models does the VIVO phone brand released? | models refers to device_model; | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE 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, --... |
movie_3 | What are the ratings of the film featuring behind the scenes? | film featuring behind the scenes refers to special_features = 'Behind the Scenes' | SELECT rating FROM film WHERE special_features LIKE '%Behind the Scenes%' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Identify by conference full name all papers in which a journal was not published but a conference. | journal was not published but a conference refers to ConferenceId ! = 0 And JournalId = 0 Year ! = 0 | SELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.ConferenceId != 0 AND T1.JournalId = 0 AND T1.Year != 0 | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
talkingdata | List out the time of the event id 12. | time refers to timestamp; | SELECT timestamp FROM events WHERE event_id = 12 | 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, --... |
movie_3 | What is the most common first name among the customers? | the most common first name refers to MAX(COUNT(first_name)) | SELECT first_name FROM customer GROUP BY first_name ORDER BY COUNT(first_name) DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | What is the affiliation of the author writing in the journal 'A combined search for the standard model Higgs boson at s = 1.96 Â TeV'? | journal 'A combined search for the standard model Higgs boson at s = 1.96 Â TeV' refers to Title = 'A combined search for the standard model Higgs boson at s = 1.96 Â TeV' | SELECT T1.Affiliation FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'A combined search for the standard model Higgs boson at s = 1.96 Â TeV' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | How many French customers shipped 2 orders which have been cancelled? | French is a nationality of country = 'France'; cancelled orders refers to status = 'Cancelled'; | SELECT COUNT(T2.country) FROM orders AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.status = 'Shipped' AND T2.country = 'France' GROUP BY T2.customerNumber HAVING COUNT(T1.status) = 2 | 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 ... |
movie_3 | How many of the actors are named "Dan"? | 'Dan' is a first_name of an actor | SELECT COUNT(actor_id) FROM actor WHERE first_name = 'Dan' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
car_retails | If Dragon Souveniers, Ltd. aren't satisfied with their order and want to send a complain e-mail, which e-mail address should they send to? | E-mail address belongs to employee; customerName = 'Dragon Souveniers, Ltd.'; | SELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Dragon Souveniers, Ltd.' | 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 ... |
talkingdata | Among the HTC users, calculate the percentage of female users who are over 80. | HTC refers to phone_brand = 'HTC'; percentage = DIVIDE(SUM(gender = 'F' AND age > 80), COUNT(device_id)); female refers to gender = 'F'; over 80 refers to age > 80 | SELECT SUM(IIF(T1.gender = 'F' AND T1.age > 80, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'HTC' | 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, --... |
movie_3 | Which film has the longest duration? | film refers to the title; the longest duration refers to MAX(length) | SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film ) | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
video_games | When was the game ID 156 released? | when the game was released refers to release_year; | SELECT T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id WHERE T2.game_id = 156 | CREATE TABLE region_sales
(
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (region_id) references region(id),
region_id INTEGER default NULL, -- Example Values: `1`, `... |
movie_3 | How many films in English are for adults only? | English is a name of a language; for adults only refers to rating = 'NC-17' | SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English' AND T1.rating = 'NC-17' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
movie_3 | What is the percentage of documentary films? | documentary' is a name of a category; calculation = DIVIDE(SUM(name = 'Documentary'), COUNT(film_id)) * 100 | SELECT CAST(SUM(IIF(T2.name = 'Documentary', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | What is the name of the co-authors of the paper titled 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker'? | paper titled 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker' refers to Title = 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker' | SELECT T1.Name FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
talkingdata | Between device ID of "-9215352913819630000" and "-9222956879900150000", mention the age and gender of device user who participated more events. | more events refers to MAX(COUNT(event_id)); | SELECT T.age, T.gender FROM ( SELECT T2.age, T2.gender, COUNT(T1.device_id) AS num FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id BETWEEN -9215352913819630000 AND -9222956879900150000 GROUP BY T2.age, T2.gender ) 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, --... |
movie_3 | Please list any two films that Penelope Guiness acted in. | film refers to title of the film; 'Penelope Guiness' is a full name of an actor; full name refers to first_name, last_name | SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Penelope' AND T1.last_name = 'Guiness' LIMIT 2 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Identify by publication year in the paper database all journals that don't have short name. | don't have short name refers to ShortName is NULL OR ShortName = '' | SELECT DISTINCT T2.Year, FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.ShortName = '' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
car_retails | What is the average, highest and lowest annual payments collected between 1/1/2003 to 12/31/2005? | paymentDate BETWEEN '2003-01-01' AND '2005-12-31'; average annual payments = DIVIDE(SUM(amount), 3); | SELECT CAST(SUM(T1.amount) AS REAL) / 3, MAX(T1.amount) , MIN(T1.amount) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.paymentDate BETWEEN '2003-01-01' AND '2005-12-31' | 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 ... |
talkingdata | How many devices belong to model "A51"? | model refers to device_model; device_model = 'A51'; | SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51' | 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, --... |
movie_3 | Who are the actors that act in the ACADEMY DINOSAUR film? | Who are the actors refers to full name; full name refers to first_name, last_name; 'ACADEMY DINOSAUR' is a title of a film | SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'ACADEMY DINOSAUR' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | Indicate the name of all the journals published in the paper database in the year 2001. | name of all the journals refers to FullName | SELECT T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year = 2001 AND T1.ConferenceId > 0 AND T1.JournalId > 0 | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
talkingdata | How many female users belong to the age group of 27 to 28? | female refers to gender = 'F'; age group of 27 to 28 refers to `group` = 'F27-28'; | SELECT COUNT(device_id) FROM gender_age WHERE `group` = 'F27-28' 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, --... |
movie_3 | How many English films have a duration of over 50 minutes and the cost of replacement are under 10.99? | English is a name of a language; duration of over 50 minutes refers to length > 50; cost of replacement are under 10.99 refers to replacement_cost < 10.99 | SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English' AND T1.length > 50 AND T1.replacement_cost < 10.99 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
authors | What is the full name of the journals that are published in the database papers whose topic is Sustainability? | topic is Sustainability refers to Keyword = 'Sustainability' | SELECT T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Keyword = 'Sustainability' | CREATE TABLE Journal
(
FullName TEXT, --
ShortName TEXT, --
HomePage TEXT, --
Id INTEGER constraint Journal_pk primary key,
);
CREATE TABLE Conference
(
ShortName TEXT, --
Id INTEGER constraint Conference_pk primary key,
HomePage TEXT, --
FullName TEXT, --
);
CREATE TABLE Paper
(
Title TEXT, -- ... |
talkingdata | How many labels belong to the game-card category? | labels refers to label_id; | SELECT COUNT(label_id) FROM label_categories WHERE category = 'game-card' | 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, --... |
movie_3 | Who is the customer that is active and lives at 1795 Santiago de Compostela Way, Texas? | active refers to active = 1; '1795 Santiago de Compostela Way' is an address; Texas is a district; who refers to first_name, last_name | SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T2.address = '1795 Santiago de Compostela Way' AND T1.active = 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
video_games | Calculate the total number of sales in North America. | total number of sales = MULTIPLY(SUM(num_sales), 100000); North America refers to region_name = 'North America'; | SELECT SUM(T2.num_sales) * 100000 AS nums FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'North America' | CREATE TABLE region_sales
(
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (game_platform_id) references game_platform(id),
foreign key (region_id) references region(id),
region_id INTEGER default NULL, -- Example Values: `1`, `... |
car_retails | For the product No. S18_3482 in the Order No.10108, how much discount did the customer have? | DIVIDE(SUBTRACT(MSRP, priceEach)), MSRP); product No. S18_3482 refers to productCode = 'S18_3482' | SELECT (t1.MSRP - t2.priceEach) / t1.MSRP FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productCode = 'S18_3482' AND t2.orderNumber = '10108' | 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 ... |
talkingdata | How many active users are there in the event? | active refers to is_active = 1; | SELECT COUNT(app_id) FROM app_events WHERE is_active = 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, --... |
movie_3 | Which district does Maria Miller live in? | 'Maria Miller' is a name of a customer; full name refers to first_name, last_name | SELECT T2.district FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller' | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.