Datasets:
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 |
|---|---|---|---|---|---|---|
movie_2 | SELECT T1.title FROM movies AS T1 JOIN movietheaters AS T2 ON T1.code = T2.movie WHERE T2.name = 'Odeon' | [
"SELECT",
"T1.title",
"FROM",
"movies",
"AS",
"T1",
"JOIN",
"movietheaters",
"AS",
"T2",
"ON",
"T1.code",
"=",
"T2.movie",
"WHERE",
"T2.name",
"=",
"'Odeon",
"'"
] | [
"select",
"t1",
".",
"title",
"from",
"movies",
"as",
"t1",
"join",
"movietheaters",
"as",
"t2",
"on",
"t1",
".",
"code",
"=",
"t2",
".",
"movie",
"where",
"t2",
".",
"name",
"=",
"value"
] | What are the movie titles for ones that are played in the Odeon theater? | [
"What",
"are",
"the",
"movie",
"titles",
"for",
"ones",
"that",
"are",
"played",
"in",
"the",
"Odeon",
"theater",
"?"
] | 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)
); |
boat_1 | SELECT AVG(age) FROM Sailors WHERE rating = 7 | [
"SELECT",
"AVG",
"(",
"age",
")",
"FROM",
"Sailors",
"WHERE",
"rating",
"=",
"7"
] | [
"select",
"avg",
"(",
"age",
")",
"from",
"sailors",
"where",
"rating",
"=",
"value"
] | What is average age of all sailors who have a rating of 7? | [
"What",
"is",
"average",
"age",
"of",
"all",
"sailors",
"who",
"have",
"a",
"rating",
"of",
"7",
"?"
] | CREATE TABLE Sailors (
sid NUMBER PRIMARY KEY,
name TEXT,
rating NUMBER,
age NUMBER
);
CREATE TABLE Boats (
bid NUMBER PRIMARY KEY,
name TEXT,
color TEXT
);
CREATE TABLE Reserves (
sid NUMBER,
bid NUMBER,
day TEXT,
FOREIGN KEY (bid) REFERENCES Boats(bid),
FOREIGN KEY (sid) REFERENCES Sailors(sid... |
car_racing | SELECT avg(T2.age) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T1.Official_native_language = "English" | [
"SELECT",
"avg",
"(",
"T2.age",
")",
"FROM",
"country",
"AS",
"T1",
"JOIN",
"driver",
"AS",
"T2",
"ON",
"T1.Country_ID",
"=",
"T2.Country",
"WHERE",
"T1.Official_native_language",
"=",
"``",
"English",
"''"
] | [
"select",
"avg",
"(",
"t2",
".",
"age",
")",
"from",
"country",
"as",
"t1",
"join",
"driver",
"as",
"t2",
"on",
"t1",
".",
"country_id",
"=",
"t2",
".",
"country",
"where",
"t1",
".",
"official_native_language",
"=",
"value"
] | What is the average age of drivers from countries with official native language "English" | [
"What",
"is",
"the",
"average",
"age",
"of",
"drivers",
"from",
"countries",
"with",
"official",
"native",
"language",
"``",
"English",
"''"
] | CREATE TABLE country (
Country_Id NUMBER PRIMARY KEY,
Country TEXT,
Capital TEXT,
Official_native_language TEXT,
Regoin TEXT
);
CREATE TABLE team (
Team_ID NUMBER PRIMARY KEY,
Team TEXT,
Make TEXT,
Manager TEXT,
Sponsor TEXT,
Car_Owner TEXT
);
CREATE TABLE driver (
Driver_ID NUMBER PRIMARY KEY,
... |
real_estate_rentals | SELECT first_name , middle_name , last_name FROM Properties AS T1 JOIN Users AS T2 ON T1.owner_user_id = T2.user_id WHERE T1.property_address_id = T2.user_address_id; | [
"SELECT",
"first_name",
",",
"middle_name",
",",
"last_name",
"FROM",
"Properties",
"AS",
"T1",
"JOIN",
"Users",
"AS",
"T2",
"ON",
"T1.owner_user_id",
"=",
"T2.user_id",
"WHERE",
"T1.property_address_id",
"=",
"T2.user_address_id",
";"
] | [
"select",
"first_name",
",",
"middle_name",
",",
"last_name",
"from",
"properties",
"as",
"t1",
"join",
"users",
"as",
"t2",
"on",
"t1",
".",
"owner_user_id",
"=",
"t2",
".",
"user_id",
"where",
"t1",
".",
"property_address_id",
"=",
"t2",
".",
"user_address... | What are the first, middle and last names of users who own the property they live in? | [
"What",
"are",
"the",
"first",
",",
"middle",
"and",
"last",
"names",
"of",
"users",
"who",
"own",
"the",
"property",
"they",
"live",
"in",
"?"
] | CREATE TABLE Ref_Age_Categories (
age_category_code TEXT PRIMARY KEY,
age_category_description TEXT
);
CREATE TABLE Ref_Property_Types (
property_type_code TEXT PRIMARY KEY,
property_type_description TEXT
);
CREATE TABLE Ref_Room_Types (
room_type_code TEXT PRIMARY KEY,
room_type_description TEXT
);
CREATE ... |
car_road_race | SELECT T1.Driver_Name , COUNT(*) FROM driver AS T1 JOIN race AS T2 ON T1.Driver_ID = T2.Driver_ID GROUP BY T1.Driver_ID | [
"SELECT",
"T1.Driver_Name",
",",
"COUNT",
"(",
"*",
")",
"FROM",
"driver",
"AS",
"T1",
"JOIN",
"race",
"AS",
"T2",
"ON",
"T1.Driver_ID",
"=",
"T2.Driver_ID",
"GROUP",
"BY",
"T1.Driver_ID"
] | [
"select",
"t1",
".",
"driver_name",
",",
"count",
"(",
"*",
")",
"from",
"driver",
"as",
"t1",
"join",
"race",
"as",
"t2",
"on",
"t1",
".",
"driver_id",
"=",
"t2",
".",
"driver_id",
"group",
"by",
"t1",
".",
"driver_id"
] | Please show the names of drivers and the number of races they participate in. | [
"Please",
"show",
"the",
"names",
"of",
"drivers",
"and",
"the",
"number",
"of",
"races",
"they",
"participate",
"in",
"."
] | 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... |
address_1 | SELECT count(*) FROM City AS T1 JOIN Student AS T2 ON T1.city_code = T2.city_code WHERE T1.country = "CHINA" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"City",
"AS",
"T1",
"JOIN",
"Student",
"AS",
"T2",
"ON",
"T1.city_code",
"=",
"T2.city_code",
"WHERE",
"T1.country",
"=",
"``",
"CHINA",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"city",
"as",
"t1",
"join",
"student",
"as",
"t2",
"on",
"t1",
".",
"city_code",
"=",
"t2",
".",
"city_code",
"where",
"t1",
".",
"country",
"=",
"value"
] | Count the number of students living in China. | [
"Count",
"the",
"number",
"of",
"students",
"living",
"in",
"China",
"."
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
cre_Students_Information_Systems | SELECT T1.bio_data , T1.student_id FROM Students AS T1 JOIN Classes AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) >= 2 UNION SELECT T1.bio_data , T1.student_id FROM Students AS T1 JOIN Detention AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id HAVING count(*) < 2 | [
"SELECT",
"T1.bio_data",
",",
"T1.student_id",
"FROM",
"Students",
"AS",
"T1",
"JOIN",
"Classes",
"AS",
"T2",
"ON",
"T1.student_id",
"=",
"T2.student_id",
"GROUP",
"BY",
"T1.student_id",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2",
"UNION",
"SELECT",
"T1... | [
"select",
"t1",
".",
"bio_data",
",",
"t1",
".",
"student_id",
"from",
"students",
"as",
"t1",
"join",
"classes",
"as",
"t2",
"on",
"t1",
".",
"student_id",
"=",
"t2",
".",
"student_id",
"group",
"by",
"t1",
".",
"student_id",
"having",
"count",
"(",
"... | List the biographical data and student id for the students who take 2 or more classes and the students who have less than 2 detentions. | [
"List",
"the",
"biographical",
"data",
"and",
"student",
"id",
"for",
"the",
"students",
"who",
"take",
"2",
"or",
"more",
"classes",
"and",
"the",
"students",
"who",
"have",
"less",
"than",
"2",
"detentions",
"."
] | CREATE TABLE Students (
student_id NUMBER PRIMARY KEY,
bio_data TEXT,
student_details TEXT
);
CREATE TABLE Transcripts (
transcript_id NUMBER PRIMARY KEY,
student_id NUMBER,
date_of_transcript TIME,
transcript_details TEXT,
FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Behavio... |
vehicle_rent | SELECT name , model_year FROM vehicles WHERE city_fuel_economy_rate <= highway_fuel_economy_rate | [
"SELECT",
"name",
",",
"model_year",
"FROM",
"vehicles",
"WHERE",
"city_fuel_economy_rate",
"<",
"=",
"highway_fuel_economy_rate"
] | [
"select",
"name",
",",
"model_year",
"from",
"vehicles",
"where",
"city_fuel_economy_rate",
"<",
"=",
"highway_fuel_economy_rate"
] | Show name and model year for vehicles with city fuel economy rate less than or equal to highway fuel economy rate. | [
"Show",
"name",
"and",
"model",
"year",
"for",
"vehicles",
"with",
"city",
"fuel",
"economy",
"rate",
"less",
"than",
"or",
"equal",
"to",
"highway",
"fuel",
"economy",
"rate",
"."
] | CREATE TABLE Customers (
id NUMBER PRIMARY KEY,
name TEXT,
age NUMBER,
membership_credit NUMBER
);
CREATE TABLE Discount (
id NUMBER PRIMARY KEY,
name TEXT,
membership_credit NUMBER
);
CREATE TABLE Vehicles (
id NUMBER PRIMARY KEY,
name TEXT,
Model_year NUMBER,
Type_of_powertrain TEXT,
Combined_... |
bike_racing | SELECT T1.id , T1.name FROM cyclist AS T1 JOIN cyclists_own_bikes AS T2 ON T1.id = T2.cyclist_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"T1.id",
",",
"T1.name",
"FROM",
"cyclist",
"AS",
"T1",
"JOIN",
"cyclists_own_bikes",
"AS",
"T2",
"ON",
"T1.id",
"=",
"T2.cyclist_id",
"GROUP",
"BY",
"T1.id",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"t1",
".",
"id",
",",
"t1",
".",
"name",
"from",
"cyclist",
"as",
"t1",
"join",
"cyclists_own_bikes",
"as",
"t2",
"on",
"t1",
".",
"id",
"=",
"t2",
".",
"cyclist_id",
"group",
"by",
"t1",
".",
"id",
"order",
"by",
"count",
"(",
"*",
")",
... | What are the id and name of the cyclist who owns the most bikes? | [
"What",
"are",
"the",
"id",
"and",
"name",
"of",
"the",
"cyclist",
"who",
"owns",
"the",
"most",
"bikes",
"?"
] | CREATE TABLE bike (
id NUMBER PRIMARY KEY,
product_name TEXT,
weight NUMBER,
price NUMBER,
material TEXT
);
CREATE TABLE cyclist (
id NUMBER PRIMARY KEY,
heat NUMBER,
name TEXT,
nation TEXT,
result NUMBER
);
CREATE TABLE cyclists_own_bikes (
cyclist_id NUMBER PRIMARY KEY,
bike_id NUMBER,
purch... |
customers_and_orders | SELECT product_name FROM Products WHERE product_type_code = "Clothes" ORDER BY product_price DESC LIMIT 1 | [
"SELECT",
"product_name",
"FROM",
"Products",
"WHERE",
"product_type_code",
"=",
"``",
"Clothes",
"''",
"ORDER",
"BY",
"product_price",
"DESC",
"LIMIT",
"1"
] | [
"select",
"product_name",
"from",
"products",
"where",
"product_type_code",
"=",
"value",
"order",
"by",
"product_price",
"desc",
"limit",
"value"
] | What is the name of the most expensive product with type Clothes? | [
"What",
"is",
"the",
"name",
"of",
"the",
"most",
"expensive",
"product",
"with",
"type",
"Clothes",
"?"
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
product_type_code TEXT,
product_name TEXT,
product_price NUMBER
);
CREATE TABLE Addresses (
address_id NUMBER PRIMARY KEY,
address_details TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
address_id NUMBER,
payment_method_code TEXT... |
cre_Doc_Workflow | SELECT author_name FROM Authors | [
"SELECT",
"author_name",
"FROM",
"Authors"
] | [
"select",
"author_name",
"from",
"authors"
] | Show all author names. | [
"Show",
"all",
"author",
"names",
"."
] | CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
staff_details TEXT
);
CREATE TABLE Ref_Staff_Roles (
staff_role_code TEXT PRIMARY KEY,
staff_role_description TEXT
);
CREATE TABLE Process_Outcomes (
process_outcome_code TEXT PRIMARY KEY,
process_outcome_description TEXT
);
CREATE TABLE Process_Status (
p... |
region_building | SELECT avg(Population) FROM region | [
"SELECT",
"avg",
"(",
"Population",
")",
"FROM",
"region"
] | [
"select",
"avg",
"(",
"population",
")",
"from",
"region"
] | What is the average population for all regions? | [
"What",
"is",
"the",
"average",
"population",
"for",
"all",
"regions",
"?"
] | CREATE TABLE building (
Building_ID NUMBER PRIMARY KEY,
Region_ID NUMBER,
Name TEXT,
Address TEXT,
Number_of_Stories NUMBER,
Completed_Year NUMBER,
FOREIGN KEY (Region_ID) REFERENCES region(Region_ID)
);
CREATE TABLE region (
Region_ID NUMBER PRIMARY KEY,
Name TEXT,
Capital TEXT,
Area NUMBER,
Po... |
advertising_agencies | SELECT agency_id , count(*) FROM Staff GROUP BY agency_id | [
"SELECT",
"agency_id",
",",
"count",
"(",
"*",
")",
"FROM",
"Staff",
"GROUP",
"BY",
"agency_id"
] | [
"select",
"agency_id",
",",
"count",
"(",
"*",
")",
"from",
"staff",
"group",
"by",
"agency_id"
] | Show the agency ids and the number of staff in each agent? | [
"Show",
"the",
"agency",
"ids",
"and",
"the",
"number",
"of",
"staff",
"in",
"each",
"agent",
"?"
] | CREATE TABLE Agencies (
agency_id NUMBER PRIMARY KEY,
agency_details TEXT
);
CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
agency_id NUMBER,
staff_details TEXT
);
CREATE TABLE Clients (
client_id NUMBER PRIMARY KEY,
agency_id NUMBER,
sic_code TEXT,
client_details TEXT,
FOREIGN KEY (agency_id) RE... |
soccer_3 | SELECT Country FROM player GROUP BY Country HAVING COUNT(*) > 1 | [
"SELECT",
"Country",
"FROM",
"player",
"GROUP",
"BY",
"Country",
"HAVING",
"COUNT",
"(",
"*",
")",
">",
"1"
] | [
"select",
"country",
"from",
"player",
"group",
"by",
"country",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | List the country that have more than one player. | [
"List",
"the",
"country",
"that",
"have",
"more",
"than",
"one",
"player",
"."
] | 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... |
warehouse_1 | SELECT sum(capacity) FROM warehouses | [
"SELECT",
"sum",
"(",
"capacity",
")",
"FROM",
"warehouses"
] | [
"select",
"sum",
"(",
"capacity",
")",
"from",
"warehouses"
] | What is the total capacity of all warehouses? | [
"What",
"is",
"the",
"total",
"capacity",
"of",
"all",
"warehouses",
"?"
] | 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)
); |
soccer_3 | SELECT Manufacturer FROM club GROUP BY Manufacturer HAVING COUNT(*) > 1 | [
"SELECT",
"Manufacturer",
"FROM",
"club",
"GROUP",
"BY",
"Manufacturer",
"HAVING",
"COUNT",
"(",
"*",
")",
">",
"1"
] | [
"select",
"manufacturer",
"from",
"club",
"group",
"by",
"manufacturer",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | List the manufacturers that are associated with more than one club. | [
"List",
"the",
"manufacturers",
"that",
"are",
"associated",
"with",
"more",
"than",
"one",
"club",
"."
] | 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... |
bakery_1 | SELECT id FROM goods WHERE id LIKE "%APP%" | [
"SELECT",
"id",
"FROM",
"goods",
"WHERE",
"id",
"LIKE",
"``",
"%",
"APP",
"%",
"''"
] | [
"select",
"id",
"from",
"goods",
"where",
"id",
"like",
"value"
] | Give me the list of ids of all goods whose id has "APP". | [
"Give",
"me",
"the",
"list",
"of",
"ids",
"of",
"all",
"goods",
"whose",
"id",
"has",
"``",
"APP",
"''",
"."
] | 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... |
art_1 | SELECT T2.title FROM artists AS T1 JOIN paintings AS T2 ON T1.artistID = T2.painterID WHERE T1.artistID = 222 UNION SELECT T4.title FROM artists AS T3 JOIN sculptures AS T4 ON T3.artistID = T4.sculptorID WHERE T3.artistID = 222 | [
"SELECT",
"T2.title",
"FROM",
"artists",
"AS",
"T1",
"JOIN",
"paintings",
"AS",
"T2",
"ON",
"T1.artistID",
"=",
"T2.painterID",
"WHERE",
"T1.artistID",
"=",
"222",
"UNION",
"SELECT",
"T4.title",
"FROM",
"artists",
"AS",
"T3",
"JOIN",
"sculptures",
"AS",
"T4",
... | [
"select",
"t2",
".",
"title",
"from",
"artists",
"as",
"t1",
"join",
"paintings",
"as",
"t2",
"on",
"t1",
".",
"artistid",
"=",
"t2",
".",
"painterid",
"where",
"t1",
".",
"artistid",
"=",
"value",
"union",
"select",
"t4",
".",
"title",
"from",
"artist... | What are the titles of all paintings and sculpture works made by the artist whose id is 222? | [
"What",
"are",
"the",
"titles",
"of",
"all",
"paintings",
"and",
"sculpture",
"works",
"made",
"by",
"the",
"artist",
"whose",
"id",
"is",
"222",
"?"
] | CREATE TABLE Artists (
artistID NUMBER PRIMARY KEY,
lname TEXT,
fname TEXT,
birthYear NUMBER,
deathYear NUMBER
);
CREATE TABLE Paintings (
paintingID NUMBER PRIMARY KEY,
title TEXT,
year NUMBER,
height_mm NUMBER,
width_mm NUMBER,
medium TEXT,
mediumOn TEXT,
location TEXT,
painterID NUMBER,
... |
restaurant_bills | SELECT T1.Name , T2.Dish_Name FROM customer AS T1 JOIN customer_order AS T2 ON T1.Customer_ID = T2.Customer_ID | [
"SELECT",
"T1.Name",
",",
"T2.Dish_Name",
"FROM",
"customer",
"AS",
"T1",
"JOIN",
"customer_order",
"AS",
"T2",
"ON",
"T1.Customer_ID",
"=",
"T2.Customer_ID"
] | [
"select",
"t1",
".",
"name",
",",
"t2",
".",
"dish_name",
"from",
"customer",
"as",
"t1",
"join",
"customer_order",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id"
] | Show the names of customers and names of dishes they order. | [
"Show",
"the",
"names",
"of",
"customers",
"and",
"names",
"of",
"dishes",
"they",
"order",
"."
] | 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... |
cre_Students_Information_Systems | select bio_data from students where student_id not in (select t1.student_id from students as t1 join detention as t2 on t1.student_id = t2.student_id union select t1.student_id from students as t1 join student_loans as t2 on t1.student_id = t2.student_id) | [
"select",
"bio_data",
"from",
"students",
"where",
"student_id",
"not",
"in",
"(",
"select",
"t1.student_id",
"from",
"students",
"as",
"t1",
"join",
"detention",
"as",
"t2",
"on",
"t1.student_id",
"=",
"t2.student_id",
"union",
"select",
"t1.student_id",
"from",
... | [
"select",
"bio_data",
"from",
"students",
"where",
"student_id",
"not",
"in",
"(",
"select",
"t1",
".",
"student_id",
"from",
"students",
"as",
"t1",
"join",
"detention",
"as",
"t2",
"on",
"t1",
".",
"student_id",
"=",
"t2",
".",
"student_id",
"union",
"se... | Which students never had a detention or student loan ? Find their biographical data . | [
"Which",
"students",
"never",
"had",
"a",
"detention",
"or",
"student",
"loan",
"?",
"Find",
"their",
"biographical",
"data",
"."
] | CREATE TABLE Students (
student_id NUMBER PRIMARY KEY,
bio_data TEXT,
student_details TEXT
);
CREATE TABLE Transcripts (
transcript_id NUMBER PRIMARY KEY,
student_id NUMBER,
date_of_transcript TIME,
transcript_details TEXT,
FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Behavio... |
video_game | SELECT Player_name FROM player ORDER BY Player_name ASC | [
"SELECT",
"Player_name",
"FROM",
"player",
"ORDER",
"BY",
"Player_name",
"ASC"
] | [
"select",
"player_name",
"from",
"player",
"order",
"by",
"player_name",
"asc"
] | What are the names of all players in alphabetical order? | [
"What",
"are",
"the",
"names",
"of",
"all",
"players",
"in",
"alphabetical",
"order",
"?"
] | CREATE TABLE platform (
Platform_ID NUMBER PRIMARY KEY,
Platform_name TEXT,
Market_district TEXT,
Download_rank NUMBER
);
CREATE TABLE game (
Game_ID NUMBER PRIMARY KEY,
Title TEXT,
Release_Date TEXT,
Franchise TEXT,
Developers TEXT,
Platform_ID NUMBER,
Units_sold_Millions NUMBER,
FOREIGN KEY (P... |
online_exams | SELECT Exam_Date , Exam_Name FROM Exams WHERE Subject_Code != 'Database' | [
"SELECT",
"Exam_Date",
",",
"Exam_Name",
"FROM",
"Exams",
"WHERE",
"Subject_Code",
"!",
"=",
"'Database",
"'"
] | [
"select",
"exam_date",
",",
"exam_name",
"from",
"exams",
"where",
"subject_code",
"!",
"=",
"value"
] | Find the exams whose subject code is not "Database". What are the exam dates and exam names? | [
"Find",
"the",
"exams",
"whose",
"subject",
"code",
"is",
"not",
"``",
"Database",
"''",
".",
"What",
"are",
"the",
"exam",
"dates",
"and",
"exam",
"names",
"?"
] | CREATE TABLE Students (
Student_ID NUMBER PRIMARY KEY,
First_Name TEXT,
Middle_Name TEXT,
Last_Name TEXT,
Gender_MFU TEXT,
Student_Address TEXT,
Email_Adress TEXT,
Cell_Mobile_Phone TEXT,
Home_Phone TEXT
);
CREATE TABLE Questions (
Question_ID NUMBER PRIMARY KEY,
Type_of_Question_Code TEXT,
Ques... |
bakery_1 | SELECT T1.receipt FROM items AS T1 JOIN goods AS T2 ON T1.item = T2.id WHERE T2.flavor = "Apple" AND T2.food = "Pie" UNION SELECT ReceiptNumber FROM receipts WHERE CustomerId = 12 | [
"SELECT",
"T1.receipt",
"FROM",
"items",
"AS",
"T1",
"JOIN",
"goods",
"AS",
"T2",
"ON",
"T1.item",
"=",
"T2.id",
"WHERE",
"T2.flavor",
"=",
"``",
"Apple",
"''",
"AND",
"T2.food",
"=",
"``",
"Pie",
"''",
"UNION",
"SELECT",
"ReceiptNumber",
"FROM",
"receipts... | [
"select",
"t1",
".",
"receipt",
"from",
"items",
"as",
"t1",
"join",
"goods",
"as",
"t2",
"on",
"t1",
".",
"item",
"=",
"t2",
".",
"id",
"where",
"t2",
".",
"flavor",
"=",
"value",
"and",
"t2",
".",
"food",
"=",
"value",
"union",
"select",
"receipt... | Find all receipts in which either apple flavor pie was bought or customer id 12 shopped. | [
"Find",
"all",
"receipts",
"in",
"which",
"either",
"apple",
"flavor",
"pie",
"was",
"bought",
"or",
"customer",
"id",
"12",
"shopped",
"."
] | 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... |
planet_1 | SELECT Date FROM Shipment; | [
"SELECT",
"Date",
"FROM",
"Shipment",
";"
] | [
"select",
"date",
"from",
"shipment"
] | What are the dates of every shipment in the database? | [
"What",
"are",
"the",
"dates",
"of",
"every",
"shipment",
"in",
"the",
"database",
"?"
] | 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... |
art_1 | SELECT fname , deathYear - birthYear FROM artists ORDER BY deathYear - birthYear DESC LIMIT 1 | [
"SELECT",
"fname",
",",
"deathYear",
"-",
"birthYear",
"FROM",
"artists",
"ORDER",
"BY",
"deathYear",
"-",
"birthYear",
"DESC",
"LIMIT",
"1"
] | [
"select",
"fname",
",",
"deathyear",
"-",
"birthyear",
"from",
"artists",
"order",
"by",
"deathyear",
"-",
"birthyear",
"desc",
"limit",
"value"
] | What are the first name and age of the artist who had the longest life? | [
"What",
"are",
"the",
"first",
"name",
"and",
"age",
"of",
"the",
"artist",
"who",
"had",
"the",
"longest",
"life",
"?"
] | CREATE TABLE Artists (
artistID NUMBER PRIMARY KEY,
lname TEXT,
fname TEXT,
birthYear NUMBER,
deathYear NUMBER
);
CREATE TABLE Paintings (
paintingID NUMBER PRIMARY KEY,
title TEXT,
year NUMBER,
height_mm NUMBER,
width_mm NUMBER,
medium TEXT,
mediumOn TEXT,
location TEXT,
painterID NUMBER,
... |
vehicle_driver | SELECT avg(top_speed) FROM vehicle | [
"SELECT",
"avg",
"(",
"top_speed",
")",
"FROM",
"vehicle"
] | [
"select",
"avg",
"(",
"top_speed",
")",
"from",
"vehicle"
] | What is the average top speed of vehicles? | [
"What",
"is",
"the",
"average",
"top",
"speed",
"of",
"vehicles",
"?"
] | CREATE TABLE vehicle (
Vehicle_ID NUMBER PRIMARY KEY,
Model TEXT,
Build_Year TEXT,
Top_Speed NUMBER,
Power NUMBER,
Builder TEXT,
Total_Production TEXT
);
CREATE TABLE driver (
Driver_ID NUMBER PRIMARY KEY,
Name TEXT,
Citizenship TEXT,
Racing_Series TEXT
);
CREATE TABLE vehicle_driver (
Driver_ID... |
cre_Doc_and_collections | SELECT Document_Object_ID , count(*) FROM Document_Subset_Members GROUP BY Document_Object_ID ORDER BY count(*) ASC LIMIT 1; | [
"SELECT",
"Document_Object_ID",
",",
"count",
"(",
"*",
")",
"FROM",
"Document_Subset_Members",
"GROUP",
"BY",
"Document_Object_ID",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"ASC",
"LIMIT",
"1",
";"
] | [
"select",
"document_object_id",
",",
"count",
"(",
"*",
")",
"from",
"document_subset_members",
"group",
"by",
"document_object_id",
"order",
"by",
"count",
"(",
"*",
")",
"asc",
"limit",
"value"
] | Which document has least number of related documents? List the document id and the number of related documents. | [
"Which",
"document",
"has",
"least",
"number",
"of",
"related",
"documents",
"?",
"List",
"the",
"document",
"id",
"and",
"the",
"number",
"of",
"related",
"documents",
"."
] | CREATE TABLE Document_Subsets (
Document_Subset_ID NUMBER PRIMARY KEY,
Document_Subset_Name TEXT,
Document_Subset_Details TEXT
);
CREATE TABLE Collection_Subsets (
Collection_Subset_ID NUMBER PRIMARY KEY,
Collection_Subset_Name TEXT,
Collecrtion_Subset_Details TEXT
);
CREATE TABLE Document_Objects (
Docum... |
planet_1 | SELECT T1.PackageNumber , max(T1.Weight) FROM PACKAGE AS T1 JOIN Client AS T2 ON T1.Sender = T2.AccountNumber WHERE T2.Name LIKE "John"; | [
"SELECT",
"T1.PackageNumber",
",",
"max",
"(",
"T1.Weight",
")",
"FROM",
"PACKAGE",
"AS",
"T1",
"JOIN",
"Client",
"AS",
"T2",
"ON",
"T1.Sender",
"=",
"T2.AccountNumber",
"WHERE",
"T2.Name",
"LIKE",
"``",
"John",
"''",
";"
] | [
"select",
"t1",
".",
"packagenumber",
",",
"max",
"(",
"t1",
".",
"weight",
")",
"from",
"package",
"as",
"t1",
"join",
"client",
"as",
"t2",
"on",
"t1",
".",
"sender",
"=",
"t2",
".",
"accountnumber",
"where",
"t2",
".",
"name",
"like",
"value"
] | What is the package number and weight of the heaviest package that was sent by a client named John or something similar? | [
"What",
"is",
"the",
"package",
"number",
"and",
"weight",
"of",
"the",
"heaviest",
"package",
"that",
"was",
"sent",
"by",
"a",
"client",
"named",
"John",
"or",
"something",
"similar",
"?"
] | 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... |
real_estate_rentals | SELECT T1.line_1_number_building , T1.line_2_number_street , T1.town_city FROM Addresses AS T1 JOIN Users AS T2 ON T1.address_id = T2.user_address_id WHERE T2.user_category_code = 'Senior Citizen'; | [
"SELECT",
"T1.line_1_number_building",
",",
"T1.line_2_number_street",
",",
"T1.town_city",
"FROM",
"Addresses",
"AS",
"T1",
"JOIN",
"Users",
"AS",
"T2",
"ON",
"T1.address_id",
"=",
"T2.user_address_id",
"WHERE",
"T2.user_category_code",
"=",
"'Senior",
"Citizen",
"'",
... | [
"select",
"t1",
".",
"line_1_number_building",
",",
"t1",
".",
"line_2_number_street",
",",
"t1",
".",
"town_city",
"from",
"addresses",
"as",
"t1",
"join",
"users",
"as",
"t2",
"on",
"t1",
".",
"address_id",
"=",
"t2",
".",
"user_address_id",
"where",
"t2",... | What are the buildings, streets, and cities corresponding to the addresses of senior citizens? | [
"What",
"are",
"the",
"buildings",
",",
"streets",
",",
"and",
"cities",
"corresponding",
"to",
"the",
"addresses",
"of",
"senior",
"citizens",
"?"
] | CREATE TABLE Ref_Age_Categories (
age_category_code TEXT PRIMARY KEY,
age_category_description TEXT
);
CREATE TABLE Ref_Property_Types (
property_type_code TEXT PRIMARY KEY,
property_type_description TEXT
);
CREATE TABLE Ref_Room_Types (
room_type_code TEXT PRIMARY KEY,
room_type_description TEXT
);
CREATE ... |
cre_Doc_and_collections | SELECT count(*) , T2.Document_Object_ID FROM Collections AS T1 JOIN Documents_in_Collections AS T2 ON T1.Collection_ID = T2.Collection_ID GROUP BY T2.Document_Object_ID | [
"SELECT",
"count",
"(",
"*",
")",
",",
"T2.Document_Object_ID",
"FROM",
"Collections",
"AS",
"T1",
"JOIN",
"Documents_in_Collections",
"AS",
"T2",
"ON",
"T1.Collection_ID",
"=",
"T2.Collection_ID",
"GROUP",
"BY",
"T2.Document_Object_ID"
] | [
"select",
"count",
"(",
"*",
")",
",",
"t2",
".",
"document_object_id",
"from",
"collections",
"as",
"t1",
"join",
"documents_in_collections",
"as",
"t2",
"on",
"t1",
".",
"collection_id",
"=",
"t2",
".",
"collection_id",
"group",
"by",
"t2",
".",
"document_... | How many collections does each document belong to? List the count and the document id. | [
"How",
"many",
"collections",
"does",
"each",
"document",
"belong",
"to",
"?",
"List",
"the",
"count",
"and",
"the",
"document",
"id",
"."
] | CREATE TABLE Document_Subsets (
Document_Subset_ID NUMBER PRIMARY KEY,
Document_Subset_Name TEXT,
Document_Subset_Details TEXT
);
CREATE TABLE Collection_Subsets (
Collection_Subset_ID NUMBER PRIMARY KEY,
Collection_Subset_Name TEXT,
Collecrtion_Subset_Details TEXT
);
CREATE TABLE Document_Objects (
Docum... |
cre_Doc_and_collections | SELECT OWNER FROM Document_Objects WHERE Description = 'Braeden Collection' | [
"SELECT",
"OWNER",
"FROM",
"Document_Objects",
"WHERE",
"Description",
"=",
"'Braeden",
"Collection",
"'"
] | [
"select",
"owner",
"from",
"document_objects",
"where",
"description",
"=",
"value"
] | What are the owners of the document objects described as the 'Braeden Collection'? | [
"What",
"are",
"the",
"owners",
"of",
"the",
"document",
"objects",
"described",
"as",
"the",
"'Braeden",
"Collection",
"'",
"?"
] | CREATE TABLE Document_Subsets (
Document_Subset_ID NUMBER PRIMARY KEY,
Document_Subset_Name TEXT,
Document_Subset_Details TEXT
);
CREATE TABLE Collection_Subsets (
Collection_Subset_ID NUMBER PRIMARY KEY,
Collection_Subset_Name TEXT,
Collecrtion_Subset_Details TEXT
);
CREATE TABLE Document_Objects (
Docum... |
region_building | SELECT Name FROM region ORDER BY Name ASC | [
"SELECT",
"Name",
"FROM",
"region",
"ORDER",
"BY",
"Name",
"ASC"
] | [
"select",
"name",
"from",
"region",
"order",
"by",
"name",
"asc"
] | What are the names of regions in ascending alphabetical order? | [
"What",
"are",
"the",
"names",
"of",
"regions",
"in",
"ascending",
"alphabetical",
"order",
"?"
] | CREATE TABLE building (
Building_ID NUMBER PRIMARY KEY,
Region_ID NUMBER,
Name TEXT,
Address TEXT,
Number_of_Stories NUMBER,
Completed_Year NUMBER,
FOREIGN KEY (Region_ID) REFERENCES region(Region_ID)
);
CREATE TABLE region (
Region_ID NUMBER PRIMARY KEY,
Name TEXT,
Capital TEXT,
Area NUMBER,
Po... |
bakery_1 | SELECT id FROM goods WHERE flavor = "Apricot" AND price < 5 | [
"SELECT",
"id",
"FROM",
"goods",
"WHERE",
"flavor",
"=",
"``",
"Apricot",
"''",
"AND",
"price",
"<",
"5"
] | [
"select",
"id",
"from",
"goods",
"where",
"flavor",
"=",
"value",
"and",
"price",
"<",
"value"
] | What are ids of the goods that have Apricot flavor and are cheaper than 5 dollars? | [
"What",
"are",
"ids",
"of",
"the",
"goods",
"that",
"have",
"Apricot",
"flavor",
"and",
"are",
"cheaper",
"than",
"5",
"dollars",
"?"
] | 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... |
government_shift | SELECT analytical_layer_type_code , count(*) FROM analytical_layer GROUP BY analytical_layer_type_code | [
"SELECT",
"analytical_layer_type_code",
",",
"count",
"(",
"*",
")",
"FROM",
"analytical_layer",
"GROUP",
"BY",
"analytical_layer_type_code"
] | [
"select",
"analytical_layer_type_code",
",",
"count",
"(",
"*",
")",
"from",
"analytical_layer",
"group",
"by",
"analytical_layer_type_code"
] | For each analytical layer, return the analytical layer type code and the number of times it was used. | [
"For",
"each",
"analytical",
"layer",
",",
"return",
"the",
"analytical",
"layer",
"type",
"code",
"and",
"the",
"number",
"of",
"times",
"it",
"was",
"used",
"."
] | CREATE TABLE Services (
Service_ID NUMBER PRIMARY KEY,
Service_Details TEXT
);
CREATE TABLE Customers (
Customer_ID NUMBER PRIMARY KEY,
Customer_Details TEXT
);
CREATE TABLE Channels (
Channel_ID NUMBER PRIMARY KEY,
Channel_Details TEXT
);
CREATE TABLE Customers_and_Services (
Customers_and_Services_ID NU... |
real_estate_rentals | SELECT T2.town_city FROM Properties AS T1 JOIN Addresses AS T2 ON T1.property_address_id = T2.address_id JOIN Property_Features AS T3 ON T1.property_id = T3.property_id JOIN Features AS T4 ON T4.feature_id = T3.feature_id WHERE T4.feature_name = 'swimming pool'; | [
"SELECT",
"T2.town_city",
"FROM",
"Properties",
"AS",
"T1",
"JOIN",
"Addresses",
"AS",
"T2",
"ON",
"T1.property_address_id",
"=",
"T2.address_id",
"JOIN",
"Property_Features",
"AS",
"T3",
"ON",
"T1.property_id",
"=",
"T3.property_id",
"JOIN",
"Features",
"AS",
"T4",... | [
"select",
"t2",
".",
"town_city",
"from",
"properties",
"as",
"t1",
"join",
"addresses",
"as",
"t2",
"on",
"t1",
".",
"property_address_id",
"=",
"t2",
".",
"address_id",
"join",
"property_features",
"as",
"t3",
"on",
"t1",
".",
"property_id",
"=",
"t3",
"... | In which cities are there any properties equipped with a swimming pool? | [
"In",
"which",
"cities",
"are",
"there",
"any",
"properties",
"equipped",
"with",
"a",
"swimming",
"pool",
"?"
] | CREATE TABLE Ref_Age_Categories (
age_category_code TEXT PRIMARY KEY,
age_category_description TEXT
);
CREATE TABLE Ref_Property_Types (
property_type_code TEXT PRIMARY KEY,
property_type_description TEXT
);
CREATE TABLE Ref_Room_Types (
room_type_code TEXT PRIMARY KEY,
room_type_description TEXT
);
CREATE ... |
warehouse_1 | SELECT warehouse , avg(value) FROM boxes GROUP BY warehouse | [
"SELECT",
"warehouse",
",",
"avg",
"(",
"value",
")",
"FROM",
"boxes",
"GROUP",
"BY",
"warehouse"
] | [
"select",
"warehouse",
",",
"avg",
"(",
"value",
")",
"from",
"boxes",
"group",
"by",
"warehouse"
] | What is the average value of boxes for each warehouse? | [
"What",
"is",
"the",
"average",
"value",
"of",
"boxes",
"for",
"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)
); |
car_racing | SELECT Make , COUNT(*) FROM driver GROUP BY Make | [
"SELECT",
"Make",
",",
"COUNT",
"(",
"*",
")",
"FROM",
"driver",
"GROUP",
"BY",
"Make"
] | [
"select",
"make",
",",
"count",
"(",
"*",
")",
"from",
"driver",
"group",
"by",
"make"
] | List each make with the number of drivers with that make. | [
"List",
"each",
"make",
"with",
"the",
"number",
"of",
"drivers",
"with",
"that",
"make",
"."
] | CREATE TABLE country (
Country_Id NUMBER PRIMARY KEY,
Country TEXT,
Capital TEXT,
Official_native_language TEXT,
Regoin TEXT
);
CREATE TABLE team (
Team_ID NUMBER PRIMARY KEY,
Team TEXT,
Make TEXT,
Manager TEXT,
Sponsor TEXT,
Car_Owner TEXT
);
CREATE TABLE driver (
Driver_ID NUMBER PRIMARY KEY,
... |
address_1 | SELECT state FROM City GROUP BY state HAVING count(*) >= 2 | [
"SELECT",
"state",
"FROM",
"City",
"GROUP",
"BY",
"state",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2"
] | [
"select",
"state",
"from",
"city",
"group",
"by",
"state",
"having",
"count",
"(",
"*",
")",
">",
"=",
"value"
] | List all states with at least two cities. | [
"List",
"all",
"states",
"with",
"at",
"least",
"two",
"cities",
"."
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
boat_1 | SELECT count(*) FROM Boats WHERE color = 'red' | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"Boats",
"WHERE",
"color",
"=",
"'red",
"'"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"boats",
"where",
"color",
"=",
"value"
] | How many boats are red? | [
"How",
"many",
"boats",
"are",
"red",
"?"
] | CREATE TABLE Sailors (
sid NUMBER PRIMARY KEY,
name TEXT,
rating NUMBER,
age NUMBER
);
CREATE TABLE Boats (
bid NUMBER PRIMARY KEY,
name TEXT,
color TEXT
);
CREATE TABLE Reserves (
sid NUMBER,
bid NUMBER,
day TEXT,
FOREIGN KEY (bid) REFERENCES Boats(bid),
FOREIGN KEY (sid) REFERENCES Sailors(sid... |
advertising_agencies | SELECT invoice_id , count(*) FROM Payments GROUP BY invoice_id | [
"SELECT",
"invoice_id",
",",
"count",
"(",
"*",
")",
"FROM",
"Payments",
"GROUP",
"BY",
"invoice_id"
] | [
"select",
"invoice_id",
",",
"count",
"(",
"*",
")",
"from",
"payments",
"group",
"by",
"invoice_id"
] | How many payments are there for each invoice? | [
"How",
"many",
"payments",
"are",
"there",
"for",
"each",
"invoice",
"?"
] | CREATE TABLE Agencies (
agency_id NUMBER PRIMARY KEY,
agency_details TEXT
);
CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
agency_id NUMBER,
staff_details TEXT
);
CREATE TABLE Clients (
client_id NUMBER PRIMARY KEY,
agency_id NUMBER,
sic_code TEXT,
client_details TEXT,
FOREIGN KEY (agency_id) RE... |
e_commerce | SELECT T1.customer_first_name , T1.customer_middle_initial , T1.customer_last_name , T2.Payment_method_code FROM Customers AS T1 JOIN Customer_Payment_Methods AS T2 ON T1.customer_id = T2.customer_id | [
"SELECT",
"T1.customer_first_name",
",",
"T1.customer_middle_initial",
",",
"T1.customer_last_name",
",",
"T2.Payment_method_code",
"FROM",
"Customers",
"AS",
"T1",
"JOIN",
"Customer_Payment_Methods",
"AS",
"T2",
"ON",
"T1.customer_id",
"=",
"T2.customer_id"
] | [
"select",
"t1",
".",
"customer_first_name",
",",
"t1",
".",
"customer_middle_initial",
",",
"t1",
".",
"customer_last_name",
",",
"t2",
".",
"payment_method_code",
"from",
"customers",
"as",
"t1",
"join",
"customer_payment_methods",
"as",
"t2",
"on",
"t1",
".",
... | List the customers' first name, middle initial, last name and payment methods. | [
"List",
"the",
"customers",
"'",
"first",
"name",
",",
"middle",
"initial",
",",
"last",
"name",
"and",
"payment",
"methods",
"."
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
parent_product_id NUMBER,
product_name TEXT,
product_price NUMBER,
product_color TEXT,
product_size TEXT,
product_description TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
gender_code TEXT,
customer_first_name TEXT,
customer... |
car_road_race | SELECT Engine FROM driver GROUP BY Engine ORDER BY COUNT(*) DESC LIMIT 1 | [
"SELECT",
"Engine",
"FROM",
"driver",
"GROUP",
"BY",
"Engine",
"ORDER",
"BY",
"COUNT",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"engine",
"from",
"driver",
"group",
"by",
"engine",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | What is the most common type of engine? | [
"What",
"is",
"the",
"most",
"common",
"type",
"of",
"engine",
"?"
] | 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... |
government_shift | SELECT DISTINCT t1.service_details FROM services AS t1 JOIN customers_and_services AS t2 ON t1.service_id = t2.service_id WHERE t2.customers_and_services_details = "Unsatisfied" | [
"SELECT",
"DISTINCT",
"t1.service_details",
"FROM",
"services",
"AS",
"t1",
"JOIN",
"customers_and_services",
"AS",
"t2",
"ON",
"t1.service_id",
"=",
"t2.service_id",
"WHERE",
"t2.customers_and_services_details",
"=",
"``",
"Unsatisfied",
"''"
] | [
"select",
"distinct",
"t1",
".",
"service_details",
"from",
"services",
"as",
"t1",
"join",
"customers_and_services",
"as",
"t2",
"on",
"t1",
".",
"service_id",
"=",
"t2",
".",
"service_id",
"where",
"t2",
".",
"customers_and_services_details",
"=",
"value"
] | Which services have been rated as "unsatisfied" in customers and services details? Give me the service_details. | [
"Which",
"services",
"have",
"been",
"rated",
"as",
"``",
"unsatisfied",
"''",
"in",
"customers",
"and",
"services",
"details",
"?",
"Give",
"me",
"the",
"service_details",
"."
] | CREATE TABLE Services (
Service_ID NUMBER PRIMARY KEY,
Service_Details TEXT
);
CREATE TABLE Customers (
Customer_ID NUMBER PRIMARY KEY,
Customer_Details TEXT
);
CREATE TABLE Channels (
Channel_ID NUMBER PRIMARY KEY,
Channel_Details TEXT
);
CREATE TABLE Customers_and_Services (
Customers_and_Services_ID NU... |
customers_and_orders | SELECT T2.customer_name , T1.customer_id , count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id | [
"SELECT",
"T2.customer_name",
",",
"T1.customer_id",
",",
"count",
"(",
"*",
")",
"FROM",
"Customer_orders",
"AS",
"T1",
"JOIN",
"Customers",
"AS",
"T2",
"ON",
"T1.customer_id",
"=",
"T2.customer_id",
"GROUP",
"BY",
"T1.customer_id"
] | [
"select",
"t2",
".",
"customer_name",
",",
"t1",
".",
"customer_id",
",",
"count",
"(",
"*",
")",
"from",
"customer_orders",
"as",
"t1",
"join",
"customers",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id",
"group",
"by",
"t1",
... | What are the names, ids, and number of orders made for each customer? | [
"What",
"are",
"the",
"names",
",",
"ids",
",",
"and",
"number",
"of",
"orders",
"made",
"for",
"each",
"customer",
"?"
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
product_type_code TEXT,
product_name TEXT,
product_price NUMBER
);
CREATE TABLE Addresses (
address_id NUMBER PRIMARY KEY,
address_details TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
address_id NUMBER,
payment_method_code TEXT... |
club_leader | SELECT T3.Name , T2.Club_Name FROM club_leader AS T1 JOIN club AS T2 ON T1.Club_ID = T2.Club_ID JOIN member AS T3 ON T1.Member_ID = T3.Member_ID | [
"SELECT",
"T3.Name",
",",
"T2.Club_Name",
"FROM",
"club_leader",
"AS",
"T1",
"JOIN",
"club",
"AS",
"T2",
"ON",
"T1.Club_ID",
"=",
"T2.Club_ID",
"JOIN",
"member",
"AS",
"T3",
"ON",
"T1.Member_ID",
"=",
"T3.Member_ID"
] | [
"select",
"t3",
".",
"name",
",",
"t2",
".",
"club_name",
"from",
"club_leader",
"as",
"t1",
"join",
"club",
"as",
"t2",
"on",
"t1",
".",
"club_id",
"=",
"t2",
".",
"club_id",
"join",
"member",
"as",
"t3",
"on",
"t1",
".",
"member_id",
"=",
"t3",
"... | Show the names of club leaders and the names of clubs they joined. | [
"Show",
"the",
"names",
"of",
"club",
"leaders",
"and",
"the",
"names",
"of",
"clubs",
"they",
"joined",
"."
] | CREATE TABLE member (
Member_ID NUMBER PRIMARY KEY,
Name TEXT,
Nationality TEXT,
Age NUMBER
);
CREATE TABLE club (
Club_ID NUMBER PRIMARY KEY,
Overall_Ranking NUMBER,
Team_Leader TEXT,
Club_Name TEXT
);
CREATE TABLE club_leader (
Club_ID NUMBER PRIMARY KEY,
Member_ID NUMBER,
Year_Join TEXT,
FORE... |
aan_1 | SELECT T1.name FROM Author AS T1 JOIN Author_list AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_id HAVING count(*) > 50 | [
"SELECT",
"T1.name",
"FROM",
"Author",
"AS",
"T1",
"JOIN",
"Author_list",
"AS",
"T2",
"ON",
"T1.author_id",
"=",
"T2.author_id",
"GROUP",
"BY",
"T1.author_id",
"HAVING",
"count",
"(",
"*",
")",
">",
"50"
] | [
"select",
"t1",
".",
"name",
"from",
"author",
"as",
"t1",
"join",
"author_list",
"as",
"t2",
"on",
"t1",
".",
"author_id",
"=",
"t2",
".",
"author_id",
"group",
"by",
"t1",
".",
"author_id",
"having",
"count",
"(",
"*",
")",
">",
"value"
] | What are the names of all authors who have more than 50 papers? | [
"What",
"are",
"the",
"names",
"of",
"all",
"authors",
"who",
"have",
"more",
"than",
"50",
"papers",
"?"
] | 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... |
cre_Doc_and_collections | SELECT Collection_Name FROM Collections EXCEPT SELECT T2.Collection_Name FROM Collections AS T1 JOIN Collections AS T2 ON T1.Parent_Collection_ID = T2.Collection_ID; | [
"SELECT",
"Collection_Name",
"FROM",
"Collections",
"EXCEPT",
"SELECT",
"T2.Collection_Name",
"FROM",
"Collections",
"AS",
"T1",
"JOIN",
"Collections",
"AS",
"T2",
"ON",
"T1.Parent_Collection_ID",
"=",
"T2.Collection_ID",
";"
] | [
"select",
"collection_name",
"from",
"collections",
"except",
"select",
"t2",
".",
"collection_name",
"from",
"collections",
"as",
"t1",
"join",
"collections",
"as",
"t2",
"on",
"t1",
".",
"parent_collection_id",
"=",
"t2",
".",
"collection_id"
] | Which collection is not the parent of other collection? List the collection's name. | [
"Which",
"collection",
"is",
"not",
"the",
"parent",
"of",
"other",
"collection",
"?",
"List",
"the",
"collection",
"'s",
"name",
"."
] | CREATE TABLE Document_Subsets (
Document_Subset_ID NUMBER PRIMARY KEY,
Document_Subset_Name TEXT,
Document_Subset_Details TEXT
);
CREATE TABLE Collection_Subsets (
Collection_Subset_ID NUMBER PRIMARY KEY,
Collection_Subset_Name TEXT,
Collecrtion_Subset_Details TEXT
);
CREATE TABLE Document_Objects (
Docum... |
car_road_race | SELECT Winning_driver , Winning_team FROM race ORDER BY Winning_team ASC | [
"SELECT",
"Winning_driver",
",",
"Winning_team",
"FROM",
"race",
"ORDER",
"BY",
"Winning_team",
"ASC"
] | [
"select",
"winning_driver",
",",
"winning_team",
"from",
"race",
"order",
"by",
"winning_team",
"asc"
] | What are the winning drivers and teams of races, ordered alphabetically by team? | [
"What",
"are",
"the",
"winning",
"drivers",
"and",
"teams",
"of",
"races",
",",
"ordered",
"alphabetically",
"by",
"team",
"?"
] | 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... |
customers_and_orders | SELECT order_status_code , count(*) FROM Customer_orders GROUP BY order_status_code | [
"SELECT",
"order_status_code",
",",
"count",
"(",
"*",
")",
"FROM",
"Customer_orders",
"GROUP",
"BY",
"order_status_code"
] | [
"select",
"order_status_code",
",",
"count",
"(",
"*",
")",
"from",
"customer_orders",
"group",
"by",
"order_status_code"
] | Show all order status and the number of orders in each status. | [
"Show",
"all",
"order",
"status",
"and",
"the",
"number",
"of",
"orders",
"in",
"each",
"status",
"."
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
product_type_code TEXT,
product_name TEXT,
product_price NUMBER
);
CREATE TABLE Addresses (
address_id NUMBER PRIMARY KEY,
address_details TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
address_id NUMBER,
payment_method_code TEXT... |
institution_sports | SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T1.Number_of_Championships DESC | [
"SELECT",
"T2.Name",
"FROM",
"championship",
"AS",
"T1",
"JOIN",
"institution",
"AS",
"T2",
"ON",
"T1.Institution_ID",
"=",
"T2.Institution_ID",
"ORDER",
"BY",
"T1.Number_of_Championships",
"DESC"
] | [
"select",
"t2",
".",
"name",
"from",
"championship",
"as",
"t1",
"join",
"institution",
"as",
"t2",
"on",
"t1",
".",
"institution_id",
"=",
"t2",
".",
"institution_id",
"order",
"by",
"t1",
".",
"number_of_championships",
"desc"
] | List the names of institutions in descending order of the number of championships. | [
"List",
"the",
"names",
"of",
"institutions",
"in",
"descending",
"order",
"of",
"the",
"number",
"of",
"championships",
"."
] | CREATE TABLE institution (
Institution_ID NUMBER PRIMARY KEY,
Name TEXT,
Team TEXT,
City TEXT,
Province TEXT,
Founded NUMBER,
Affiliation TEXT,
Enrollment NUMBER,
Endowment TEXT,
Stadium TEXT,
Capacity NUMBER
);
CREATE TABLE Championship (
Institution_ID NUMBER PRIMARY KEY,
Nickname TEXT,
Jo... |
book_review | SELECT max(Chapters) , min(Chapters) FROM book | [
"SELECT",
"max",
"(",
"Chapters",
")",
",",
"min",
"(",
"Chapters",
")",
"FROM",
"book"
] | [
"select",
"max",
"(",
"chapters",
")",
",",
"min",
"(",
"chapters",
")",
"from",
"book"
] | What are the maximum and minimum number of chapters for each book? | [
"What",
"are",
"the",
"maximum",
"and",
"minimum",
"number",
"of",
"chapters",
"for",
"each",
"book",
"?"
] | CREATE TABLE book (
Book_ID NUMBER PRIMARY KEY,
Title TEXT,
Type TEXT,
Pages NUMBER,
Chapters NUMBER,
Audio TEXT,
Release TEXT
);
CREATE TABLE review (
Review_ID NUMBER PRIMARY KEY,
Book_ID NUMBER,
Rating NUMBER,
Readers_in_Million NUMBER,
Rank NUMBER,
FOREIGN KEY (Book_ID) REFERENCES book(Boo... |
advertising_agencies | SELECT invoice_id , invoice_status , invoice_details FROM Invoices | [
"SELECT",
"invoice_id",
",",
"invoice_status",
",",
"invoice_details",
"FROM",
"Invoices"
] | [
"select",
"invoice_id",
",",
"invoice_status",
",",
"invoice_details",
"from",
"invoices"
] | Show ids, status codes, and details for all invoices for clients. | [
"Show",
"ids",
",",
"status",
"codes",
",",
"and",
"details",
"for",
"all",
"invoices",
"for",
"clients",
"."
] | CREATE TABLE Agencies (
agency_id NUMBER PRIMARY KEY,
agency_details TEXT
);
CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
agency_id NUMBER,
staff_details TEXT
);
CREATE TABLE Clients (
client_id NUMBER PRIMARY KEY,
agency_id NUMBER,
sic_code TEXT,
client_details TEXT,
FOREIGN KEY (agency_id) RE... |
bakery_1 | SELECT DISTINCT T1.date FROM receipts AS T1 JOIN items AS T2 ON T1.ReceiptNumber = T2.receipt JOIN goods AS T3 ON T2.item = T3.id WHERE T3.price > 15 | [
"SELECT",
"DISTINCT",
"T1.date",
"FROM",
"receipts",
"AS",
"T1",
"JOIN",
"items",
"AS",
"T2",
"ON",
"T1.ReceiptNumber",
"=",
"T2.receipt",
"JOIN",
"goods",
"AS",
"T3",
"ON",
"T2.item",
"=",
"T3.id",
"WHERE",
"T3.price",
">",
"15"
] | [
"select",
"distinct",
"t1",
".",
"date",
"from",
"receipts",
"as",
"t1",
"join",
"items",
"as",
"t2",
"on",
"t1",
".",
"receiptnumber",
"=",
"t2",
".",
"receipt",
"join",
"goods",
"as",
"t3",
"on",
"t2",
".",
"item",
"=",
"t3",
".",
"id",
"where",
... | On which date did some customer buy a good that costs more than 15 dollars? | [
"On",
"which",
"date",
"did",
"some",
"customer",
"buy",
"a",
"good",
"that",
"costs",
"more",
"than",
"15",
"dollars",
"?"
] | 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... |
sing_contest | select name , language from songs | [
"select",
"name",
",",
"language",
"from",
"songs"
] | [
"select",
"name",
",",
"language",
"from",
"songs"
] | List the names and languages of the songs . | [
"List",
"the",
"names",
"and",
"languages",
"of",
"the",
"songs",
"."
] | CREATE TABLE participants (
id NUMBER PRIMARY KEY,
name TEXT,
popularity NUMBER
);
CREATE TABLE songs (
id NUMBER PRIMARY KEY,
language TEXT,
original_artist TEXT,
name TEXT,
english_translation TEXT
);
CREATE TABLE performance_score (
participant_id NUMBER PRIMARY KEY,
songs_id NUMBER,
voice_soun... |
cre_Doc_and_collections | SELECT Collection_Name FROM Collections; | [
"SELECT",
"Collection_Name",
"FROM",
"Collections",
";"
] | [
"select",
"collection_name",
"from",
"collections"
] | what are the collection names? | [
"what",
"are",
"the",
"collection",
"names",
"?"
] | CREATE TABLE Document_Subsets (
Document_Subset_ID NUMBER PRIMARY KEY,
Document_Subset_Name TEXT,
Document_Subset_Details TEXT
);
CREATE TABLE Collection_Subsets (
Collection_Subset_ID NUMBER PRIMARY KEY,
Collection_Subset_Name TEXT,
Collecrtion_Subset_Details TEXT
);
CREATE TABLE Document_Objects (
Docum... |
book_press | SELECT count(*) , gender FROM author WHERE age > 30 GROUP BY gender | [
"SELECT",
"count",
"(",
"*",
")",
",",
"gender",
"FROM",
"author",
"WHERE",
"age",
">",
"30",
"GROUP",
"BY",
"gender"
] | [
"select",
"count",
"(",
"*",
")",
",",
"gender",
"from",
"author",
"where",
"age",
">",
"value",
"group",
"by",
"gender"
] | How many authors are of age above 30 for each gender? | [
"How",
"many",
"authors",
"are",
"of",
"age",
"above",
"30",
"for",
"each",
"gender",
"?"
] | CREATE TABLE author (
Author_ID NUMBER PRIMARY KEY,
Name TEXT,
Age NUMBER,
Gender TEXT
);
CREATE TABLE press (
Press_ID NUMBER PRIMARY KEY,
Name TEXT,
Month_Profits_billion NUMBER,
Year_Profits_billion NUMBER
);
CREATE TABLE book (
Book_ID NUMBER PRIMARY KEY,
Title TEXT,
Book_Series TEXT,
Author... |
vehicle_rent | SELECT name FROM vehicles ORDER BY model_year DESC | [
"SELECT",
"name",
"FROM",
"vehicles",
"ORDER",
"BY",
"model_year",
"DESC"
] | [
"select",
"name",
"from",
"vehicles",
"order",
"by",
"model_year",
"desc"
] | What are the names of all vehicles, ordered by model year descending? | [
"What",
"are",
"the",
"names",
"of",
"all",
"vehicles",
",",
"ordered",
"by",
"model",
"year",
"descending",
"?"
] | CREATE TABLE Customers (
id NUMBER PRIMARY KEY,
name TEXT,
age NUMBER,
membership_credit NUMBER
);
CREATE TABLE Discount (
id NUMBER PRIMARY KEY,
name TEXT,
membership_credit NUMBER
);
CREATE TABLE Vehicles (
id NUMBER PRIMARY KEY,
name TEXT,
Model_year NUMBER,
Type_of_powertrain TEXT,
Combined_... |
cre_Students_Information_Systems | SELECT date_from , date_to FROM Students_Addresses WHERE student_id IN ( SELECT student_id FROM Transcripts GROUP BY student_id HAVING count(*) = 2 ) | [
"SELECT",
"date_from",
",",
"date_to",
"FROM",
"Students_Addresses",
"WHERE",
"student_id",
"IN",
"(",
"SELECT",
"student_id",
"FROM",
"Transcripts",
"GROUP",
"BY",
"student_id",
"HAVING",
"count",
"(",
"*",
")",
"=",
"2",
")"
] | [
"select",
"date_from",
",",
"date_to",
"from",
"students_addresses",
"where",
"student_id",
"in",
"(",
"select",
"student_id",
"from",
"transcripts",
"group",
"by",
"student_id",
"having",
"count",
"(",
"*",
")",
"=",
"value",
")"
] | List the start time and the end time of the students' addresses for the students who have 2 transcripts. | [
"List",
"the",
"start",
"time",
"and",
"the",
"end",
"time",
"of",
"the",
"students",
"'",
"addresses",
"for",
"the",
"students",
"who",
"have",
"2",
"transcripts",
"."
] | CREATE TABLE Students (
student_id NUMBER PRIMARY KEY,
bio_data TEXT,
student_details TEXT
);
CREATE TABLE Transcripts (
transcript_id NUMBER PRIMARY KEY,
student_id NUMBER,
date_of_transcript TIME,
transcript_details TEXT,
FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Behavio... |
restaurant_bills | SELECT Nationality , Card_Credit FROM customer | [
"SELECT",
"Nationality",
",",
"Card_Credit",
"FROM",
"customer"
] | [
"select",
"nationality",
",",
"card_credit",
"from",
"customer"
] | Find the nationality and card credit of each customer. | [
"Find",
"the",
"nationality",
"and",
"card",
"credit",
"of",
"each",
"customer",
"."
] | 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... |
institution_sports | SELECT City , Province FROM institution | [
"SELECT",
"City",
",",
"Province",
"FROM",
"institution"
] | [
"select",
"city",
",",
"province",
"from",
"institution"
] | Return the cities and provinces of institutions. | [
"Return",
"the",
"cities",
"and",
"provinces",
"of",
"institutions",
"."
] | CREATE TABLE institution (
Institution_ID NUMBER PRIMARY KEY,
Name TEXT,
Team TEXT,
City TEXT,
Province TEXT,
Founded NUMBER,
Affiliation TEXT,
Enrollment NUMBER,
Endowment TEXT,
Stadium TEXT,
Capacity NUMBER
);
CREATE TABLE Championship (
Institution_ID NUMBER PRIMARY KEY,
Nickname TEXT,
Jo... |
soccer_3 | SELECT COUNT (DISTINCT Country) FROM player | [
"SELECT",
"COUNT",
"(",
"DISTINCT",
"Country",
")",
"FROM",
"player"
] | [
"select",
"count",
"(",
"distinct",
"country",
")",
"from",
"player"
] | What is the number of distinct countries of all players? | [
"What",
"is",
"the",
"number",
"of",
"distinct",
"countries",
"of",
"all",
"players",
"?"
] | 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... |
club_leader | SELECT Nationality , COUNT(*) FROM member GROUP BY Nationality | [
"SELECT",
"Nationality",
",",
"COUNT",
"(",
"*",
")",
"FROM",
"member",
"GROUP",
"BY",
"Nationality"
] | [
"select",
"nationality",
",",
"count",
"(",
"*",
")",
"from",
"member",
"group",
"by",
"nationality"
] | Show different nationalities along with the number of members of each nationality. | [
"Show",
"different",
"nationalities",
"along",
"with",
"the",
"number",
"of",
"members",
"of",
"each",
"nationality",
"."
] | CREATE TABLE member (
Member_ID NUMBER PRIMARY KEY,
Name TEXT,
Nationality TEXT,
Age NUMBER
);
CREATE TABLE club (
Club_ID NUMBER PRIMARY KEY,
Overall_Ranking NUMBER,
Team_Leader TEXT,
Club_Name TEXT
);
CREATE TABLE club_leader (
Club_ID NUMBER PRIMARY KEY,
Member_ID NUMBER,
Year_Join TEXT,
FORE... |
address_1 | SELECT avg(distance) FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code = T2.city_code WHERE T2.city_name = "Boston" | [
"SELECT",
"avg",
"(",
"distance",
")",
"FROM",
"Direct_distance",
"AS",
"T1",
"JOIN",
"City",
"AS",
"T2",
"ON",
"T1.city1_code",
"=",
"T2.city_code",
"WHERE",
"T2.city_name",
"=",
"``",
"Boston",
"''"
] | [
"select",
"avg",
"(",
"distance",
")",
"from",
"direct_distance",
"as",
"t1",
"join",
"city",
"as",
"t2",
"on",
"t1",
".",
"city1_code",
"=",
"t2",
".",
"city_code",
"where",
"t2",
".",
"city_name",
"=",
"value"
] | What is the average distance between Boston and all other cities. | [
"What",
"is",
"the",
"average",
"distance",
"between",
"Boston",
"and",
"all",
"other",
"cities",
"."
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
art_1 | SELECT count(*) FROM paintings WHERE LOCATION = "Gallery 240" | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"paintings",
"WHERE",
"LOCATION",
"=",
"``",
"Gallery",
"240",
"''"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"paintings",
"where",
"location",
"=",
"value"
] | What is the total number of paintings exhibited in gallery 240? | [
"What",
"is",
"the",
"total",
"number",
"of",
"paintings",
"exhibited",
"in",
"gallery",
"240",
"?"
] | CREATE TABLE Artists (
artistID NUMBER PRIMARY KEY,
lname TEXT,
fname TEXT,
birthYear NUMBER,
deathYear NUMBER
);
CREATE TABLE Paintings (
paintingID NUMBER PRIMARY KEY,
title TEXT,
year NUMBER,
height_mm NUMBER,
width_mm NUMBER,
medium TEXT,
mediumOn TEXT,
location TEXT,
painterID NUMBER,
... |
aan_1 | SELECT venue FROM paper GROUP BY venue ORDER BY count(*) LIMIT 1 | [
"SELECT",
"venue",
"FROM",
"paper",
"GROUP",
"BY",
"venue",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
] | [
"select",
"venue",
"from",
"paper",
"group",
"by",
"venue",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
] | Which venue has the fewest publications? | [
"Which",
"venue",
"has",
"the",
"fewest",
"publications",
"?"
] | 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... |
region_building | SELECT T1.Address , T2.Capital FROM building AS T1 JOIN region AS T2 ON T1.Region_ID = T2.Region_ID | [
"SELECT",
"T1.Address",
",",
"T2.Capital",
"FROM",
"building",
"AS",
"T1",
"JOIN",
"region",
"AS",
"T2",
"ON",
"T1.Region_ID",
"=",
"T2.Region_ID"
] | [
"select",
"t1",
".",
"address",
",",
"t2",
".",
"capital",
"from",
"building",
"as",
"t1",
"join",
"region",
"as",
"t2",
"on",
"t1",
".",
"region_id",
"=",
"t2",
".",
"region_id"
] | For each building, return the address of the building and the name of the region it belongs to. | [
"For",
"each",
"building",
",",
"return",
"the",
"address",
"of",
"the",
"building",
"and",
"the",
"name",
"of",
"the",
"region",
"it",
"belongs",
"to",
"."
] | CREATE TABLE building (
Building_ID NUMBER PRIMARY KEY,
Region_ID NUMBER,
Name TEXT,
Address TEXT,
Number_of_Stories NUMBER,
Completed_Year NUMBER,
FOREIGN KEY (Region_ID) REFERENCES region(Region_ID)
);
CREATE TABLE region (
Region_ID NUMBER PRIMARY KEY,
Name TEXT,
Capital TEXT,
Area NUMBER,
Po... |
car_racing | SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country = t2.country_id WHERE t1.Make = "Dodge" INTERSECT SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country = t2.country_id WHERE t1.Make = "Chevrolet" | [
"SELECT",
"t2.country",
"FROM",
"driver",
"AS",
"t1",
"JOIN",
"country",
"AS",
"t2",
"ON",
"t1.country",
"=",
"t2.country_id",
"WHERE",
"t1.Make",
"=",
"``",
"Dodge",
"''",
"INTERSECT",
"SELECT",
"t2.country",
"FROM",
"driver",
"AS",
"t1",
"JOIN",
"country",
... | [
"select",
"t2",
".",
"country",
"from",
"driver",
"as",
"t1",
"join",
"country",
"as",
"t2",
"on",
"t1",
".",
"country",
"=",
"t2",
".",
"country_id",
"where",
"t1",
".",
"make",
"=",
"value",
"intersect",
"select",
"t2",
".",
"country",
"from",
"drive... | Find the countries in which there are both drivers with make "Dodge" and drivers with make "Chevrolet". | [
"Find",
"the",
"countries",
"in",
"which",
"there",
"are",
"both",
"drivers",
"with",
"make",
"``",
"Dodge",
"''",
"and",
"drivers",
"with",
"make",
"``",
"Chevrolet",
"''",
"."
] | CREATE TABLE country (
Country_Id NUMBER PRIMARY KEY,
Country TEXT,
Capital TEXT,
Official_native_language TEXT,
Regoin TEXT
);
CREATE TABLE team (
Team_ID NUMBER PRIMARY KEY,
Team TEXT,
Make TEXT,
Manager TEXT,
Sponsor TEXT,
Car_Owner TEXT
);
CREATE TABLE driver (
Driver_ID NUMBER PRIMARY KEY,
... |
art_1 | SELECT DISTINCT LOCATION FROM paintings WHERE YEAR < 1885 OR YEAR > 1930 | [
"SELECT",
"DISTINCT",
"LOCATION",
"FROM",
"paintings",
"WHERE",
"YEAR",
"<",
"1885",
"OR",
"YEAR",
">",
"1930"
] | [
"select",
"distinct",
"location",
"from",
"paintings",
"where",
"year",
"<",
"value",
"or",
"year",
">",
"value"
] | What locations have works painted before 1885 or after 1930? | [
"What",
"locations",
"have",
"works",
"painted",
"before",
"1885",
"or",
"after",
"1930",
"?"
] | CREATE TABLE Artists (
artistID NUMBER PRIMARY KEY,
lname TEXT,
fname TEXT,
birthYear NUMBER,
deathYear NUMBER
);
CREATE TABLE Paintings (
paintingID NUMBER PRIMARY KEY,
title TEXT,
year NUMBER,
height_mm NUMBER,
width_mm NUMBER,
medium TEXT,
mediumOn TEXT,
location TEXT,
painterID NUMBER,
... |
address_1 | SELECT DISTINCT state FROM City | [
"SELECT",
"DISTINCT",
"state",
"FROM",
"City"
] | [
"select",
"distinct",
"state",
"from",
"city"
] | What are all the distinct states? | [
"What",
"are",
"all",
"the",
"distinct",
"states",
"?"
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
real_estate_rentals | SELECT count(*) FROM Properties GROUP BY property_id HAVING count(*) >= 2; | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"Properties",
"GROUP",
"BY",
"property_id",
"HAVING",
"count",
"(",
"*",
")",
">",
"=",
"2",
";"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"properties",
"group",
"by",
"property_id",
"having",
"count",
"(",
"*",
")",
">",
"=",
"value"
] | How many properties are there with at least 2 features? | [
"How",
"many",
"properties",
"are",
"there",
"with",
"at",
"least",
"2",
"features",
"?"
] | CREATE TABLE Ref_Age_Categories (
age_category_code TEXT PRIMARY KEY,
age_category_description TEXT
);
CREATE TABLE Ref_Property_Types (
property_type_code TEXT PRIMARY KEY,
property_type_description TEXT
);
CREATE TABLE Ref_Room_Types (
room_type_code TEXT PRIMARY KEY,
room_type_description TEXT
);
CREATE ... |
conference | SELECT name , nationality FROM staff WHERE staff_id NOT IN (SELECT T2.staff_id FROM Conference AS T1 JOIN Conference_participation AS T2 ON T1.conference_id = T2.conference_id WHERE T1.Conference_Name = "ACL") | [
"SELECT",
"name",
",",
"nationality",
"FROM",
"staff",
"WHERE",
"staff_id",
"NOT",
"IN",
"(",
"SELECT",
"T2.staff_id",
"FROM",
"Conference",
"AS",
"T1",
"JOIN",
"Conference_participation",
"AS",
"T2",
"ON",
"T1.conference_id",
"=",
"T2.conference_id",
"WHERE",
"T1... | [
"select",
"name",
",",
"nationality",
"from",
"staff",
"where",
"staff_id",
"not",
"in",
"(",
"select",
"t2",
".",
"staff_id",
"from",
"conference",
"as",
"t1",
"join",
"conference_participation",
"as",
"t2",
"on",
"t1",
".",
"conference_id",
"=",
"t2",
".",... | What are the names and nationalities of the people who did not participate in any ACL conferences? | [
"What",
"are",
"the",
"names",
"and",
"nationalities",
"of",
"the",
"people",
"who",
"did",
"not",
"participate",
"in",
"any",
"ACL",
"conferences",
"?"
] | CREATE TABLE conference (
Conference_ID NUMBER PRIMARY KEY,
Conference_Name TEXT,
Year NUMBER,
Location TEXT
);
CREATE TABLE institution (
Institution_ID NUMBER PRIMARY KEY,
Institution_Name TEXT,
Location TEXT,
Founded NUMBER
);
CREATE TABLE staff (
staff_ID NUMBER PRIMARY KEY,
name TEXT,
Age NUM... |
cre_Students_Information_Systems | SELECT T1.bio_data , T2.event_date FROM Students AS T1 JOIN Student_Events AS T2 ON T1.student_id = T2.student_id | [
"SELECT",
"T1.bio_data",
",",
"T2.event_date",
"FROM",
"Students",
"AS",
"T1",
"JOIN",
"Student_Events",
"AS",
"T2",
"ON",
"T1.student_id",
"=",
"T2.student_id"
] | [
"select",
"t1",
".",
"bio_data",
",",
"t2",
".",
"event_date",
"from",
"students",
"as",
"t1",
"join",
"student_events",
"as",
"t2",
"on",
"t1",
".",
"student_id",
"=",
"t2",
".",
"student_id"
] | Which students have gone through any event? List the students' biographical data and event date. | [
"Which",
"students",
"have",
"gone",
"through",
"any",
"event",
"?",
"List",
"the",
"students",
"'",
"biographical",
"data",
"and",
"event",
"date",
"."
] | CREATE TABLE Students (
student_id NUMBER PRIMARY KEY,
bio_data TEXT,
student_details TEXT
);
CREATE TABLE Transcripts (
transcript_id NUMBER PRIMARY KEY,
student_id NUMBER,
date_of_transcript TIME,
transcript_details TEXT,
FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Behavio... |
bakery_1 | SELECT item FROM items GROUP BY item ORDER BY count(*) LIMIT 1 | [
"SELECT",
"item",
"FROM",
"items",
"GROUP",
"BY",
"item",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
] | [
"select",
"item",
"from",
"items",
"group",
"by",
"item",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
] | What is the item that was bought the least number of times? | [
"What",
"is",
"the",
"item",
"that",
"was",
"bought",
"the",
"least",
"number",
"of",
"times",
"?"
] | 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... |
art_1 | SELECT T1.lname , T1.fname FROM artists AS T1 JOIN sculptures AS T2 ON T1.artistID = T2.sculptorID INTERSECT SELECT T3.lname , T3.fname FROM artists AS T3 JOIN paintings AS T4 ON T3.artistID = T4.painterID | [
"SELECT",
"T1.lname",
",",
"T1.fname",
"FROM",
"artists",
"AS",
"T1",
"JOIN",
"sculptures",
"AS",
"T2",
"ON",
"T1.artistID",
"=",
"T2.sculptorID",
"INTERSECT",
"SELECT",
"T3.lname",
",",
"T3.fname",
"FROM",
"artists",
"AS",
"T3",
"JOIN",
"paintings",
"AS",
"T4... | [
"select",
"t1",
".",
"lname",
",",
"t1",
".",
"fname",
"from",
"artists",
"as",
"t1",
"join",
"sculptures",
"as",
"t2",
"on",
"t1",
".",
"artistid",
"=",
"t2",
".",
"sculptorid",
"intersect",
"select",
"t3",
".",
"lname",
",",
"t3",
".",
"fname",
"fr... | Give the full names of artists who have created paintings and sculptures. | [
"Give",
"the",
"full",
"names",
"of",
"artists",
"who",
"have",
"created",
"paintings",
"and",
"sculptures",
"."
] | CREATE TABLE Artists (
artistID NUMBER PRIMARY KEY,
lname TEXT,
fname TEXT,
birthYear NUMBER,
deathYear NUMBER
);
CREATE TABLE Paintings (
paintingID NUMBER PRIMARY KEY,
title TEXT,
year NUMBER,
height_mm NUMBER,
width_mm NUMBER,
medium TEXT,
mediumOn TEXT,
location TEXT,
painterID NUMBER,
... |
warehouse_1 | SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS = 'Rocks' OR CONTENTS = 'Scissors' | [
"SELECT",
"DISTINCT",
"warehouse",
"FROM",
"boxes",
"WHERE",
"CONTENTS",
"=",
"'Rocks",
"'",
"OR",
"CONTENTS",
"=",
"'Scissors",
"'"
] | [
"select",
"distinct",
"warehouse",
"from",
"boxes",
"where",
"contents",
"=",
"value",
"or",
"contents",
"=",
"value"
] | What are the distinct warehouses that have boxes with Rocks or Scissors as contents? | [
"What",
"are",
"the",
"distinct",
"warehouses",
"that",
"have",
"boxes",
"with",
"Rocks",
"or",
"Scissors",
"as",
"contents",
"?"
] | 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)
); |
boat_1 | SELECT name FROM Sailors WHERE rating > (SELECT max(T1.rating) FROM Sailors AS T1 JOIN Reserves AS T2 ON T1.sid = T2.sid JOIN Boats AS T3 ON T3.bid = T2.bid WHERE T3.color = 'red') | [
"SELECT",
"name",
"FROM",
"Sailors",
"WHERE",
"rating",
">",
"(",
"SELECT",
"max",
"(",
"T1.rating",
")",
"FROM",
"Sailors",
"AS",
"T1",
"JOIN",
"Reserves",
"AS",
"T2",
"ON",
"T1.sid",
"=",
"T2.sid",
"JOIN",
"Boats",
"AS",
"T3",
"ON",
"T3.bid",
"=",
"T... | [
"select",
"name",
"from",
"sailors",
"where",
"rating",
">",
"(",
"select",
"max",
"(",
"t1",
".",
"rating",
")",
"from",
"sailors",
"as",
"t1",
"join",
"reserves",
"as",
"t2",
"on",
"t1",
".",
"sid",
"=",
"t2",
".",
"sid",
"join",
"boats",
"as",
"... | Find the names of sailors whose rating is larger than the rating of all sailors who booked a red boat. | [
"Find",
"the",
"names",
"of",
"sailors",
"whose",
"rating",
"is",
"larger",
"than",
"the",
"rating",
"of",
"all",
"sailors",
"who",
"booked",
"a",
"red",
"boat",
"."
] | CREATE TABLE Sailors (
sid NUMBER PRIMARY KEY,
name TEXT,
rating NUMBER,
age NUMBER
);
CREATE TABLE Boats (
bid NUMBER PRIMARY KEY,
name TEXT,
color TEXT
);
CREATE TABLE Reserves (
sid NUMBER,
bid NUMBER,
day TEXT,
FOREIGN KEY (bid) REFERENCES Boats(bid),
FOREIGN KEY (sid) REFERENCES Sailors(sid... |
bakery_1 | SELECT item FROM items GROUP BY item ORDER BY COUNT (*) DESC LIMIT 3 | [
"SELECT",
"item",
"FROM",
"items",
"GROUP",
"BY",
"item",
"ORDER",
"BY",
"COUNT",
"(",
"*",
")",
"DESC",
"LIMIT",
"3"
] | [
"select",
"item",
"from",
"items",
"group",
"by",
"item",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | Give the three most purchased items at this bakery. | [
"Give",
"the",
"three",
"most",
"purchased",
"items",
"at",
"this",
"bakery",
"."
] | 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... |
aan_1 | SELECT count(DISTINCT T1.paper_id) FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Affiliation AS T3 ON T2.affiliation_id = T3.affiliation_id WHERE T1.year >= 2000 AND T1.year <= 2009 AND T3.name LIKE "Stanford University" | [
"SELECT",
"count",
"(",
"DISTINCT",
"T1.paper_id",
")",
"FROM",
"Paper",
"AS",
"T1",
"JOIN",
"Author_list",
"AS",
"T2",
"ON",
"T1.paper_id",
"=",
"T2.paper_id",
"JOIN",
"Affiliation",
"AS",
"T3",
"ON",
"T2.affiliation_id",
"=",
"T3.affiliation_id",
"WHERE",
"T1.... | [
"select",
"count",
"(",
"distinct",
"t1",
".",
"paper_id",
")",
"from",
"paper",
"as",
"t1",
"join",
"author_list",
"as",
"t2",
"on",
"t1",
".",
"paper_id",
"=",
"t2",
".",
"paper_id",
"join",
"affiliation",
"as",
"t3",
"on",
"t2",
".",
"affiliation_id",... | Count the number of papers Stanford University had between 2000 and 2009. | [
"Count",
"the",
"number",
"of",
"papers",
"Stanford",
"University",
"had",
"between",
"2000",
"and",
"2009",
"."
] | 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... |
address_1 | SELECT T3.city_name FROM Direct_distance AS T1 JOIN City AS T2 ON T1.city1_code = T2.city_code JOIN City AS T3 ON T1.city2_code = T3.city_code WHERE T2.city_name = "Boston" ORDER BY distance DESC LIMIT 1 | [
"SELECT",
"T3.city_name",
"FROM",
"Direct_distance",
"AS",
"T1",
"JOIN",
"City",
"AS",
"T2",
"ON",
"T1.city1_code",
"=",
"T2.city_code",
"JOIN",
"City",
"AS",
"T3",
"ON",
"T1.city2_code",
"=",
"T3.city_code",
"WHERE",
"T2.city_name",
"=",
"``",
"Boston",
"''",
... | [
"select",
"t3",
".",
"city_name",
"from",
"direct_distance",
"as",
"t1",
"join",
"city",
"as",
"t2",
"on",
"t1",
".",
"city1_code",
"=",
"t2",
".",
"city_code",
"join",
"city",
"as",
"t3",
"on",
"t1",
".",
"city2_code",
"=",
"t3",
".",
"city_code",
"wh... | Give the city name of the city with greatest distance from Boston. | [
"Give",
"the",
"city",
"name",
"of",
"the",
"city",
"with",
"greatest",
"distance",
"from",
"Boston",
"."
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
address_1 | SELECT sum(distance) FROM Direct_distance WHERE city1_code = "BAL" | [
"SELECT",
"sum",
"(",
"distance",
")",
"FROM",
"Direct_distance",
"WHERE",
"city1_code",
"=",
"``",
"BAL",
"''"
] | [
"select",
"sum",
"(",
"distance",
")",
"from",
"direct_distance",
"where",
"city1_code",
"=",
"value"
] | What is the total distance between city BAL and all other cities. | [
"What",
"is",
"the",
"total",
"distance",
"between",
"city",
"BAL",
"and",
"all",
"other",
"cities",
"."
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
e_commerce | select product_color , product_description , product_size from products where product_price != ( select max(product_price) from products ) | [
"select",
"product_color",
",",
"product_description",
",",
"product_size",
"from",
"products",
"where",
"product_price",
"!=",
"(",
"select",
"max",
"(",
"product_price",
")",
"from",
"products",
")"
] | [
"select",
"product_color",
",",
"product_description",
",",
"product_size",
"from",
"products",
"where",
"product_price",
"!",
"=",
"(",
"select",
"max",
"(",
"product_price",
")",
"from",
"products",
")"
] | What are the colors , descriptions , and sizes for all products that are not at the maximum price ? | [
"What",
"are",
"the",
"colors",
",",
"descriptions",
",",
"and",
"sizes",
"for",
"all",
"products",
"that",
"are",
"not",
"at",
"the",
"maximum",
"price",
"?"
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
parent_product_id NUMBER,
product_name TEXT,
product_price NUMBER,
product_color TEXT,
product_size TEXT,
product_description TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
gender_code TEXT,
customer_first_name TEXT,
customer... |
aan_1 | SELECT venue , YEAR FROM paper GROUP BY venue , YEAR ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"venue",
",",
"YEAR",
"FROM",
"paper",
"GROUP",
"BY",
"venue",
",",
"YEAR",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"venue",
",",
"year",
"from",
"paper",
"group",
"by",
"venue",
",",
"year",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | What was the venue and year with the most publications? | [
"What",
"was",
"the",
"venue",
"and",
"year",
"with",
"the",
"most",
"publications",
"?"
] | 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... |
cre_Students_Information_Systems | select bio_data from students where student_id not in (select t1.student_id from students as t1 join detention as t2 on t1.student_id = t2.student_id union select t1.student_id from students as t1 join student_loans as t2 on t1.student_id = t2.student_id) | [
"select",
"bio_data",
"from",
"students",
"where",
"student_id",
"not",
"in",
"(",
"select",
"t1.student_id",
"from",
"students",
"as",
"t1",
"join",
"detention",
"as",
"t2",
"on",
"t1.student_id",
"=",
"t2.student_id",
"union",
"select",
"t1.student_id",
"from",
... | [
"select",
"bio_data",
"from",
"students",
"where",
"student_id",
"not",
"in",
"(",
"select",
"t1",
".",
"student_id",
"from",
"students",
"as",
"t1",
"join",
"detention",
"as",
"t2",
"on",
"t1",
".",
"student_id",
"=",
"t2",
".",
"student_id",
"union",
"se... | List the biographical data of the students who never had a detention or student loan . | [
"List",
"the",
"biographical",
"data",
"of",
"the",
"students",
"who",
"never",
"had",
"a",
"detention",
"or",
"student",
"loan",
"."
] | CREATE TABLE Students (
student_id NUMBER PRIMARY KEY,
bio_data TEXT,
student_details TEXT
);
CREATE TABLE Transcripts (
transcript_id NUMBER PRIMARY KEY,
student_id NUMBER,
date_of_transcript TIME,
transcript_details TEXT,
FOREIGN KEY (student_id) REFERENCES Students(student_id)
);
CREATE TABLE Behavio... |
soccer_3 | SELECT Name FROM player ORDER BY Wins_count ASC | [
"SELECT",
"Name",
"FROM",
"player",
"ORDER",
"BY",
"Wins_count",
"ASC"
] | [
"select",
"name",
"from",
"player",
"order",
"by",
"wins_count",
"asc"
] | What are the names of players in ascending order of wins count? | [
"What",
"are",
"the",
"names",
"of",
"players",
"in",
"ascending",
"order",
"of",
"wins",
"count",
"?"
] | 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... |
e_commerce | SELECT order_status_code FROM Orders GROUP BY order_status_code ORDER BY count(*) LIMIT 1 | [
"SELECT",
"order_status_code",
"FROM",
"Orders",
"GROUP",
"BY",
"order_status_code",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"LIMIT",
"1"
] | [
"select",
"order_status_code",
"from",
"orders",
"group",
"by",
"order_status_code",
"order",
"by",
"count",
"(",
"*",
")",
"limit",
"value"
] | What is the most uncommon order status? | [
"What",
"is",
"the",
"most",
"uncommon",
"order",
"status",
"?"
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
parent_product_id NUMBER,
product_name TEXT,
product_price NUMBER,
product_color TEXT,
product_size TEXT,
product_description TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
gender_code TEXT,
customer_first_name TEXT,
customer... |
car_racing | SELECT max(Points) , min(Points) FROM driver | [
"SELECT",
"max",
"(",
"Points",
")",
",",
"min",
"(",
"Points",
")",
"FROM",
"driver"
] | [
"select",
"max",
"(",
"points",
")",
",",
"min",
"(",
"points",
")",
"from",
"driver"
] | What are the maximum and minimum points of drivers. | [
"What",
"are",
"the",
"maximum",
"and",
"minimum",
"points",
"of",
"drivers",
"."
] | CREATE TABLE country (
Country_Id NUMBER PRIMARY KEY,
Country TEXT,
Capital TEXT,
Official_native_language TEXT,
Regoin TEXT
);
CREATE TABLE team (
Team_ID NUMBER PRIMARY KEY,
Team TEXT,
Make TEXT,
Manager TEXT,
Sponsor TEXT,
Car_Owner TEXT
);
CREATE TABLE driver (
Driver_ID NUMBER PRIMARY KEY,
... |
address_1 | SELECT latitude , longitude FROM City WHERE city_name = "Baltimore" | [
"SELECT",
"latitude",
",",
"longitude",
"FROM",
"City",
"WHERE",
"city_name",
"=",
"``",
"Baltimore",
"''"
] | [
"select",
"latitude",
",",
"longitude",
"from",
"city",
"where",
"city_name",
"=",
"value"
] | What is the latitude and longitude for Baltimore? | [
"What",
"is",
"the",
"latitude",
"and",
"longitude",
"for",
"Baltimore",
"?"
] | CREATE TABLE Student (
StuID NUMBER PRIMARY KEY,
LName TEXT,
Fname TEXT,
Age NUMBER,
Sex TEXT,
Major NUMBER,
Advisor NUMBER,
city_code TEXT,
FOREIGN KEY (city_code) REFERENCES City(city_code)
);
CREATE TABLE Direct_distance (
city1_code TEXT,
city2_code TEXT,
distance NUMBER,
FOREIGN KEY (city... |
vehicle_rent | SELECT count(*) FROM vehicles | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"vehicles"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"vehicles"
] | How many vehicles do we have? | [
"How",
"many",
"vehicles",
"do",
"we",
"have",
"?"
] | CREATE TABLE Customers (
id NUMBER PRIMARY KEY,
name TEXT,
age NUMBER,
membership_credit NUMBER
);
CREATE TABLE Discount (
id NUMBER PRIMARY KEY,
name TEXT,
membership_credit NUMBER
);
CREATE TABLE Vehicles (
id NUMBER PRIMARY KEY,
name TEXT,
Model_year NUMBER,
Type_of_powertrain TEXT,
Combined_... |
advertising_agencies | SELECT invoice_status FROM Invoices GROUP BY invoice_status ORDER BY count(*) DESC LIMIT 1 | [
"SELECT",
"invoice_status",
"FROM",
"Invoices",
"GROUP",
"BY",
"invoice_status",
"ORDER",
"BY",
"count",
"(",
"*",
")",
"DESC",
"LIMIT",
"1"
] | [
"select",
"invoice_status",
"from",
"invoices",
"group",
"by",
"invoice_status",
"order",
"by",
"count",
"(",
"*",
")",
"desc",
"limit",
"value"
] | What is the invoice status code with most number of invoices. | [
"What",
"is",
"the",
"invoice",
"status",
"code",
"with",
"most",
"number",
"of",
"invoices",
"."
] | CREATE TABLE Agencies (
agency_id NUMBER PRIMARY KEY,
agency_details TEXT
);
CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
agency_id NUMBER,
staff_details TEXT
);
CREATE TABLE Clients (
client_id NUMBER PRIMARY KEY,
agency_id NUMBER,
sic_code TEXT,
client_details TEXT,
FOREIGN KEY (agency_id) RE... |
boat_1 | SELECT DISTINCT T2.sid FROM Boats AS T1 JOIN Reserves AS T2 ON T1.bid = T2.bid WHERE T1.color = 'red' INTERSECT SELECT DISTINCT T2.sid FROM Boats AS T1 JOIN Reserves AS T2 ON T1.bid = T2.bid WHERE T1.color = "blue" | [
"SELECT",
"DISTINCT",
"T2.sid",
"FROM",
"Boats",
"AS",
"T1",
"JOIN",
"Reserves",
"AS",
"T2",
"ON",
"T1.bid",
"=",
"T2.bid",
"WHERE",
"T1.color",
"=",
"'red",
"'",
"INTERSECT",
"SELECT",
"DISTINCT",
"T2.sid",
"FROM",
"Boats",
"AS",
"T1",
"JOIN",
"Reserves",
... | [
"select",
"distinct",
"t2",
".",
"sid",
"from",
"boats",
"as",
"t1",
"join",
"reserves",
"as",
"t2",
"on",
"t1",
".",
"bid",
"=",
"t2",
".",
"bid",
"where",
"t1",
".",
"color",
"=",
"value",
"intersect",
"select",
"distinct",
"t2",
".",
"sid",
"from"... | Find the id of Sailors (sid) that reserved red and blue boat. | [
"Find",
"the",
"id",
"of",
"Sailors",
"(",
"sid",
")",
"that",
"reserved",
"red",
"and",
"blue",
"boat",
"."
] | CREATE TABLE Sailors (
sid NUMBER PRIMARY KEY,
name TEXT,
rating NUMBER,
age NUMBER
);
CREATE TABLE Boats (
bid NUMBER PRIMARY KEY,
name TEXT,
color TEXT
);
CREATE TABLE Reserves (
sid NUMBER,
bid NUMBER,
day TEXT,
FOREIGN KEY (bid) REFERENCES Boats(bid),
FOREIGN KEY (sid) REFERENCES Sailors(sid... |
boat_1 | SELECT name FROM Sailors WHERE name LIKE '%e%' | [
"SELECT",
"name",
"FROM",
"Sailors",
"WHERE",
"name",
"LIKE",
"'",
"%",
"e",
"%",
"'"
] | [
"select",
"name",
"from",
"sailors",
"where",
"name",
"like",
"value"
] | What is the name of sailors whose names contain letter e? | [
"What",
"is",
"the",
"name",
"of",
"sailors",
"whose",
"names",
"contain",
"letter",
"e",
"?"
] | CREATE TABLE Sailors (
sid NUMBER PRIMARY KEY,
name TEXT,
rating NUMBER,
age NUMBER
);
CREATE TABLE Boats (
bid NUMBER PRIMARY KEY,
name TEXT,
color TEXT
);
CREATE TABLE Reserves (
sid NUMBER,
bid NUMBER,
day TEXT,
FOREIGN KEY (bid) REFERENCES Boats(bid),
FOREIGN KEY (sid) REFERENCES Sailors(sid... |
aan_1 | SELECT DISTINCT T1.title , T1.paper_id FROM Paper AS T1 JOIN Author_list AS T2 ON T1.paper_id = T2.paper_id JOIN Author AS T3 ON T2.author_id = T3.author_id WHERE T3.name LIKE "%Mckeown , Kathleen%" OR T3.name LIKE "%Rambow , Owen%" | [
"SELECT",
"DISTINCT",
"T1.title",
",",
"T1.paper_id",
"FROM",
"Paper",
"AS",
"T1",
"JOIN",
"Author_list",
"AS",
"T2",
"ON",
"T1.paper_id",
"=",
"T2.paper_id",
"JOIN",
"Author",
"AS",
"T3",
"ON",
"T2.author_id",
"=",
"T3.author_id",
"WHERE",
"T3.name",
"LIKE",
... | [
"select",
"distinct",
"t1",
".",
"title",
",",
"t1",
".",
"paper_id",
"from",
"paper",
"as",
"t1",
"join",
"author_list",
"as",
"t2",
"on",
"t1",
".",
"paper_id",
"=",
"t2",
".",
"paper_id",
"join",
"author",
"as",
"t3",
"on",
"t2",
".",
"author_id",
... | What are the titles and paper ids for papers that have Mckeown, Kathleen or Rambow, Owen in their author list? | [
"What",
"are",
"the",
"titles",
"and",
"paper",
"ids",
"for",
"papers",
"that",
"have",
"Mckeown",
",",
"Kathleen",
"or",
"Rambow",
",",
"Owen",
"in",
"their",
"author",
"list",
"?"
] | 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... |
advertising_agencies | SELECT count(*) FROM Staff | [
"SELECT",
"count",
"(",
"*",
")",
"FROM",
"Staff"
] | [
"select",
"count",
"(",
"*",
")",
"from",
"staff"
] | Count the number of staff. | [
"Count",
"the",
"number",
"of",
"staff",
"."
] | CREATE TABLE Agencies (
agency_id NUMBER PRIMARY KEY,
agency_details TEXT
);
CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
agency_id NUMBER,
staff_details TEXT
);
CREATE TABLE Clients (
client_id NUMBER PRIMARY KEY,
agency_id NUMBER,
sic_code TEXT,
client_details TEXT,
FOREIGN KEY (agency_id) RE... |
online_exams | SELECT Exam_Date , Exam_Name FROM Exams WHERE Subject_Code != 'Database' | [
"SELECT",
"Exam_Date",
",",
"Exam_Name",
"FROM",
"Exams",
"WHERE",
"Subject_Code",
"!",
"=",
"'Database",
"'"
] | [
"select",
"exam_date",
",",
"exam_name",
"from",
"exams",
"where",
"subject_code",
"!",
"=",
"value"
] | What are the names and dates of the exams with subject code that is not "Database"? | [
"What",
"are",
"the",
"names",
"and",
"dates",
"of",
"the",
"exams",
"with",
"subject",
"code",
"that",
"is",
"not",
"``",
"Database",
"''",
"?"
] | CREATE TABLE Students (
Student_ID NUMBER PRIMARY KEY,
First_Name TEXT,
Middle_Name TEXT,
Last_Name TEXT,
Gender_MFU TEXT,
Student_Address TEXT,
Email_Adress TEXT,
Cell_Mobile_Phone TEXT,
Home_Phone TEXT
);
CREATE TABLE Questions (
Question_ID NUMBER PRIMARY KEY,
Type_of_Question_Code TEXT,
Ques... |
soccer_3 | SELECT T2.Name , T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID | [
"SELECT",
"T2.Name",
",",
"T1.Name",
"FROM",
"club",
"AS",
"T1",
"JOIN",
"player",
"AS",
"T2",
"ON",
"T1.Club_ID",
"=",
"T2.Club_ID"
] | [
"select",
"t2",
".",
"name",
",",
"t1",
".",
"name",
"from",
"club",
"as",
"t1",
"join",
"player",
"as",
"t2",
"on",
"t1",
".",
"club_id",
"=",
"t2",
".",
"club_id"
] | What are the names of players and the corresponding clubs that they are in? | [
"What",
"are",
"the",
"names",
"of",
"players",
"and",
"the",
"corresponding",
"clubs",
"that",
"they",
"are",
"in",
"?"
] | 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... |
customers_and_orders | SELECT product_id , product_type_code , product_name FROM Products | [
"SELECT",
"product_id",
",",
"product_type_code",
",",
"product_name",
"FROM",
"Products"
] | [
"select",
"product_id",
",",
"product_type_code",
",",
"product_name",
"from",
"products"
] | What are the ids, type codes, and names for all products? | [
"What",
"are",
"the",
"ids",
",",
"type",
"codes",
",",
"and",
"names",
"for",
"all",
"products",
"?"
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
product_type_code TEXT,
product_name TEXT,
product_price NUMBER
);
CREATE TABLE Addresses (
address_id NUMBER PRIMARY KEY,
address_details TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
address_id NUMBER,
payment_method_code TEXT... |
e_commerce | SELECT T1.gender_code , count(*) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id JOIN Order_items AS T3 ON T2.order_id = T3.order_id GROUP BY T1.gender_code | [
"SELECT",
"T1.gender_code",
",",
"count",
"(",
"*",
")",
"FROM",
"Customers",
"AS",
"T1",
"JOIN",
"Orders",
"AS",
"T2",
"ON",
"T1.customer_id",
"=",
"T2.customer_id",
"JOIN",
"Order_items",
"AS",
"T3",
"ON",
"T2.order_id",
"=",
"T3.order_id",
"GROUP",
"BY",
... | [
"select",
"t1",
".",
"gender_code",
",",
"count",
"(",
"*",
")",
"from",
"customers",
"as",
"t1",
"join",
"orders",
"as",
"t2",
"on",
"t1",
".",
"customer_id",
"=",
"t2",
".",
"customer_id",
"join",
"order_items",
"as",
"t3",
"on",
"t2",
".",
"order_id... | How many number of products does each gender of customers buy? List the gender and the number | [
"How",
"many",
"number",
"of",
"products",
"does",
"each",
"gender",
"of",
"customers",
"buy",
"?",
"List",
"the",
"gender",
"and",
"the",
"number"
] | CREATE TABLE Products (
product_id NUMBER PRIMARY KEY,
parent_product_id NUMBER,
product_name TEXT,
product_price NUMBER,
product_color TEXT,
product_size TEXT,
product_description TEXT
);
CREATE TABLE Customers (
customer_id NUMBER PRIMARY KEY,
gender_code TEXT,
customer_first_name TEXT,
customer... |
soccer_3 | SELECT T1.Name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Wins_count > 2 | [
"SELECT",
"T1.Name",
"FROM",
"club",
"AS",
"T1",
"JOIN",
"player",
"AS",
"T2",
"ON",
"T1.Club_ID",
"=",
"T2.Club_ID",
"WHERE",
"T2.Wins_count",
">",
"2"
] | [
"select",
"t1",
".",
"name",
"from",
"club",
"as",
"t1",
"join",
"player",
"as",
"t2",
"on",
"t1",
".",
"club_id",
"=",
"t2",
".",
"club_id",
"where",
"t2",
".",
"wins_count",
">",
"value"
] | Show names of clubs that have players with more than 2 win counts. | [
"Show",
"names",
"of",
"clubs",
"that",
"have",
"players",
"with",
"more",
"than",
"2",
"win",
"counts",
"."
] | 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... |
bakery_1 | SELECT min(price) FROM goods WHERE flavor = "Cheese" | [
"SELECT",
"min",
"(",
"price",
")",
"FROM",
"goods",
"WHERE",
"flavor",
"=",
"``",
"Cheese",
"''"
] | [
"select",
"min",
"(",
"price",
")",
"from",
"goods",
"where",
"flavor",
"=",
"value"
] | Return the cheapest price for goods with cheese flavor. | [
"Return",
"the",
"cheapest",
"price",
"for",
"goods",
"with",
"cheese",
"flavor",
"."
] | 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... |
cre_Doc_Workflow | SELECT count(DISTINCT document_id) FROM Documents_processes | [
"SELECT",
"count",
"(",
"DISTINCT",
"document_id",
")",
"FROM",
"Documents_processes"
] | [
"select",
"count",
"(",
"distinct",
"document_id",
")",
"from",
"documents_processes"
] | How many documents have a process? | [
"How",
"many",
"documents",
"have",
"a",
"process",
"?"
] | CREATE TABLE Staff (
staff_id NUMBER PRIMARY KEY,
staff_details TEXT
);
CREATE TABLE Ref_Staff_Roles (
staff_role_code TEXT PRIMARY KEY,
staff_role_description TEXT
);
CREATE TABLE Process_Outcomes (
process_outcome_code TEXT PRIMARY KEY,
process_outcome_description TEXT
);
CREATE TABLE Process_Status (
p... |
End of preview. Expand in Data Studio
Spider-Context-Stratified-Test-Set: Text-to-SQL Reasoning Dataset
This dataset is an enhanced, "inference-ready" version of the Spider test set. It addresses the common "Schema Hallucination" problem by injecting raw SQL DDL (Data Definition Language) directly into the dataset, specifically designed for Mistral-Nemo-12B and other models requiring long-context database grounding.
Key Enhancements
- DDL Context Injection: Every sample is augmented with a
contextcolumn containing validCREATE TABLEandFOREIGN KEYstatements. - Complexity Stratification: Unlike the original split, this dataset was partitioned using Stratified Sampling based on SQL query length and structural complexity.
- AWQ-Optimized: Includes a dedicated
calibrationsplit (10%) to optimize 4-bit quantization scaling factors without leaking evaluation data.
Splits
calibration(536 samples): Used for post-training quantization (AWQ/GPTQ) to protect salient weights.test(1611 samples): The "Final Exam" for measuring Execution Accuracy (EX) and Exact Match (EM).
Construction Methodology
1. Schema Reconstruction
The context was reconstructed by mapping test_tables.json metadata into structured DDL. Foreign key relationships were explicitly preserved to ensure the model can learn join-path reasoning.
2. Stratification Logic
We utilized a 5-bin quantile approach based on the character length of the SQL queries
Citation
@inproceedings{Yu&al.18c,
title = {Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task},
author = {Tao Yu and Rui Zhang and Kai Yang and Michihiro Yasunaga and Dongxu Wang and Zifan Li and James Ma and Irene Li and Qingning Yao and Shanelle Roman and Zilin Zhang and Dragomir Radev}
booktitle = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing",
address = "Brussels, Belgium",
publisher = "Association for Computational Linguistics",
year = 2018
}
- Downloads last month
- 18