db_id stringlengths 4 28 | question stringlengths 34 304 | evidence stringlengths 0 265 | SQL stringlengths 39 449 | schema stringlengths 352 37.3k |
|---|---|---|---|---|
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 genre
(
id INTEGER not null
primary key,
genre_name TEXT default NULL
);
CREATE TABLE game
(
id INTEGER not null
primary key,
genre_id INTEGER default NULL,
game_name TEXT default NULL,
foreign key (genre_id) references genre(id)
);
C... |
retail_complains | What is the full address of the customers who, having received a timely response from the company, have dispute about that response? | full address = address_1, address_2; received a timely response refers to Timely response? = 'Yes'; have dispute refers to "Consumer disputed?" = 'Yes'; | SELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'Yes' AND T2.`Consumer disputed?` = 'Yes' | CREATE TABLE state
(
StateCode TEXT
constraint state_pk
primary key,
State TEXT,
Region TEXT
);
CREATE TABLE callcenterlogs
(
"Date received" DATE,
"Complaint ID" TEXT,
"rand client" TEXT,
phonefinal TEXT,
"vru+line" TEXT,
call_id INTEG... |
disney | How many movies did Wolfgang Reitherman direct? | Wolfgang Reitherman refers director = 'Wolfgang Reitherman'; | SELECT COUNT(name) FROM director WHERE director = 'Wolfgang Reitherman' | CREATE TABLE characters
(
movie_title TEXT
primary key,
release_date TEXT,
hero TEXT,
villian TEXT,
song TEXT,
foreign key (hero) references "voice-actors"(character)
);
CREATE TABLE director
(
name TEXT
primary key,
director TEXT,
fo... |
legislator | How many legislators are not senator? | not senator refers to class is null; | SELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL | CREATE TABLE current
(
ballotpedia_id TEXT,
bioguide_id TEXT,
birthday_bio DATE,
cspan_id REAL,
fec_id TEXT,
first_name TEXT,
gender_bio TEXT,
google_entity_id_id TEXT,
govtrack_id INTEGER,
house_history_id ... |
food_inspection_2 | How many inspections done by Lisa Tillman ended up with the result of "Out of Business"? | the result of "Out of Business" refers to results = 'Out of Business' | SELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND T1.results = 'Out of Business' | CREATE TABLE employee
(
employee_id INTEGER
primary key,
first_name TEXT,
last_name TEXT,
address TEXT,
city TEXT,
state TEXT,
zip INTEGER,
phone TEXT,
title TEXT,
salary INTEGER,
supervisor INTEGER,
foreign key (s... |
mondial_geo | In which group of islands is Rinjani Mountain located? | SELECT T1.Islands FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Name = 'Rinjani' | CREATE TABLE IF NOT EXISTS "borders"
(
Country1 TEXT default '' not null
constraint borders_ibfk_1
references country,
Country2 TEXT default '' not null
constraint borders_ibfk_2
references country,
Length REAL,
primary key (Country1, Country2)
);
CREATE TABLE I... | |
shakespeare | Give the character's ID of the character that said the paragraph "O my poor brother! and so perchance may he be." | "O my poor brother! and so perchance may he be." refers to PlainText = 'O my poor brother! and so perchance may he be.' | SELECT character_id FROM paragraphs WHERE PlainText = 'O my poor brother! and so perchance may he be.' | CREATE TABLE IF NOT EXISTS "chapters"
(
id INTEGER
primary key autoincrement,
Act INTEGER not null,
Scene INTEGER not null,
Description TEXT not null,
work_id INTEGER not null
references works
);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE IF NO... |
food_inspection_2 | Calculate the average salary for employees who did inspection on License Re-Inspection. | inspection on License Re-Inspection refers to inspection_type = 'License Re-Inspection'; average salary = avg(salary) | SELECT AVG(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_type = 'License Re-Inspection' | CREATE TABLE employee
(
employee_id INTEGER
primary key,
first_name TEXT,
last_name TEXT,
address TEXT,
city TEXT,
state TEXT,
zip INTEGER,
phone TEXT,
title TEXT,
salary INTEGER,
supervisor INTEGER,
foreign key (s... |
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 film_text
(
film_id INTEGER not null
primary key,
title TEXT not null,
description TEXT null
);
CREATE TABLE IF NOT EXISTS "actor"
(
actor_id INTEGER
primary key autoincrement,
first_name TEXT not null,
last_nam... |
car_retails | From which branch does the sales representative employee who made the most sales in 2005? Please indicates its full address and phone number. | orderDate between '2005-01-01' and '2005-12-31'; full address = addressLine1+addressLine2; | SELECT T3.addressLine1, T3.addressLine2, T3.phone FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber INNER JOIN customers AS T3 ON T2.customerNumber = T3.customerNumber INNER JOIN employees AS T4 ON T3.salesRepEmployeeNumber = T4.employeeNumber INNER JOIN offices AS T5 ON T4.officeCode =... | CREATE TABLE offices
(
officeCode TEXT not null
primary key,
city TEXT not null,
phone TEXT not null,
addressLine1 TEXT not null,
addressLine2 TEXT,
state TEXT,
country TEXT not null,
postalCode TEXT not null,
territory TEXT not null
);
CREATE... |
food_inspection | Provide the name of the business which had the most number of inspections because of complaint. | the most number of inspections because of complaint refers to type = 'Complaint' where MAX(business_id); | SELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Complaint' GROUP BY T2.name ORDER BY COUNT(T1.business_id) DESC LIMIT 1 | CREATE TABLE `businesses` (
`business_id` INTEGER NOT NULL,
`name` TEXT NOT NULL,
`address` TEXT DEFAULT NULL,
`city` TEXT DEFAULT NULL,
`postal_code` TEXT DEFAULT NULL,
`latitude` REAL DEFAULT NULL,
`longitude` REAL DEFAULT NULL,
`phone_number` INTEGER DEFAULT NULL,
`tax_code` TEXT DEFAULT NULL,
`b... |
superstore | What are the names of the products that were ordered by Alejandro Grove? | ordered by Alejandro Grove refers to "Customer Name" = 'Alejandro Grove'; names of the products refers to "Product Name" | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Alejandro Grove' | CREATE TABLE people
(
"Customer ID" TEXT,
"Customer Name" TEXT,
Segment TEXT,
Country TEXT,
City TEXT,
State TEXT,
"Postal Code" INTEGER,
Region TEXT,
primary key ("Customer ID", Region)
);
CREATE TABLE product
(
"Product ID" TE... |
regional_sales | Name the product that was registered in the sales order 'SO - 0005951'. | sales order 'SO - 0005951' refers to OrderNumber = 'SO - 0005951'; product refers to Product Name | SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.OrderNumber = 'SO - 0005951' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE T IS NOT NULL | CREATE TABLE Customers
(
CustomerID INTEGER
constraint Customers_pk
primary key,
"Customer Names" TEXT
);
CREATE TABLE Products
(
ProductID INTEGER
constraint Products_pk
primary key,
"Product Name" TEXT
);
CREATE TABLE Regions
(
StateCode TEXT
... |
talkingdata | How many app IDs were included under science fiction category? | SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id WHERE T1.category = 'science fiction' | CREATE TABLE `app_all`
(
`app_id` INTEGER NOT NULL,
PRIMARY KEY (`app_id`)
);
CREATE TABLE `app_events` (
`event_id` INTEGER NOT NULL,
`app_id` INTEGER NOT NULL,
`is_installed` INTEGER NOT NULL,
`is_active` INTEGER NOT NULL,
PRIMARY KEY (`event_id`,`app_id`),
FOREIGN KEY (`event_id`) REFERENCES `eve... | |
video_games | How many games did BMG Interactive Entertainment release in 2012? | BMG Interactive Entertainment refers to publisher_name = 'BMG Interactive Entertainment'; release in 2012 refers to release_year = 2012; | SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = 2012 | CREATE TABLE genre
(
id INTEGER not null
primary key,
genre_name TEXT default NULL
);
CREATE TABLE game
(
id INTEGER not null
primary key,
genre_id INTEGER default NULL,
game_name TEXT default NULL,
foreign key (genre_id) references genre(id)
);
C... |
ice_hockey_draft | How many players were born in 1982 and have a height above 182cm? | born in 1982 refers to birthyear = 1982; height above 182cm refers to height_in_cm > 182 ; | SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T1.height_in_cm > 182 AND strftime('%Y', T2.birthdate) = '1982' | CREATE TABLE height_info
(
height_id INTEGER
primary key,
height_in_cm INTEGER,
height_in_inch TEXT
);
CREATE TABLE weight_info
(
weight_id INTEGER
primary key,
weight_in_kg INTEGER,
weight_in_lbs INTEGER
);
CREATE TABLE PlayerInfo
(
ELITEID INTE... |
works_cycles | What is the highest profit on net for a product? | profit on net = subtract(LastReceiptCost, StandardPrice) | SELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY LastReceiptCost - StandardPrice DESC LIMIT 1 | CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE CountryRegion
(
CountryRegionCode TEXT not null
primary key,
Name TEXT not null
unique,
ModifiedDate DATETIME default current_timestamp not null
);
CREATE TABLE Culture
... |
simpson_episodes | State the name of director for the 'Treehouse of Horror XIX' episode. | "Treehouse of Horror XIX" is the title of episode; 'director' is the role of person; name refers to person | SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director'; | CREATE TABLE IF NOT EXISTS "Episode"
(
episode_id TEXT
constraint Episode_pk
primary key,
season INTEGER,
episode INTEGER,
number_in_series INTEGER,
title TEXT,
summary TEXT,
air_date TEXT,
episode_image TEXT,
... |
movies_4 | How many female characters are there in the movie "Spider-Man 3"? | female characters refer to gender = 'Female'; "Spider-Man 3" refers to title = 'Spider-Man 3' | SELECT COUNT(*) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Spider-Man 3' AND T3.gender = 'Female' | CREATE TABLE country
(
country_id INTEGER not null
primary key,
country_iso_code TEXT default NULL,
country_name TEXT default NULL
);
CREATE TABLE department
(
department_id INTEGER not null
primary key,
department_name TEXT default NULL
);
CREATE TABLE gender
(
... |
food_inspection_2 | List down the dba name of restaurants that were inspected due to license. | inspected due to license refers to inspection_type = 'License' | SELECT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'License' | CREATE TABLE employee
(
employee_id INTEGER
primary key,
first_name TEXT,
last_name TEXT,
address TEXT,
city TEXT,
state TEXT,
zip INTEGER,
phone TEXT,
title TEXT,
salary INTEGER,
supervisor INTEGER,
foreign key (s... |
cars | Which country produced the car with the lowest price? | the lowest price refers to min(price) | SELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.price ASC LIMIT 1 | CREATE TABLE country
(
origin INTEGER
primary key,
country TEXT
);
CREATE TABLE price
(
ID INTEGER
primary key,
price REAL
);
CREATE TABLE data
(
ID INTEGER
primary key,
mpg REAL,
cylinders INTEGER,
displacement REAL,
hors... |
student_loan | Please list the departments the students are absent from school for 9 months are in. | absent from school for 9 months refers to month = 9 | SELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9 | CREATE TABLE bool
(
"name" TEXT default '' not null
primary key
);
CREATE TABLE person
(
"name" TEXT default '' not null
primary key
);
CREATE TABLE disabled
(
"name" TEXT default '' not null
primary key,
foreign key ("name") references person ("name")
on update c... |
legislator | What is the ratio between male and female legislators? | ratio = DIVIDE(SUM(gender_bio = 'M'), SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F' | SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical | CREATE TABLE current
(
ballotpedia_id TEXT,
bioguide_id TEXT,
birthday_bio DATE,
cspan_id REAL,
fec_id TEXT,
first_name TEXT,
gender_bio TEXT,
google_entity_id_id TEXT,
govtrack_id INTEGER,
house_history_id ... |
olympics | Calculate the bmi of the competitor id 147420. | DIVIDE(weight), MULTIPLY(height, height) where id = 147420; | SELECT CAST(T1.weight AS REAL) / (T1.height * T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 147420 | CREATE TABLE city
(
id INTEGER not null
primary key,
city_name TEXT default NULL
);
CREATE TABLE games
(
id INTEGER not null
primary key,
games_year INTEGER default NULL,
games_name TEXT default NULL,
season TEXT default NULL
);
CREATE TABLE ga... |
hockey | For the goalie who had the most shutouts in 2010, what's his catching hand? | the most shutouts refer to MAX(SHO); catching hand refers to shootCatch; year = 2010; | SELECT T2.shootCatch FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 GROUP BY T2.shootCatch ORDER BY SUM(T1.SHO) DESC LIMIT 1 | CREATE TABLE AwardsMisc
(
name TEXT not null
primary key,
ID TEXT,
award TEXT,
year INTEGER,
lgID TEXT,
note TEXT
);
CREATE TABLE HOF
(
year INTEGER,
hofID TEXT not null
primary key,
name TEXT,
category TEXT
);
CREATE TABLE Teams
(
year ... |
public_review_platform | Which city has more Yelp_Business that's more appealing to users, Scottsdale or Anthem? | more appealing to users refers to MAX(review_count); | SELECT city FROM Business ORDER BY review_count DESC LIMIT 1 | CREATE TABLE Attributes
(
attribute_id INTEGER
constraint Attributes_pk
primary key,
attribute_name TEXT
);
CREATE TABLE Categories
(
category_id INTEGER
constraint Categories_pk
primary key,
category_name TEXT
);
CREATE TABLE Compliments
(
compliment_id ... |
works_cycles | What is the thumbnail photo file for the product with the id "979"? | thumbnail photo file refers to ThumbnailPhotoFileName; | SELECT T2.ThumbnailPhotoFileName FROM ProductProductPhoto AS T1 INNER JOIN ProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.ProductID = 979 | CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE CountryRegion
(
CountryRegionCode TEXT not null
primary key,
Name TEXT not null
unique,
ModifiedDate DATETIME default current_timestamp not null
);
CREATE TABLE Culture
... |
End of preview. Expand in Data Studio
- Downloads last month
- 57
Size of downloaded dataset files:
98.9 kB
Size of the auto-converted Parquet files:
98.9 kB
Number of rows:
200