db_id
large_stringclasses
40 values
query
large_stringlengths
22
608
query_toks
listlengths
4
75
query_toks_no_value
listlengths
4
101
question
large_stringlengths
22
185
question_toks
listlengths
5
36
context
large_stringclasses
40 values
warehouse_1
SELECT count(DISTINCT CONTENTS) , warehouse FROM boxes GROUP BY warehouse
[ "SELECT", "count", "(", "DISTINCT", "CONTENTS", ")", ",", "warehouse", "FROM", "boxes", "GROUP", "BY", "warehouse" ]
[ "select", "count", "(", "distinct", "contents", ")", ",", "warehouse", "from", "boxes", "group", "by", "warehouse" ]
How many different types of contents are stored in each warehouse?
[ "How", "many", "different", "types", "of", "contents", "are", "stored", "in", "each", "warehouse", "?" ]
CREATE TABLE Warehouses ( Code NUMBER PRIMARY KEY, Location TEXT, Capacity NUMBER ); CREATE TABLE Boxes ( Code TEXT PRIMARY KEY, Contents TEXT, Value NUMBER, Warehouse NUMBER, FOREIGN KEY (Warehouse) REFERENCES Warehouses(Code) );
planet_1
SELECT T2.Name , count(*) FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender = T2.AccountNumber GROUP BY T1.Sender ORDER BY count(*) DESC LIMIT 1;
[ "SELECT", "T2.Name", ",", "count", "(", "*", ")", "FROM", "PACKAGE", "AS", "T1", "JOIN", "Client", "AS", "T2", "ON", "T1.Sender", "=", "T2.AccountNumber", "GROUP", "BY", "T1.Sender", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1", ";" ]
[ "select", "t2", ".", "name", ",", "count", "(", "*", ")", "from", "package", "as", "t1", "join", "client", "as", "t2", "on", "t1", ".", "sender", "=", "t2", ".", "accountnumber", "group", "by", "t1", ".", "sender", "order", "by", "count", "(", "*",...
What is the name of the client who sent the most packages and how many were there?
[ "What", "is", "the", "name", "of", "the", "client", "who", "sent", "the", "most", "packages", "and", "how", "many", "were", "there", "?" ]
CREATE TABLE Employee ( EmployeeID NUMBER PRIMARY KEY, Name TEXT, Position TEXT, Salary NUMBER, Remarks TEXT ); CREATE TABLE Planet ( PlanetID NUMBER PRIMARY KEY, Name TEXT, Coordinates NUMBER ); CREATE TABLE Shipment ( ShipmentID NUMBER PRIMARY KEY, Date TIME, Manager NUMBER, Planet NUMBER, F...
soccer_3
SELECT Country FROM player WHERE Earnings > 1400000 INTERSECT SELECT Country FROM player WHERE Earnings < 1100000
[ "SELECT", "Country", "FROM", "player", "WHERE", "Earnings", ">", "1400000", "INTERSECT", "SELECT", "Country", "FROM", "player", "WHERE", "Earnings", "<", "1100000" ]
[ "select", "country", "from", "player", "where", "earnings", ">", "value", "intersect", "select", "country", "from", "player", "where", "earnings", "<", "value" ]
Show the country of players with earnings more than 1400000 and players with earnings less than 1100000.
[ "Show", "the", "country", "of", "players", "with", "earnings", "more", "than", "1400000", "and", "players", "with", "earnings", "less", "than", "1100000", "." ]
CREATE TABLE club ( Club_ID NUMBER PRIMARY KEY, Name TEXT, Manager TEXT, Captain TEXT, Manufacturer TEXT, Sponsor TEXT ); CREATE TABLE player ( Player_ID NUMBER PRIMARY KEY, Name TEXT, Country TEXT, Earnings NUMBER, Events_number NUMBER, Wins_count NUMBER, Club_ID NUMBER, FOREIGN KEY (Club_I...
pilot_1
SELECT pilot_name FROM PilotSkills WHERE age < 35 AND plane_name = 'Piper Cub'
[ "SELECT", "pilot_name", "FROM", "PilotSkills", "WHERE", "age", "<", "35", "AND", "plane_name", "=", "'Piper", "Cub", "'" ]
[ "select", "pilot_name", "from", "pilotskills", "where", "age", "<", "value", "and", "plane_name", "=", "value" ]
What are the names of pilots who are younger than 35 and have a plane named Piper Cub?
[ "What", "are", "the", "names", "of", "pilots", "who", "are", "younger", "than", "35", "and", "have", "a", "plane", "named", "Piper", "Cub", "?" ]
CREATE TABLE PilotSkills ( pilot_name TEXT PRIMARY KEY, plane_name TEXT, age NUMBER, FOREIGN KEY (plane_name) REFERENCES Hangar(plane_name) ); CREATE TABLE Hangar ( plane_name TEXT PRIMARY KEY, location TEXT );
movie_2
SELECT name FROM movietheaters GROUP BY name HAVING count(*) >= 1
[ "SELECT", "name", "FROM", "movietheaters", "GROUP", "BY", "name", "HAVING", "count", "(", "*", ")", ">", "=", "1" ]
[ "select", "name", "from", "movietheaters", "group", "by", "name", "having", "count", "(", "*", ")", ">", "=", "value" ]
Find the name of theaters that has at least one movie playing.
[ "Find", "the", "name", "of", "theaters", "that", "has", "at", "least", "one", "movie", "playing", "." ]
CREATE TABLE Movies ( Code NUMBER PRIMARY KEY, Title TEXT, Rating TEXT ); CREATE TABLE MovieTheaters ( Code NUMBER PRIMARY KEY, Name TEXT, Movie NUMBER, FOREIGN KEY (Movie) REFERENCES Movies(Code) );
aan_1
SELECT count(*) FROM Paper
[ "SELECT", "count", "(", "*", ")", "FROM", "Paper" ]
[ "select", "count", "(", "*", ")", "from", "paper" ]
How many papers do we have?
[ "How", "many", "papers", "do", "we", "have", "?" ]
CREATE TABLE Affiliation ( affiliation_id NUMBER PRIMARY KEY, name TEXT, address TEXT ); CREATE TABLE Author ( author_id NUMBER PRIMARY KEY, name TEXT, email TEXT ); CREATE TABLE Author_list ( paper_id TEXT PRIMARY KEY, author_id NUMBER, affiliation_id NUMBER, FOREIGN KEY (affiliation_id) REFERENCES...
planet_1
select count(*) from employee where employeeid not in ( select t2.employeeid from has_clearance as t1 join employee as t2 on t1.employee = t2.employeeid join planet as t3 on t1.planet = t3.planetid where t3.name = "mars" );
[ "select", "count", "(", "*", ")", "from", "employee", "where", "employeeid", "not", "in", "(", "select", "t2.employeeid", "from", "has_clearance", "as", "t1", "join", "employee", "as", "t2", "on", "t1.employee", "=", "t2.employeeid", "join", "planet", "as", ...
[ "select", "count", "(", "*", ")", "from", "employee", "where", "employeeid", "not", "in", "(", "select", "t2", ".", "employeeid", "from", "has_clearance", "as", "t1", "join", "employee", "as", "t2", "on", "t1", ".", "employee", "=", "t2", ".", "employeei...
What is the number of employees that do not have clearance on Mars ?
[ "What", "is", "the", "number", "of", "employees", "that", "do", "not", "have", "clearance", "on", "Mars", "?" ]
CREATE TABLE Employee ( EmployeeID NUMBER PRIMARY KEY, Name TEXT, Position TEXT, Salary NUMBER, Remarks TEXT ); CREATE TABLE Planet ( PlanetID NUMBER PRIMARY KEY, Name TEXT, Coordinates NUMBER ); CREATE TABLE Shipment ( ShipmentID NUMBER PRIMARY KEY, Date TIME, Manager NUMBER, Planet NUMBER, F...
bakery_1
SELECT food , avg(price) , max(price) , min(price) FROM goods GROUP BY food
[ "SELECT", "food", ",", "avg", "(", "price", ")", ",", "max", "(", "price", ")", ",", "min", "(", "price", ")", "FROM", "goods", "GROUP", "BY", "food" ]
[ "select", "food", ",", "avg", "(", "price", ")", ",", "max", "(", "price", ")", ",", "min", "(", "price", ")", "from", "goods", "group", "by", "food" ]
What are the average, minimum and maximum prices for each food?
[ "What", "are", "the", "average", ",", "minimum", "and", "maximum", "prices", "for", "each", "food", "?" ]
CREATE TABLE customers ( Id NUMBER PRIMARY KEY, LastName TEXT, FirstName TEXT ); CREATE TABLE goods ( Id TEXT PRIMARY KEY, Flavor TEXT, Food TEXT, Price NUMBER ); CREATE TABLE items ( Receipt NUMBER PRIMARY KEY, Ordinal NUMBER, Item TEXT, FOREIGN KEY (Item) REFERENCES goods(Id) ); CREATE TABLE rec...
car_road_race
SELECT count(*) FROM race
[ "SELECT", "count", "(", "*", ")", "FROM", "race" ]
[ "select", "count", "(", "*", ")", "from", "race" ]
How many races are there?
[ "How", "many", "races", "are", "there", "?" ]
CREATE TABLE driver ( Driver_ID NUMBER PRIMARY KEY, Driver_Name TEXT, Entrant TEXT, Constructor TEXT, Chassis TEXT, Engine TEXT, Age NUMBER ); CREATE TABLE race ( Road NUMBER PRIMARY KEY, Driver_ID NUMBER, Race_Name TEXT, Pole_Position TEXT, Fastest_Lap TEXT, Winning_driver TEXT, Winning_tea...
book_1
SELECT T1.title FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn = T2.isbn JOIN Author AS T3 ON T2.Author = T3.idAuthor WHERE T3.name LIKE "%Plato%"
[ "SELECT", "T1.title", "FROM", "Book", "AS", "T1", "JOIN", "Author_book", "AS", "T2", "ON", "T1.isbn", "=", "T2.isbn", "JOIN", "Author", "AS", "T3", "ON", "T2.Author", "=", "T3.idAuthor", "WHERE", "T3.name", "LIKE", "``", "%", "Plato", "%", "''" ]
[ "select", "t1", ".", "title", "from", "book", "as", "t1", "join", "author_book", "as", "t2", "on", "t1", ".", "isbn", "=", "t2", ".", "isbn", "join", "author", "as", "t3", "on", "t2", ".", "author", "=", "t3", ".", "idauthor", "where", "t3", ".", ...
What are the titles of all books written by an author with a name that contains Plato?
[ "What", "are", "the", "titles", "of", "all", "books", "written", "by", "an", "author", "with", "a", "name", "that", "contains", "Plato", "?" ]
CREATE TABLE Client ( IdClient TEXT PRIMARY KEY, Name TEXT, Address TEXT, NumCC TEXT ); CREATE TABLE Orders ( IdOrder TEXT PRIMARY KEY, IdClient TEXT, DateOrder TIME, DateExped TIME ); CREATE TABLE Author ( idAuthor NUMBER PRIMARY KEY, Name TEXT ); CREATE TABLE Book ( ISBN TEXT PRIMARY KEY, Titl...
restaurant_bills
SELECT count(*) FROM customer
[ "SELECT", "count", "(", "*", ")", "FROM", "customer" ]
[ "select", "count", "(", "*", ")", "from", "customer" ]
How many customers are there?
[ "How", "many", "customers", "are", "there", "?" ]
CREATE TABLE customer ( Customer_ID NUMBER PRIMARY KEY, Name TEXT, Nationality TEXT, Card_Credit NUMBER, Level_of_Membership NUMBER ); CREATE TABLE branch ( Branch_ID NUMBER PRIMARY KEY, Manager TEXT, Years_opened NUMBER, Location_of_office TEXT ); CREATE TABLE customer_order ( Customer_ID NUMBER PR...