db_id
stringclasses
140 values
schema
sequencelengths
0
26
question
stringlengths
16
224
query
stringlengths
18
577
query_toks
sequencelengths
4
90
query_toks_no_value
sequencelengths
4
125
question_toks
sequencelengths
4
44
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
Find the number of matches in different competitions.
SELECT count(*) , Competition FROM MATCH GROUP BY Competition
[ "SELECT", "count", "(", "*", ")", ",", "Competition", "FROM", "MATCH", "GROUP", "BY", "Competition" ]
[ "select", "count", "(", "*", ")", ",", "competition", "from", "match", "group", "by", "competition" ]
[ "Find", "the", "number", "of", "matches", "in", "different", "competitions", "." ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
For each competition, count the number of matches.
SELECT count(*) , Competition FROM MATCH GROUP BY Competition
[ "SELECT", "count", "(", "*", ")", ",", "Competition", "FROM", "MATCH", "GROUP", "BY", "Competition" ]
[ "select", "count", "(", "*", ")", ",", "competition", "from", "match", "group", "by", "competition" ]
[ "For", "each", "competition", ",", "count", "the", "number", "of", "matches", "." ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
List venues of all matches in the order of their dates starting from the most recent one.
SELECT venue FROM MATCH ORDER BY date DESC
[ "SELECT", "venue", "FROM", "MATCH", "ORDER", "BY", "date", "DESC" ]
[ "select", "venue", "from", "match", "order", "by", "date", "desc" ]
[ "List", "venues", "of", "all", "matches", "in", "the", "order", "of", "their", "dates", "starting", "from", "the", "most", "recent", "one", "." ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
What are the venues of all the matches? Sort them in the descending order of match date.
SELECT venue FROM MATCH ORDER BY date DESC
[ "SELECT", "venue", "FROM", "MATCH", "ORDER", "BY", "date", "DESC" ]
[ "select", "venue", "from", "match", "order", "by", "date", "desc" ]
[ "What", "are", "the", "venues", "of", "all", "the", "matches", "?", "Sort", "them", "in", "the", "descending", "order", "of", "match", "date", "." ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
what is the GDP of the city with the largest population.
SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
[ "SELECT", "gdp", "FROM", "city", "ORDER", "BY", "Regional_Population", "DESC", "LIMIT", "1" ]
[ "select", "gdp", "from", "city", "order", "by", "regional_population", "desc", "limit", "value" ]
[ "what", "is", "the", "GDP", "of", "the", "city", "with", "the", "largest", "population", "." ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
Find the GDP of the city with the largest regional population.
SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
[ "SELECT", "gdp", "FROM", "city", "ORDER", "BY", "Regional_Population", "DESC", "LIMIT", "1" ]
[ "select", "gdp", "from", "city", "order", "by", "regional_population", "desc", "limit", "value" ]
[ "Find", "the", "GDP", "of", "the", "city", "with", "the", "largest", "regional", "population", "." ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
What are the GDP and population of the city that already served as a host more than once?
SELECT t1.gdp , t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING count(*) > 1
[ "SELECT", "t1.gdp", ",", "t1.Regional_Population", "FROM", "city", "AS", "T1", "JOIN", "hosting_city", "AS", "T2", "ON", "T1.city_id", "=", "T2.host_city", "GROUP", "BY", "t2.Host_City", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "gdp", ",", "t1", ".", "regional_population", "from", "city", "as", "t1", "join", "hosting_city", "as", "t2", "on", "t1", ".", "city_id", "=", "t2", ".", "host_city", "group", "by", "t2", ".", "host_city", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "GDP", "and", "population", "of", "the", "city", "that", "already", "served", "as", "a", "host", "more", "than", "once", "?" ]
city_record
[ "CREATE TABLE \"city\" (\n\"City_ID\" int,\n\"City\" text,\n\"Hanzi\" text,\n\"Hanyu_Pinyin\" text,\n\"Regional_Population\" int,\n\"GDP\" real,\nPRIMARY KEY (\"City_ID\")\n);", "CREATE TABLE \"match\" (\n\"Match_ID\" int,\n\"Date\" text,\n\"Venue\" text,\n\"Score\" text,\n\"Result\" text,\n\"Competition\" text,\nPRIMARY KEY (\"Match_ID\")\n);", "CREATE TABLE \"temperature\" (\n\"City_ID\" int,\n\"Jan\" real,\n\"Feb\" real,\n\"Mar\" real,\n\"Apr\" real,\n\"Jun\" real,\n\"Jul\" real,\n\"Aug\" real,\n\"Sep\" real,\n\"Oct\" real,\n\"Nov\" real,\n\"Dec\" real,\nPRIMARY KEY (\"City_ID\"),\nFOREIGN KEY (`City_ID`) REFERENCES `city`(`City_ID`)\n);", "CREATE TABLE \"hosting_city\" (\n \"Year\" int,\n \"Match_ID\" int,\n \"Host_City\" text,\n PRIMARY KEY (\"Year\"),\n FOREIGN KEY (`Host_City`) REFERENCES `city`(`City_ID`),\n FOREIGN KEY (`Match_ID`) REFERENCES `match`(`Match_ID`)\n);" ]
Which cities have served as host cities more than once? Return me their GDP and population.
SELECT t1.gdp , t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING count(*) > 1
[ "SELECT", "t1.gdp", ",", "t1.Regional_Population", "FROM", "city", "AS", "T1", "JOIN", "hosting_city", "AS", "T2", "ON", "T1.city_id", "=", "T2.host_city", "GROUP", "BY", "t2.Host_City", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "gdp", ",", "t1", ".", "regional_population", "from", "city", "as", "t1", "join", "hosting_city", "as", "t2", "on", "t1", ".", "city_id", "=", "t2", ".", "host_city", "group", "by", "t2", ".", "host_city", "having", "count", "(", "*", ")", ">", "value" ]
[ "Which", "cities", "have", "served", "as", "host", "cities", "more", "than", "once", "?", "Return", "me", "their", "GDP", "and", "population", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
List every individual's first name, middle name and last name in alphabetical order by last name.
SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name
[ "SELECT", "individual_first_name", ",", "individual_middle_name", ",", "individual_last_name", "FROM", "individuals", "ORDER", "BY", "individual_last_name" ]
[ "select", "individual_first_name", ",", "individual_middle_name", ",", "individual_last_name", "from", "individuals", "order", "by", "individual_last_name" ]
[ "List", "every", "individual", "'s", "first", "name", ",", "middle", "name", "and", "last", "name", "in", "alphabetical", "order", "by", "last", "name", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the first, middle, and last names of all individuals, ordered by last name?
SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name
[ "SELECT", "individual_first_name", ",", "individual_middle_name", ",", "individual_last_name", "FROM", "individuals", "ORDER", "BY", "individual_last_name" ]
[ "select", "individual_first_name", ",", "individual_middle_name", ",", "individual_last_name", "from", "individuals", "order", "by", "individual_last_name" ]
[ "What", "are", "the", "first", ",", "middle", ",", "and", "last", "names", "of", "all", "individuals", ",", "ordered", "by", "last", "name", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
List all the types of forms.
SELECT DISTINCT form_type_code FROM forms
[ "SELECT", "DISTINCT", "form_type_code", "FROM", "forms" ]
[ "select", "distinct", "form_type_code", "from", "forms" ]
[ "List", "all", "the", "types", "of", "forms", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the different types of forms?
SELECT DISTINCT form_type_code FROM forms
[ "SELECT", "DISTINCT", "form_type_code", "FROM", "forms" ]
[ "select", "distinct", "form_type_code", "from", "forms" ]
[ "What", "are", "the", "different", "types", "of", "forms", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the name of the most popular party form.
SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "t1.form_name", "FROM", "forms", "AS", "t1", "JOIN", "party_forms", "AS", "t2", "ON", "t1.form_id", "=", "t2.form_id", "GROUP", "BY", "t2.form_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "form_name", "from", "forms", "as", "t1", "join", "party_forms", "as", "t2", "on", "t1", ".", "form_id", "=", "t2", ".", "form_id", "group", "by", "t2", ".", "form_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "the", "most", "popular", "party", "form", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What is the name of the party form that is most common?
SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "t1.form_name", "FROM", "forms", "AS", "t1", "JOIN", "party_forms", "AS", "t2", "ON", "t1.form_id", "=", "t2.form_id", "GROUP", "BY", "t2.form_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "form_name", "from", "forms", "as", "t1", "join", "party_forms", "as", "t2", "on", "t1", ".", "form_id", "=", "t2", ".", "form_id", "group", "by", "t2", ".", "form_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "party", "form", "that", "is", "most", "common", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the payment method and phone of the party with email "enrico09@example.com".
SELECT payment_method_code , party_phone FROM parties WHERE party_email = "enrico09@example.com"
[ "SELECT", "payment_method_code", ",", "party_phone", "FROM", "parties", "WHERE", "party_email", "=", "``", "enrico09", "@", "example.com", "''" ]
[ "select", "payment_method_code", ",", "party_phone", "from", "parties", "where", "party_email", "=", "value" ]
[ "Find", "the", "payment", "method", "and", "phone", "of", "the", "party", "with", "email", "``", "enrico09", "@", "example.com", "''", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What is the payment method code and party phone of the party with the email 'enrico09@example.com'?
SELECT payment_method_code , party_phone FROM parties WHERE party_email = "enrico09@example.com"
[ "SELECT", "payment_method_code", ",", "party_phone", "FROM", "parties", "WHERE", "party_email", "=", "``", "enrico09", "@", "example.com", "''" ]
[ "select", "payment_method_code", ",", "party_phone", "from", "parties", "where", "party_email", "=", "value" ]
[ "What", "is", "the", "payment", "method", "code", "and", "party", "phone", "of", "the", "party", "with", "the", "email", "'enrico09", "@", "example.com", "'", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the emails of parties with the most popular party form.
SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)
[ "SELECT", "t1.party_email", "FROM", "parties", "AS", "t1", "JOIN", "party_forms", "AS", "t2", "ON", "t1.party_id", "=", "t2.party_id", "WHERE", "t2.form_id", "=", "(", "SELECT", "form_id", "FROM", "party_forms", "GROUP", "BY", "form_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1", ")" ]
[ "select", "t1", ".", "party_email", "from", "parties", "as", "t1", "join", "party_forms", "as", "t2", "on", "t1", ".", "party_id", "=", "t2", ".", "party_id", "where", "t2", ".", "form_id", "=", "(", "select", "form_id", "from", "party_forms", "group", "by", "form_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value", ")" ]
[ "Find", "the", "emails", "of", "parties", "with", "the", "most", "popular", "party", "form", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the party emails associated with parties that used the party form that is the most common?
SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)
[ "SELECT", "t1.party_email", "FROM", "parties", "AS", "t1", "JOIN", "party_forms", "AS", "t2", "ON", "t1.party_id", "=", "t2.party_id", "WHERE", "t2.form_id", "=", "(", "SELECT", "form_id", "FROM", "party_forms", "GROUP", "BY", "form_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1", ")" ]
[ "select", "t1", ".", "party_email", "from", "parties", "as", "t1", "join", "party_forms", "as", "t2", "on", "t1", ".", "party_id", "=", "t2", ".", "party_id", "where", "t2", ".", "form_id", "=", "(", "select", "form_id", "from", "party_forms", "group", "by", "form_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value", ")" ]
[ "What", "are", "the", "party", "emails", "associated", "with", "parties", "that", "used", "the", "party", "form", "that", "is", "the", "most", "common", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
List all the name of organizations in order of the date formed.
SELECT organization_name FROM organizations ORDER BY date_formed ASC
[ "SELECT", "organization_name", "FROM", "organizations", "ORDER", "BY", "date_formed", "ASC" ]
[ "select", "organization_name", "from", "organizations", "order", "by", "date_formed", "asc" ]
[ "List", "all", "the", "name", "of", "organizations", "in", "order", "of", "the", "date", "formed", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the names of organizations, ordered by the date they were formed, ascending?
SELECT organization_name FROM organizations ORDER BY date_formed ASC
[ "SELECT", "organization_name", "FROM", "organizations", "ORDER", "BY", "date_formed", "ASC" ]
[ "select", "organization_name", "from", "organizations", "order", "by", "date_formed", "asc" ]
[ "What", "are", "the", "names", "of", "organizations", ",", "ordered", "by", "the", "date", "they", "were", "formed", ",", "ascending", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the name of the youngest organization.
SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
[ "SELECT", "organization_name", "FROM", "organizations", "ORDER", "BY", "date_formed", "DESC", "LIMIT", "1" ]
[ "select", "organization_name", "from", "organizations", "order", "by", "date_formed", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "the", "youngest", "organization", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What is the name of the organization that was formed most recently?
SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
[ "SELECT", "organization_name", "FROM", "organizations", "ORDER", "BY", "date_formed", "DESC", "LIMIT", "1" ]
[ "select", "organization_name", "from", "organizations", "order", "by", "date_formed", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "organization", "that", "was", "formed", "most", "recently", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the last name of the latest contact individual of the organization "Labour Party".
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
[ "SELECT", "t3.individual_last_name", "FROM", "organizations", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.organization_id", "=", "t2.organization_id", "JOIN", "individuals", "AS", "t3", "ON", "t2.individual_id", "=", "t3.individual_id", "WHERE", "t1.organization_name", "=", "``", "Labour", "Party", "''", "ORDER", "BY", "t2.date_contact_to", "DESC", "LIMIT", "1" ]
[ "select", "t3", ".", "individual_last_name", "from", "organizations", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "organization_id", "=", "t2", ".", "organization_id", "join", "individuals", "as", "t3", "on", "t2", ".", "individual_id", "=", "t3", ".", "individual_id", "where", "t1", ".", "organization_name", "=", "value", "order", "by", "t2", ".", "date_contact_to", "desc", "limit", "value" ]
[ "Find", "the", "last", "name", "of", "the", "latest", "contact", "individual", "of", "the", "organization", "``", "Labour", "Party", "''", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What is the last name of the contact individual from the Labour party organization who was contacted most recently?
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
[ "SELECT", "t3.individual_last_name", "FROM", "organizations", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.organization_id", "=", "t2.organization_id", "JOIN", "individuals", "AS", "t3", "ON", "t2.individual_id", "=", "t3.individual_id", "WHERE", "t1.organization_name", "=", "``", "Labour", "Party", "''", "ORDER", "BY", "t2.date_contact_to", "DESC", "LIMIT", "1" ]
[ "select", "t3", ".", "individual_last_name", "from", "organizations", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "organization_id", "=", "t2", ".", "organization_id", "join", "individuals", "as", "t3", "on", "t2", ".", "individual_id", "=", "t3", ".", "individual_id", "where", "t1", ".", "organization_name", "=", "value", "order", "by", "t2", ".", "date_contact_to", "desc", "limit", "value" ]
[ "What", "is", "the", "last", "name", "of", "the", "contact", "individual", "from", "the", "Labour", "party", "organization", "who", "was", "contacted", "most", "recently", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the last name of the first ever contact person of the organization with the highest UK Vat number.
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1
[ "SELECT", "t3.individual_last_name", "FROM", "organizations", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.organization_id", "=", "t2.organization_id", "JOIN", "individuals", "AS", "t3", "ON", "t2.individual_id", "=", "t3.individual_id", "WHERE", "t1.uk_vat_number", "=", "(", "SELECT", "max", "(", "uk_vat_number", ")", "FROM", "organizations", ")", "ORDER", "BY", "t2.date_contact_to", "ASC", "LIMIT", "1" ]
[ "select", "t3", ".", "individual_last_name", "from", "organizations", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "organization_id", "=", "t2", ".", "organization_id", "join", "individuals", "as", "t3", "on", "t2", ".", "individual_id", "=", "t3", ".", "individual_id", "where", "t1", ".", "uk_vat_number", "=", "(", "select", "max", "(", "uk_vat_number", ")", "from", "organizations", ")", "order", "by", "t2", ".", "date_contact_to", "asc", "limit", "value" ]
[ "Find", "the", "last", "name", "of", "the", "first", "ever", "contact", "person", "of", "the", "organization", "with", "the", "highest", "UK", "Vat", "number", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations?
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1
[ "SELECT", "t3.individual_last_name", "FROM", "organizations", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.organization_id", "=", "t2.organization_id", "JOIN", "individuals", "AS", "t3", "ON", "t2.individual_id", "=", "t3.individual_id", "WHERE", "t1.uk_vat_number", "=", "(", "SELECT", "max", "(", "uk_vat_number", ")", "FROM", "organizations", ")", "ORDER", "BY", "t2.date_contact_to", "ASC", "LIMIT", "1" ]
[ "select", "t3", ".", "individual_last_name", "from", "organizations", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "organization_id", "=", "t2", ".", "organization_id", "join", "individuals", "as", "t3", "on", "t2", ".", "individual_id", "=", "t3", ".", "individual_id", "where", "t1", ".", "uk_vat_number", "=", "(", "select", "max", "(", "uk_vat_number", ")", "from", "organizations", ")", "order", "by", "t2", ".", "date_contact_to", "asc", "limit", "value" ]
[ "What", "is", "the", "last", "name", "of", "the", "first", "individual", "contacted", "from", "the", "organization", "with", "the", "maximum", "UK", "Vat", "number", "across", "all", "organizations", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
How many services are there?
SELECT count(*) FROM services
[ "SELECT", "count", "(", "*", ")", "FROM", "services" ]
[ "select", "count", "(", "*", ")", "from", "services" ]
[ "How", "many", "services", "are", "there", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Count the number of services.
SELECT count(*) FROM services
[ "SELECT", "count", "(", "*", ")", "FROM", "services" ]
[ "select", "count", "(", "*", ")", "from", "services" ]
[ "Count", "the", "number", "of", "services", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find name of the services that has never been used.
SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id
[ "SELECT", "service_name", "FROM", "services", "EXCEPT", "SELECT", "t1.service_name", "FROM", "services", "AS", "t1", "JOIN", "party_services", "AS", "t2", "ON", "t1.service_id", "=", "t2.service_id" ]
[ "select", "service_name", "from", "services", "except", "select", "t1", ".", "service_name", "from", "services", "as", "t1", "join", "party_services", "as", "t2", "on", "t1", ".", "service_id", "=", "t2", ".", "service_id" ]
[ "Find", "name", "of", "the", "services", "that", "has", "never", "been", "used", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the names of the services that have never been used?
SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id = t2.service_id
[ "SELECT", "service_name", "FROM", "services", "EXCEPT", "SELECT", "t1.service_name", "FROM", "services", "AS", "t1", "JOIN", "party_services", "AS", "t2", "ON", "t1.service_id", "=", "t2.service_id" ]
[ "select", "service_name", "from", "services", "except", "select", "t1", ".", "service_name", "from", "services", "as", "t1", "join", "party_services", "as", "t2", "on", "t1", ".", "service_id", "=", "t2", ".", "service_id" ]
[ "What", "are", "the", "names", "of", "the", "services", "that", "have", "never", "been", "used", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the name of all the cities and states.
SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
[ "SELECT", "town_city", "FROM", "addresses", "UNION", "SELECT", "state_province_county", "FROM", "addresses" ]
[ "select", "town_city", "from", "addresses", "union", "select", "state_province_county", "from", "addresses" ]
[ "Find", "the", "name", "of", "all", "the", "cities", "and", "states", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the names of all cities and states?
SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
[ "SELECT", "town_city", "FROM", "addresses", "UNION", "SELECT", "state_province_county", "FROM", "addresses" ]
[ "select", "town_city", "from", "addresses", "union", "select", "state_province_county", "from", "addresses" ]
[ "What", "are", "the", "names", "of", "all", "cities", "and", "states", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
How many cities are there in state "Colorado"?
SELECT count(*) FROM addresses WHERE state_province_county = "Colorado"
[ "SELECT", "count", "(", "*", ")", "FROM", "addresses", "WHERE", "state_province_county", "=", "``", "Colorado", "''" ]
[ "select", "count", "(", "*", ")", "from", "addresses", "where", "state_province_county", "=", "value" ]
[ "How", "many", "cities", "are", "there", "in", "state", "``", "Colorado", "''", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Count the number of cities in the state of Colorado.
SELECT count(*) FROM addresses WHERE state_province_county = "Colorado"
[ "SELECT", "count", "(", "*", ")", "FROM", "addresses", "WHERE", "state_province_county", "=", "``", "Colorado", "''" ]
[ "select", "count", "(", "*", ")", "from", "addresses", "where", "state_province_county", "=", "value" ]
[ "Count", "the", "number", "of", "cities", "in", "the", "state", "of", "Colorado", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the payment method code used by more than 3 parties.
SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*) > 3
[ "SELECT", "payment_method_code", "FROM", "parties", "GROUP", "BY", "payment_method_code", "HAVING", "count", "(", "*", ")", ">", "3" ]
[ "select", "payment_method_code", "from", "parties", "group", "by", "payment_method_code", "having", "count", "(", "*", ")", ">", "value" ]
[ "Find", "the", "payment", "method", "code", "used", "by", "more", "than", "3", "parties", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the payment method codes that have been used by more than 3 parties?
SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*) > 3
[ "SELECT", "payment_method_code", "FROM", "parties", "GROUP", "BY", "payment_method_code", "HAVING", "count", "(", "*", ")", ">", "3" ]
[ "select", "payment_method_code", "from", "parties", "group", "by", "payment_method_code", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "payment", "method", "codes", "that", "have", "been", "used", "by", "more", "than", "3", "parties", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the name of organizations whose names contain "Party".
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
[ "SELECT", "organization_name", "FROM", "organizations", "WHERE", "organization_name", "LIKE", "``", "%", "Party", "%", "''" ]
[ "select", "organization_name", "from", "organizations", "where", "organization_name", "like", "value" ]
[ "Find", "the", "name", "of", "organizations", "whose", "names", "contain", "``", "Party", "''", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the names of organizations that contain the word "Party"?
SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"
[ "SELECT", "organization_name", "FROM", "organizations", "WHERE", "organization_name", "LIKE", "``", "%", "Party", "%", "''" ]
[ "select", "organization_name", "from", "organizations", "where", "organization_name", "like", "value" ]
[ "What", "are", "the", "names", "of", "organizations", "that", "contain", "the", "word", "``", "Party", "''", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
How many distinct payment methods are used by parties?
SELECT count(DISTINCT payment_method_code) FROM parties
[ "SELECT", "count", "(", "DISTINCT", "payment_method_code", ")", "FROM", "parties" ]
[ "select", "count", "(", "distinct", "payment_method_code", ")", "from", "parties" ]
[ "How", "many", "distinct", "payment", "methods", "are", "used", "by", "parties", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Count the number of different payment method codes used by parties.
SELECT count(DISTINCT payment_method_code) FROM parties
[ "SELECT", "count", "(", "DISTINCT", "payment_method_code", ")", "FROM", "parties" ]
[ "select", "count", "(", "distinct", "payment_method_code", ")", "from", "parties" ]
[ "Count", "the", "number", "of", "different", "payment", "method", "codes", "used", "by", "parties", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Which is the email of the party that has used the services the most number of times?
SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "t1.party_email", "FROM", "parties", "AS", "t1", "JOIN", "party_services", "AS", "t2", "ON", "t1.party_id", "=", "t2.customer_id", "GROUP", "BY", "t1.party_email", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "party_email", "from", "parties", "as", "t1", "join", "party_services", "as", "t2", "on", "t1", ".", "party_id", "=", "t2", ".", "customer_id", "group", "by", "t1", ".", "party_email", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Which", "is", "the", "email", "of", "the", "party", "that", "has", "used", "the", "services", "the", "most", "number", "of", "times", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Return the party email that has used party services the greatest number of times.
SELECT t1.party_email FROM parties AS t1 JOIN party_services AS t2 ON t1.party_id = t2.customer_id GROUP BY t1.party_email ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "t1.party_email", "FROM", "parties", "AS", "t1", "JOIN", "party_services", "AS", "t2", "ON", "t1.party_id", "=", "t2.customer_id", "GROUP", "BY", "t1.party_email", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "party_email", "from", "parties", "as", "t1", "join", "party_services", "as", "t2", "on", "t1", ".", "party_id", "=", "t2", ".", "customer_id", "group", "by", "t1", ".", "party_email", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Return", "the", "party", "email", "that", "has", "used", "party", "services", "the", "greatest", "number", "of", "times", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Which state can address "6862 Kaitlyn Knolls" possibly be in?
SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%"
[ "SELECT", "state_province_county", "FROM", "addresses", "WHERE", "line_1_number_building", "LIKE", "``", "%", "6862", "Kaitlyn", "Knolls", "%", "''" ]
[ "select", "state_province_county", "from", "addresses", "where", "line_1_number_building", "like", "value" ]
[ "Which", "state", "can", "address", "``", "6862", "Kaitlyn", "Knolls", "''", "possibly", "be", "in", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Give the state corresponding to the line number building "6862 Kaitlyn Knolls".
SELECT state_province_county FROM addresses WHERE line_1_number_building LIKE "%6862 Kaitlyn Knolls%"
[ "SELECT", "state_province_county", "FROM", "addresses", "WHERE", "line_1_number_building", "LIKE", "``", "%", "6862", "Kaitlyn", "Knolls", "%", "''" ]
[ "select", "state_province_county", "from", "addresses", "where", "line_1_number_building", "like", "value" ]
[ "Give", "the", "state", "corresponding", "to", "the", "line", "number", "building", "``", "6862", "Kaitlyn", "Knolls", "''", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What is the name of organization that has the greatest number of contact individuals?
SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "t1.organization_name", "FROM", "organizations", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.organization_id", "=", "t2.organization_id", "GROUP", "BY", "t1.organization_name", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "organization_name", "from", "organizations", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "organization_id", "=", "t2", ".", "organization_id", "group", "by", "t1", ".", "organization_name", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "organization", "that", "has", "the", "greatest", "number", "of", "contact", "individuals", "?" ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Return the name of the organization which has the most contact individuals.
SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "t1.organization_name", "FROM", "organizations", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.organization_id", "=", "t2.organization_id", "GROUP", "BY", "t1.organization_name", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "organization_name", "from", "organizations", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "organization_id", "=", "t2", ".", "organization_id", "group", "by", "t1", ".", "organization_name", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Return", "the", "name", "of", "the", "organization", "which", "has", "the", "most", "contact", "individuals", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
Find the last name of the individuals that have been contact individuals of an organization.
SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id
[ "SELECT", "DISTINCT", "t1.individual_last_name", "FROM", "individuals", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.individual_id", "=", "t2.individual_id" ]
[ "select", "distinct", "t1", ".", "individual_last_name", "from", "individuals", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "individual_id", "=", "t2", ".", "individual_id" ]
[ "Find", "the", "last", "name", "of", "the", "individuals", "that", "have", "been", "contact", "individuals", "of", "an", "organization", "." ]
e_government
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`town_city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Services` (\n`service_id` INTEGER PRIMARY KEY,\n`service_type_code` VARCHAR(15) NOT NULL,\n`service_name` VARCHAR(80),\n`service_descriptio` VARCHAR(255)\n);", "CREATE TABLE `Forms` (\n`form_id` INTEGER PRIMARY KEY,\n`form_type_code` VARCHAR(15) NOT NULL,\n`service_id` INTEGER,\n`form_number` VARCHAR(50),\n`form_name` VARCHAR(80),\n`form_description` VARCHAR(255),\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` )\n);", "CREATE TABLE `Individuals` (\n`individual_id` INTEGER PRIMARY KEY,\n`individual_first_name` VARCHAR(80),\n`individual_middle_name` VARCHAR(80),\n`inidividual_phone` VARCHAR(80),\n`individual_email` VARCHAR(80),\n`individual_address` VARCHAR(255),\n`individual_last_name` VARCHAR(80)\n);", "CREATE TABLE `Organizations` (\n`organization_id` INTEGER PRIMARY KEY,\n`date_formed` DATETIME,\n`organization_name` VARCHAR(255),\n`uk_vat_number` VARCHAR(20)\n);", "CREATE TABLE `Parties` (\n`party_id` INTEGER PRIMARY KEY,\n`payment_method_code` VARCHAR(15) NOT NULL,\n`party_phone` VARCHAR(80),\n`party_email` VARCHAR(80)\n);", "CREATE TABLE `Organization_Contact_Individuals` (\n`individual_id` INTEGER NOT NULL,\n`organization_id` INTEGER NOT NULL,\n`date_contact_from` DATETIME NOT NULL,\n`date_contact_to` DATETIME,\nPRIMARY KEY (`individual_id`,`organization_id` ),\nFOREIGN KEY (`organization_id` ) REFERENCES `Organizations`(`organization_id` ),\nFOREIGN KEY (`individual_id` ) REFERENCES `Individuals`(`individual_id` )\n);", "CREATE TABLE `Party_Addresses` (\n`party_id` INTEGER NOT NULL,\n`address_id` INTEGER NOT NULL,\n`date_address_from` DATETIME NOT NULL,\n`address_type_code` VARCHAR(15) NOT NULL,\n`date_address_to` DATETIME,\nPRIMARY KEY (`party_id`, `address_id`),\nFOREIGN KEY (`address_id` ) REFERENCES `Addresses`(`address_id` ),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` )\n);", "CREATE TABLE `Party_Forms` (\n`party_id` INTEGER NOT NULL,\n`form_id` INTEGER NOT NULL,\n`date_completion_started` DATETIME NOT NULL,\n`form_status_code` VARCHAR(15) NOT NULL,\n`date_fully_completed` DATETIME,\nPRIMARY KEY (`party_id`, `form_id`),\nFOREIGN KEY (`party_id` ) REFERENCES `Parties`(`party_id` ),\nFOREIGN KEY (`form_id` ) REFERENCES `Forms`(`form_id` )\n);", "CREATE TABLE `Party_Services` (\n`booking_id` INTEGER NOT NULL ,\n`customer_id` INTEGER NOT NULL,\n`service_id` INTEGER NOT NULL,\n`service_datetime` DATETIME NOT NULL,\n`booking_made_date` DATETIME,\nFOREIGN KEY (`service_id` ) REFERENCES `Services`(`service_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Parties`(`party_id` )\n);" ]
What are the last names of individuals who have been contact individuals for an organization?
SELECT DISTINCT t1.individual_last_name FROM individuals AS t1 JOIN organization_contact_individuals AS t2 ON t1.individual_id = t2.individual_id
[ "SELECT", "DISTINCT", "t1.individual_last_name", "FROM", "individuals", "AS", "t1", "JOIN", "organization_contact_individuals", "AS", "t2", "ON", "t1.individual_id", "=", "t2.individual_id" ]
[ "select", "distinct", "t1", ".", "individual_last_name", "from", "individuals", "as", "t1", "join", "organization_contact_individuals", "as", "t2", "on", "t1", ".", "individual_id", "=", "t2", ".", "individual_id" ]
[ "What", "are", "the", "last", "names", "of", "individuals", "who", "have", "been", "contact", "individuals", "for", "an", "organization", "?" ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
How many drivers are there?
SELECT count(*) FROM driver
[ "SELECT", "count", "(", "*", ")", "FROM", "driver" ]
[ "select", "count", "(", "*", ")", "from", "driver" ]
[ "How", "many", "drivers", "are", "there", "?" ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the name, home city, and age for all drivers.
SELECT name , home_city , age FROM driver
[ "SELECT", "name", ",", "home_city", ",", "age", "FROM", "driver" ]
[ "select", "name", ",", "home_city", ",", "age", "from", "driver" ]
[ "Show", "the", "name", ",", "home", "city", ",", "and", "age", "for", "all", "drivers", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the party and the number of drivers in each party.
SELECT party , count(*) FROM driver GROUP BY party
[ "SELECT", "party", ",", "count", "(", "*", ")", "FROM", "driver", "GROUP", "BY", "party" ]
[ "select", "party", ",", "count", "(", "*", ")", "from", "driver", "group", "by", "party" ]
[ "Show", "the", "party", "and", "the", "number", "of", "drivers", "in", "each", "party", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the name of drivers in descending order of age.
SELECT name FROM driver ORDER BY age DESC
[ "SELECT", "name", "FROM", "driver", "ORDER", "BY", "age", "DESC" ]
[ "select", "name", "from", "driver", "order", "by", "age", "desc" ]
[ "Show", "the", "name", "of", "drivers", "in", "descending", "order", "of", "age", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show all different home cities.
SELECT DISTINCT home_city FROM driver
[ "SELECT", "DISTINCT", "home_city", "FROM", "driver" ]
[ "select", "distinct", "home_city", "from", "driver" ]
[ "Show", "all", "different", "home", "cities", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the home city with the most number of drivers.
SELECT home_city FROM driver GROUP BY home_city ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "home_city", "FROM", "driver", "GROUP", "BY", "home_city", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "home_city", "from", "driver", "group", "by", "home_city", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "home", "city", "with", "the", "most", "number", "of", "drivers", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the party with drivers from Hartford and drivers older than 40.
SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40
[ "SELECT", "party", "FROM", "driver", "WHERE", "home_city", "=", "'Hartford", "'", "AND", "age", ">", "40" ]
[ "select", "party", "from", "driver", "where", "home_city", "=", "value", "and", "age", ">", "value" ]
[ "Show", "the", "party", "with", "drivers", "from", "Hartford", "and", "drivers", "older", "than", "40", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show home city where at least two drivers older than 40 are from.
SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING count(*) >= 2
[ "SELECT", "home_city", "FROM", "driver", "WHERE", "age", ">", "40", "GROUP", "BY", "home_city", "HAVING", "count", "(", "*", ")", ">", "=", "2" ]
[ "select", "home_city", "from", "driver", "where", "age", ">", "value", "group", "by", "home_city", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Show", "home", "city", "where", "at", "least", "two", "drivers", "older", "than", "40", "are", "from", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show all home cities except for those having a driver older than 40.
SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40
[ "SELECT", "home_city", "FROM", "driver", "EXCEPT", "SELECT", "home_city", "FROM", "driver", "WHERE", "age", ">", "40" ]
[ "select", "home_city", "from", "driver", "except", "select", "home_city", "from", "driver", "where", "age", ">", "value" ]
[ "Show", "all", "home", "cities", "except", "for", "those", "having", "a", "driver", "older", "than", "40", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the names of the drivers without a school bus.
SELECT name FROM driver WHERE driver_id NOT IN (SELECT driver_id FROM school_bus)
[ "SELECT", "name", "FROM", "driver", "WHERE", "driver_id", "NOT", "IN", "(", "SELECT", "driver_id", "FROM", "school_bus", ")" ]
[ "select", "name", "from", "driver", "where", "driver_id", "not", "in", "(", "select", "driver_id", "from", "school_bus", ")" ]
[ "Show", "the", "names", "of", "the", "drivers", "without", "a", "school", "bus", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the types of schools that have two schools.
SELECT TYPE FROM school GROUP BY TYPE HAVING count(*) = 2
[ "SELECT", "TYPE", "FROM", "school", "GROUP", "BY", "TYPE", "HAVING", "count", "(", "*", ")", "=", "2" ]
[ "select", "type", "from", "school", "group", "by", "type", "having", "count", "(", "*", ")", "=", "value" ]
[ "Show", "the", "types", "of", "schools", "that", "have", "two", "schools", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the school name and driver name for all school buses.
SELECT T2.school , T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id
[ "SELECT", "T2.school", ",", "T3.name", "FROM", "school_bus", "AS", "T1", "JOIN", "school", "AS", "T2", "ON", "T1.school_id", "=", "T2.school_id", "JOIN", "driver", "AS", "T3", "ON", "T1.driver_id", "=", "T3.driver_id" ]
[ "select", "t2", ".", "school", ",", "t3", ".", "name", "from", "school_bus", "as", "t1", "join", "school", "as", "t2", "on", "t1", ".", "school_id", "=", "t2", ".", "school_id", "join", "driver", "as", "t3", "on", "t1", ".", "driver_id", "=", "t3", ".", "driver_id" ]
[ "Show", "the", "school", "name", "and", "driver", "name", "for", "all", "school", "buses", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
What is the maximum, minimum and average years spent working on a school bus?
SELECT max(years_working) , min(years_working) , avg(years_working) FROM school_bus
[ "SELECT", "max", "(", "years_working", ")", ",", "min", "(", "years_working", ")", ",", "avg", "(", "years_working", ")", "FROM", "school_bus" ]
[ "select", "max", "(", "years_working", ")", ",", "min", "(", "years_working", ")", ",", "avg", "(", "years_working", ")", "from", "school_bus" ]
[ "What", "is", "the", "maximum", ",", "minimum", "and", "average", "years", "spent", "working", "on", "a", "school", "bus", "?" ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the school name and type for schools without a school bus.
SELECT school , TYPE FROM school WHERE school_id NOT IN (SELECT school_id FROM school_bus)
[ "SELECT", "school", ",", "TYPE", "FROM", "school", "WHERE", "school_id", "NOT", "IN", "(", "SELECT", "school_id", "FROM", "school_bus", ")" ]
[ "select", "school", ",", "type", "from", "school", "where", "school_id", "not", "in", "(", "select", "school_id", "from", "school_bus", ")" ]
[ "Show", "the", "school", "name", "and", "type", "for", "schools", "without", "a", "school", "bus", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
Show the type of school and the number of buses for each type.
SELECT T2.type , count(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
[ "SELECT", "T2.type", ",", "count", "(", "*", ")", "FROM", "school_bus", "AS", "T1", "JOIN", "school", "AS", "T2", "ON", "T1.school_id", "=", "T2.school_id", "GROUP", "BY", "T2.type" ]
[ "select", "t2", ".", "type", ",", "count", "(", "*", ")", "from", "school_bus", "as", "t1", "join", "school", "as", "t2", "on", "t1", ".", "school_id", "=", "t2", ".", "school_id", "group", "by", "t2", ".", "type" ]
[ "Show", "the", "type", "of", "school", "and", "the", "number", "of", "buses", "for", "each", "type", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
How many drivers are from Hartford city or younger than 40?
SELECT count(*) FROM driver WHERE home_city = 'Hartford' OR age < 40
[ "SELECT", "count", "(", "*", ")", "FROM", "driver", "WHERE", "home_city", "=", "'Hartford", "'", "OR", "age", "<", "40" ]
[ "select", "count", "(", "*", ")", "from", "driver", "where", "home_city", "=", "value", "or", "age", "<", "value" ]
[ "How", "many", "drivers", "are", "from", "Hartford", "city", "or", "younger", "than", "40", "?" ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
List names for drivers from Hartford city and younger than 40.
SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40
[ "SELECT", "name", "FROM", "driver", "WHERE", "home_city", "=", "'Hartford", "'", "AND", "age", "<", "40" ]
[ "select", "name", "from", "driver", "where", "home_city", "=", "value", "and", "age", "<", "value" ]
[ "List", "names", "for", "drivers", "from", "Hartford", "city", "and", "younger", "than", "40", "." ]
school_bus
[ "CREATE TABLE \"driver\" (\n\"Driver_ID\" int,\n\"Name\" text,\n\"Party\" text,\n\"Home_city\" text,\n\"Age\" int,\nPRIMARY KEY (\"Driver_ID\")\n);", "CREATE TABLE \"school\" (\n\"School_ID\" int,\n\"Grade\" text,\n\"School\" text,\n\"Location\" text,\n\"Type\" text,\nPRIMARY KEY (\"School_ID\")\n);", "CREATE TABLE \"school_bus\" (\n\"School_ID\" int,\n\"Driver_ID\" int,\n\"Years_Working\" int,\n\"If_full_time\" bool,\nPRIMARY KEY (\"School_ID\",\"Driver_ID\"),\nFOREIGN KEY (\"School_ID\") REFERENCES `school`(\"School_ID\"),\nFOREIGN KEY (\"Driver_ID\") REFERENCES `driver`(\"Driver_ID\")\n);" ]
find the name of driver who is driving the school bus with the longest working history.
SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_working DESC LIMIT 1
[ "SELECT", "t1.name", "FROM", "driver", "AS", "t1", "JOIN", "school_bus", "AS", "t2", "ON", "t1.driver_id", "=", "t2.driver_id", "ORDER", "BY", "years_working", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "name", "from", "driver", "as", "t1", "join", "school_bus", "as", "t2", "on", "t1", ".", "driver_id", "=", "t2", ".", "driver_id", "order", "by", "years_working", "desc", "limit", "value" ]
[ "find", "the", "name", "of", "driver", "who", "is", "driving", "the", "school", "bus", "with", "the", "longest", "working", "history", "." ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
How many flights have a velocity larger than 200?
SELECT count(*) FROM flight WHERE velocity > 200
[ "SELECT", "count", "(", "*", ")", "FROM", "flight", "WHERE", "velocity", ">", "200" ]
[ "select", "count", "(", "*", ")", "from", "flight", "where", "velocity", ">", "value" ]
[ "How", "many", "flights", "have", "a", "velocity", "larger", "than", "200", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
List the vehicle flight number, date and pilot of all the flights, ordered by altitude.
SELECT vehicle_flight_number , date , pilot FROM flight ORDER BY altitude ASC
[ "SELECT", "vehicle_flight_number", ",", "date", ",", "pilot", "FROM", "flight", "ORDER", "BY", "altitude", "ASC" ]
[ "select", "vehicle_flight_number", ",", "date", ",", "pilot", "from", "flight", "order", "by", "altitude", "asc" ]
[ "List", "the", "vehicle", "flight", "number", ",", "date", "and", "pilot", "of", "all", "the", "flights", ",", "ordered", "by", "altitude", "." ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
List the id, country, city and name of the airports ordered alphabetically by the name.
SELECT id , country , city , name FROM airport ORDER BY name
[ "SELECT", "id", ",", "country", ",", "city", ",", "name", "FROM", "airport", "ORDER", "BY", "name" ]
[ "select", "id", ",", "country", ",", "city", ",", "name", "from", "airport", "order", "by", "name" ]
[ "List", "the", "id", ",", "country", ",", "city", "and", "name", "of", "the", "airports", "ordered", "alphabetically", "by", "the", "name", "." ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What is maximum group equity shareholding of the companies?
SELECT max(group_equity_shareholding) FROM operate_company
[ "SELECT", "max", "(", "group_equity_shareholding", ")", "FROM", "operate_company" ]
[ "select", "max", "(", "group_equity_shareholding", ")", "from", "operate_company" ]
[ "What", "is", "maximum", "group", "equity", "shareholding", "of", "the", "companies", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What is the velocity of the pilot named 'Thompson'?
SELECT avg(velocity) FROM flight WHERE pilot = 'Thompson'
[ "SELECT", "avg", "(", "velocity", ")", "FROM", "flight", "WHERE", "pilot", "=", "'Thompson", "'" ]
[ "select", "avg", "(", "velocity", ")", "from", "flight", "where", "pilot", "=", "value" ]
[ "What", "is", "the", "velocity", "of", "the", "pilot", "named", "'Thompson", "'", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What are the names and types of the companies that have ever operated a flight?
SELECT T1.name , T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
[ "SELECT", "T1.name", ",", "T1.type", "FROM", "operate_company", "AS", "T1", "JOIN", "flight", "AS", "t2", "ON", "T1.id", "=", "T2.company_id" ]
[ "select", "t1", ".", "name", ",", "t1", ".", "type", "from", "operate_company", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "company_id" ]
[ "What", "are", "the", "names", "and", "types", "of", "the", "companies", "that", "have", "ever", "operated", "a", "flight", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What are the names of the airports which are not in the country 'Iceland'?
SELECT name FROM airport WHERE country != 'Iceland'
[ "SELECT", "name", "FROM", "airport", "WHERE", "country", "!", "=", "'Iceland", "'" ]
[ "select", "name", "from", "airport", "where", "country", "!", "=", "value" ]
[ "What", "are", "the", "names", "of", "the", "airports", "which", "are", "not", "in", "the", "country", "'Iceland", "'", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What are the distinct types of the companies that have operated any flights with velocity less than 200?
SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200
[ "SELECT", "DISTINCT", "T1.type", "FROM", "operate_company", "AS", "T1", "JOIN", "flight", "AS", "t2", "ON", "T1.id", "=", "T2.company_id", "WHERE", "T2.velocity", "<", "200" ]
[ "select", "distinct", "t1", ".", "type", "from", "operate_company", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "company_id", "where", "t2", ".", "velocity", "<", "value" ]
[ "What", "are", "the", "distinct", "types", "of", "the", "companies", "that", "have", "operated", "any", "flights", "with", "velocity", "less", "than", "200", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What are the ids and names of the companies that operated more than one flight?
SELECT T1.id , T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING count(*) > 1
[ "SELECT", "T1.id", ",", "T1.name", "FROM", "operate_company", "AS", "T1", "JOIN", "flight", "AS", "t2", "ON", "T1.id", "=", "T2.company_id", "GROUP", "BY", "T1.id", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "id", ",", "t1", ".", "name", "from", "operate_company", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "company_id", "group", "by", "t1", ".", "id", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "ids", "and", "names", "of", "the", "companies", "that", "operated", "more", "than", "one", "flight", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What is the id, name and IATA code of the airport that had most number of flights?
SELECT T1.id , T1.name , T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.id", ",", "T1.name", ",", "T1.IATA", "FROM", "airport", "AS", "T1", "JOIN", "flight", "AS", "T2", "ON", "T1.id", "=", "T2.airport_id", "GROUP", "BY", "T2.id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "id", ",", "t1", ".", "name", ",", "t1", ".", "iata", "from", "airport", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "airport_id", "group", "by", "t2", ".", "id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "id", ",", "name", "and", "IATA", "code", "of", "the", "airport", "that", "had", "most", "number", "of", "flights", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport'
[ "SELECT", "DISTINCT", "T2.pilot", "FROM", "airport", "AS", "T1", "JOIN", "flight", "AS", "T2", "ON", "T1.id", "=", "T2.airport_id", "WHERE", "T1.country", "=", "'United", "States", "'", "OR", "T1.name", "=", "'Billund", "Airport", "'" ]
[ "select", "distinct", "t2", ".", "pilot", "from", "airport", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "airport_id", "where", "t1", ".", "country", "=", "value", "or", "t1", ".", "name", "=", "value" ]
[ "What", "are", "the", "different", "pilot", "names", "who", "had", "piloted", "a", "flight", "in", "the", "country", "'United", "States", "'", "or", "in", "the", "airport", "named", "'Billund", "Airport", "'", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
What is the most common company type, and how many are there?
SELECT TYPE , count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "TYPE", ",", "count", "(", "*", ")", "FROM", "operate_company", "GROUP", "BY", "TYPE", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "type", ",", "count", "(", "*", ")", "from", "operate_company", "group", "by", "type", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "most", "common", "company", "type", ",", "and", "how", "many", "are", "there", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
How many airports haven't the pilot 'Thompson' driven an aircraft?
SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' );
[ "SELECT", "count", "(", "*", ")", "FROM", "airport", "WHERE", "id", "NOT", "IN", "(", "SELECT", "airport_id", "FROM", "flight", "WHERE", "pilot", "=", "'Thompson", "'", ")", ";" ]
[ "select", "count", "(", "*", ")", "from", "airport", "where", "id", "not", "in", "(", "select", "airport_id", "from", "flight", "where", "pilot", "=", "value", ")" ]
[ "How", "many", "airports", "have", "n't", "the", "pilot", "'Thompson", "'", "driven", "an", "aircraft", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.
SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services'
[ "SELECT", "T2.pilot", "FROM", "operate_company", "AS", "T1", "JOIN", "flight", "AS", "t2", "ON", "T1.id", "=", "T2.company_id", "WHERE", "T1.principal_activities", "=", "'Cargo", "'", "INTERSECT", "SELECT", "T2.pilot", "FROM", "operate_company", "AS", "T1", "JOIN", "flight", "AS", "t2", "ON", "T1.id", "=", "T2.company_id", "WHERE", "T1.principal_activities", "=", "'Catering", "services", "'" ]
[ "select", "t2", ".", "pilot", "from", "operate_company", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "company_id", "where", "t1", ".", "principal_activities", "=", "value", "intersect", "select", "t2", ".", "pilot", "from", "operate_company", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "company_id", "where", "t1", ".", "principal_activities", "=", "value" ]
[ "List", "the", "name", "of", "the", "pilots", "who", "have", "flied", "for", "both", "a", "company", "that", "mainly", "provide", "'Cargo", "'", "services", "and", "a", "company", "that", "runs", "'Catering", "services", "'", "activities", "." ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
Which of the airport names contains the word 'international'?
SELECT name FROM airport WHERE name LIKE '%international%'
[ "SELECT", "name", "FROM", "airport", "WHERE", "name", "LIKE", "'", "%", "international", "%", "'" ]
[ "select", "name", "from", "airport", "where", "name", "like", "value" ]
[ "Which", "of", "the", "airport", "names", "contains", "the", "word", "'international", "'", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
How many companies operates airlines in each airport?
SELECT T3.id , count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id
[ "SELECT", "T3.id", ",", "count", "(", "*", ")", "FROM", "operate_company", "AS", "T1", "JOIN", "flight", "AS", "t2", "ON", "T1.id", "=", "T2.company_id", "JOIN", "airport", "AS", "T3", "ON", "T2.airport_id", "=", "T3.id", "GROUP", "BY", "T3.id" ]
[ "select", "t3", ".", "id", ",", "count", "(", "*", ")", "from", "operate_company", "as", "t1", "join", "flight", "as", "t2", "on", "t1", ".", "id", "=", "t2", ".", "company_id", "join", "airport", "as", "t3", "on", "t2", ".", "airport_id", "=", "t3", ".", "id", "group", "by", "t3", ".", "id" ]
[ "How", "many", "companies", "operates", "airlines", "in", "each", "airport", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
how many airports are there in each country?
SELECT count(*) , country FROM airport GROUP BY country
[ "SELECT", "count", "(", "*", ")", ",", "country", "FROM", "airport", "GROUP", "BY", "country" ]
[ "select", "count", "(", "*", ")", ",", "country", "from", "airport", "group", "by", "country" ]
[ "how", "many", "airports", "are", "there", "in", "each", "country", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
which countries have more than 2 airports?
SELECT country FROM airport GROUP BY country HAVING count(*) > 2
[ "SELECT", "country", "FROM", "airport", "GROUP", "BY", "country", "HAVING", "count", "(", "*", ")", ">", "2" ]
[ "select", "country", "from", "airport", "group", "by", "country", "having", "count", "(", "*", ")", ">", "value" ]
[ "which", "countries", "have", "more", "than", "2", "airports", "?" ]
flight_company
[ "CREATE TABLE \"airport\" (\n\"id\" int,\n\"City\" text,\n\"Country\" text,\n\"IATA\" text,\n\"ICAO\" text,\n\"name\" text,\nprimary key(\"id\")\n);", "CREATE TABLE \"operate_company\" (\n\"id\" int,\n\"name\" text,\n\"Type\" text,\n\"Principal_activities\" text,\n\"Incorporated_in\" text,\n\"Group_Equity_Shareholding\" real,\nprimary key (\"id\")\n);", "CREATE TABLE \"flight\" (\n\"id\" int,\n\"Vehicle_Flight_number\" text,\n\"Date\" text,\n\"Pilot\" text,\n\"Velocity\" real,\n\"Altitude\" real,\n\"airport_id\" int,\n\"company_id\" int,\nprimary key (\"id\"),\nforeign key (\"airport_id\") references `airport`(\"id\"),\nforeign key (\"company_id\") references `operate_company`(\"id\")\n);" ]
which pilot is in charge of the most number of flights?
SELECT pilot FROM flight GROUP BY pilot ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "pilot", "FROM", "flight", "GROUP", "BY", "pilot", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "pilot", "from", "flight", "group", "by", "pilot", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "which", "pilot", "is", "in", "charge", "of", "the", "most", "number", "of", "flights", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
How many accounts do we have?
SELECT count(*) FROM Accounts
[ "SELECT", "count", "(", "*", ")", "FROM", "Accounts" ]
[ "select", "count", "(", "*", ")", "from", "accounts" ]
[ "How", "many", "accounts", "do", "we", "have", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Count the number of accounts.
SELECT count(*) FROM Accounts
[ "SELECT", "count", "(", "*", ")", "FROM", "Accounts" ]
[ "select", "count", "(", "*", ")", "from", "accounts" ]
[ "Count", "the", "number", "of", "accounts", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Show all account ids and account details.
SELECT account_id , account_details FROM Accounts
[ "SELECT", "account_id", ",", "account_details", "FROM", "Accounts" ]
[ "select", "account_id", ",", "account_details", "from", "accounts" ]
[ "Show", "all", "account", "ids", "and", "account", "details", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
What are the ids and details of all accounts?
SELECT account_id , account_details FROM Accounts
[ "SELECT", "account_id", ",", "account_details", "FROM", "Accounts" ]
[ "select", "account_id", ",", "account_details", "from", "accounts" ]
[ "What", "are", "the", "ids", "and", "details", "of", "all", "accounts", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
How many statements do we have?
SELECT count(*) FROM Statements
[ "SELECT", "count", "(", "*", ")", "FROM", "Statements" ]
[ "select", "count", "(", "*", ")", "from", "statements" ]
[ "How", "many", "statements", "do", "we", "have", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Count the number of statements.
SELECT count(*) FROM Statements
[ "SELECT", "count", "(", "*", ")", "FROM", "Statements" ]
[ "select", "count", "(", "*", ")", "from", "statements" ]
[ "Count", "the", "number", "of", "statements", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
List all statement ids and statement details.
SELECT STATEMENT_ID , statement_details FROM Statements
[ "SELECT", "STATEMENT_ID", ",", "statement_details", "FROM", "Statements" ]
[ "select", "statement_id", ",", "statement_details", "from", "statements" ]
[ "List", "all", "statement", "ids", "and", "statement", "details", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
What are the ids and details of all statements?
SELECT STATEMENT_ID , statement_details FROM Statements
[ "SELECT", "STATEMENT_ID", ",", "statement_details", "FROM", "Statements" ]
[ "select", "statement_id", ",", "statement_details", "from", "statements" ]
[ "What", "are", "the", "ids", "and", "details", "of", "all", "statements", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Show statement id, statement detail, account detail for accounts.
SELECT T1.statement_id , T2.statement_details , T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id
[ "SELECT", "T1.statement_id", ",", "T2.statement_details", ",", "T1.account_details", "FROM", "Accounts", "AS", "T1", "JOIN", "Statements", "AS", "T2", "ON", "T1.statement_id", "=", "T2.statement_id" ]
[ "select", "t1", ".", "statement_id", ",", "t2", ".", "statement_details", ",", "t1", ".", "account_details", "from", "accounts", "as", "t1", "join", "statements", "as", "t2", "on", "t1", ".", "statement_id", "=", "t2", ".", "statement_id" ]
[ "Show", "statement", "id", ",", "statement", "detail", ",", "account", "detail", "for", "accounts", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
What are the statement ids, statement details, and account details, for all accounts?
SELECT T1.statement_id , T2.statement_details , T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id
[ "SELECT", "T1.statement_id", ",", "T2.statement_details", ",", "T1.account_details", "FROM", "Accounts", "AS", "T1", "JOIN", "Statements", "AS", "T2", "ON", "T1.statement_id", "=", "T2.statement_id" ]
[ "select", "t1", ".", "statement_id", ",", "t2", ".", "statement_details", ",", "t1", ".", "account_details", "from", "accounts", "as", "t1", "join", "statements", "as", "t2", "on", "t1", ".", "statement_id", "=", "t2", ".", "statement_id" ]
[ "What", "are", "the", "statement", "ids", ",", "statement", "details", ",", "and", "account", "details", ",", "for", "all", "accounts", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Show all statement id and the number of accounts for each statement.
SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID
[ "SELECT", "STATEMENT_ID", ",", "count", "(", "*", ")", "FROM", "Accounts", "GROUP", "BY", "STATEMENT_ID" ]
[ "select", "statement_id", ",", "count", "(", "*", ")", "from", "accounts", "group", "by", "statement_id" ]
[ "Show", "all", "statement", "id", "and", "the", "number", "of", "accounts", "for", "each", "statement", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
What are the different statement ids on accounts, and the number of accounts for each?
SELECT STATEMENT_ID , count(*) FROM Accounts GROUP BY STATEMENT_ID
[ "SELECT", "STATEMENT_ID", ",", "count", "(", "*", ")", "FROM", "Accounts", "GROUP", "BY", "STATEMENT_ID" ]
[ "select", "statement_id", ",", "count", "(", "*", ")", "from", "accounts", "group", "by", "statement_id" ]
[ "What", "are", "the", "different", "statement", "ids", "on", "accounts", ",", "and", "the", "number", "of", "accounts", "for", "each", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Show the statement id and the statement detail for the statement with most number of accounts.
SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.statement_id", ",", "T2.statement_details", "FROM", "Accounts", "AS", "T1", "JOIN", "Statements", "AS", "T2", "ON", "T1.statement_id", "=", "T2.statement_id", "GROUP", "BY", "T1.statement_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "statement_id", ",", "t2", ".", "statement_details", "from", "accounts", "as", "t1", "join", "statements", "as", "t2", "on", "t1", ".", "statement_id", "=", "t2", ".", "statement_id", "group", "by", "t1", ".", "statement_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Show", "the", "statement", "id", "and", "the", "statement", "detail", "for", "the", "statement", "with", "most", "number", "of", "accounts", "." ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
What are the statement id and statement detail for the statement that has the most corresponding accounts?
SELECT T1.statement_id , T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.statement_id", ",", "T2.statement_details", "FROM", "Accounts", "AS", "T1", "JOIN", "Statements", "AS", "T2", "ON", "T1.statement_id", "=", "T2.statement_id", "GROUP", "BY", "T1.statement_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "statement_id", ",", "t2", ".", "statement_details", "from", "accounts", "as", "t1", "join", "statements", "as", "t2", "on", "t1", ".", "statement_id", "=", "t2", ".", "statement_id", "group", "by", "t1", ".", "statement_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "are", "the", "statement", "id", "and", "statement", "detail", "for", "the", "statement", "that", "has", "the", "most", "corresponding", "accounts", "?" ]
cre_Docs_and_Epenses
[ "CREATE TABLE Ref_Document_Types (\nDocument_Type_Code CHAR(15) NOT NULL,\nDocument_Type_Name VARCHAR(255) NOT NULL,\nDocument_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Document_Type_Code)\n);", "CREATE TABLE Ref_Budget_Codes (\nBudget_Type_Code CHAR(15) NOT NULL,\nBudget_Type_Description VARCHAR(255) NOT NULL,\nPRIMARY KEY (Budget_Type_Code)\n);", "CREATE TABLE Projects (\nProject_ID INTEGER NOT NULL,\nProject_Details VARCHAR(255),\nPRIMARY KEY (Project_ID)\n);", "CREATE TABLE Documents (\nDocument_ID INTEGER NOT NULL,\nDocument_Type_Code CHAR(15) NOT NULL,\nProject_ID INTEGER NOT NULL,\nDocument_Date DATETIME,\nDocument_Name VARCHAR(255),\nDocument_Description VARCHAR(255),\nOther_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types (Document_Type_Code),\nFOREIGN KEY (Project_ID) REFERENCES Projects (Project_ID)\n);", "CREATE TABLE Statements (\nStatement_ID INTEGER NOT NULL,\nStatement_Details VARCHAR(255),\nPRIMARY KEY (Statement_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Documents_with_Expenses (\nDocument_ID INTEGER NOT NULL,\nBudget_Type_Code CHAR(15) NOT NULL,\nDocument_Details VARCHAR(255),\nPRIMARY KEY (Document_ID),\nFOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes (Budget_Type_Code),\nFOREIGN KEY (Document_ID) REFERENCES Documents (Document_ID)\n);", "CREATE TABLE Accounts (\nAccount_ID INTEGER NOT NULL,\nStatement_ID INTEGER NOT NULL,\nAccount_Details VARCHAR(255),\nPRIMARY KEY (Account_ID),\nFOREIGN KEY (Statement_ID) REFERENCES Statements (Statement_ID)\n);" ]
Show the number of documents.
SELECT count(*) FROM Documents
[ "SELECT", "count", "(", "*", ")", "FROM", "Documents" ]
[ "select", "count", "(", "*", ")", "from", "documents" ]
[ "Show", "the", "number", "of", "documents", "." ]