db_id
stringclasses
140 values
schema
listlengths
0
26
question
stringlengths
16
224
query
stringlengths
18
577
query_toks
listlengths
4
90
query_toks_no_value
listlengths
4
125
question_toks
listlengths
4
44
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What document type codes do we have?
SELECT document_type_code FROM Ref_Document_Types;
[ "SELECT", "document_type_code", "FROM", "Ref_Document_Types", ";" ]
[ "select", "document_type_code", "from", "ref_document_types" ]
[ "What", "document", "type", "codes", "do", "we", "have", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the description of document type 'Paper'?
SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper";
[ "SELECT", "document_type_description", "FROM", "Ref_Document_Types", "WHERE", "document_type_code", "=", "``", "Paper", "''", ";" ]
[ "select", "document_type_description", "from", "ref_document_types", "where", "document_type_code", "=", "value" ]
[ "What", "is", "the", "description", "of", "document", "type", "'Paper", "'", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What are the shipping agent names?
SELECT shipping_agent_name FROM Ref_Shipping_Agents;
[ "SELECT", "shipping_agent_name", "FROM", "Ref_Shipping_Agents", ";" ]
[ "select", "shipping_agent_name", "from", "ref_shipping_agents" ]
[ "What", "are", "the", "shipping", "agent", "names", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the shipping agent code of shipping agent UPS?
SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS";
[ "SELECT", "shipping_agent_code", "FROM", "Ref_Shipping_Agents", "WHERE", "shipping_agent_name", "=", "``", "UPS", "''", ";" ]
[ "select", "shipping_agent_code", "from", "ref_shipping_agents", "where", "shipping_agent_name", "=", "value" ]
[ "What", "is", "the", "shipping", "agent", "code", "of", "shipping", "agent", "UPS", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What are all role codes?
SELECT role_code FROM ROLES;
[ "SELECT", "role_code", "FROM", "ROLES", ";" ]
[ "select", "role_code", "from", "roles" ]
[ "What", "are", "all", "role", "codes", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the description of role code ED?
SELECT role_description FROM ROLES WHERE role_code = "ED";
[ "SELECT", "role_description", "FROM", "ROLES", "WHERE", "role_code", "=", "``", "ED", "''", ";" ]
[ "select", "role_description", "from", "roles", "where", "role_code", "=", "value" ]
[ "What", "is", "the", "description", "of", "role", "code", "ED", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
How many employees do we have?
SELECT count(*) FROM Employees;
[ "SELECT", "count", "(", "*", ")", "FROM", "Employees", ";" ]
[ "select", "count", "(", "*", ")", "from", "employees" ]
[ "How", "many", "employees", "do", "we", "have", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the role of the employee named Koby?
SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby";
[ "SELECT", "T1.role_description", "FROM", "ROLES", "AS", "T1", "JOIN", "Employees", "AS", "T2", "ON", "T1.role_code", "=", "T2.role_code", "WHERE", "T2.employee_name", "=", "``", "Koby", "''", ";" ]
[ "select", "t1", ".", "role_description", "from", "roles", "as", "t1", "join", "employees", "as", "t2", "on", "t1", ".", "role_code", "=", "t2", ".", "role_code", "where", "t2", ".", "employee_name", "=", "value" ]
[ "What", "is", "the", "role", "of", "the", "employee", "named", "Koby", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List all document ids and receipt dates of documents.
SELECT document_id , receipt_date FROM Documents;
[ "SELECT", "document_id", ",", "receipt_date", "FROM", "Documents", ";" ]
[ "select", "document_id", ",", "receipt_date", "from", "documents" ]
[ "List", "all", "document", "ids", "and", "receipt", "dates", "of", "documents", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
How many employees does each role have? List role description, id and number of employees.
SELECT T1.role_description , T2.role_code , count(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code;
[ "SELECT", "T1.role_description", ",", "T2.role_code", ",", "count", "(", "*", ")", "FROM", "ROLES", "AS", "T1", "JOIN", "Employees", "AS", "T2", "ON", "T1.role_code", "=", "T2.role_code", "GROUP", "BY", "T2.role_code", ";" ]
[ "select", "t1", ".", "role_description", ",", "t2", ".", "role_code", ",", "count", "(", "*", ")", "from", "roles", "as", "t1", "join", "employees", "as", "t2", "on", "t1", ".", "role_code", "=", "t2", ".", "role_code", "group", "by", "t2", ".", "role_code" ]
[ "How", "many", "employees", "does", "each", "role", "have", "?", "List", "role", "description", ",", "id", "and", "number", "of", "employees", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List roles that have more than one employee. List the role description and number of employees.
SELECT Roles.role_description , count(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING count(Employees.employee_id) > 1;
[ "SELECT", "Roles.role_description", ",", "count", "(", "Employees.employee_id", ")", "FROM", "ROLES", "JOIN", "Employees", "ON", "Employees.role_code", "=", "Roles.role_code", "GROUP", "BY", "Employees.role_code", "HAVING", "count", "(", "Employees.employee_id", ")", ">", "1", ";" ]
[ "select", "roles.role_description", ",", "count", "(", "employees.employee_id", ")", "from", "roles", "join", "employees", "on", "employees.role_code", "=", "roles.role_code", "group", "by", "employees.role_code", "having", "count", "(", "employees.employee_id", ")", ">", "value" ]
[ "List", "roles", "that", "have", "more", "than", "one", "employee", ".", "List", "the", "role", "description", "and", "number", "of", "employees", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the document status description of the document with id 1?
SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1;
[ "SELECT", "Ref_Document_Status.document_status_description", "FROM", "Ref_Document_Status", "JOIN", "Documents", "ON", "Documents.document_status_code", "=", "Ref_Document_Status.document_status_code", "WHERE", "Documents.document_id", "=", "1", ";" ]
[ "select", "ref_document_status.document_status_description", "from", "ref_document_status", "join", "documents", "on", "documents.document_status_code", "=", "ref_document_status.document_status_code", "where", "documents.document_id", "=", "value" ]
[ "What", "is", "the", "document", "status", "description", "of", "the", "document", "with", "id", "1", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
How many documents have the status code done?
SELECT count(*) FROM Documents WHERE document_status_code = "done";
[ "SELECT", "count", "(", "*", ")", "FROM", "Documents", "WHERE", "document_status_code", "=", "``", "done", "''", ";" ]
[ "select", "count", "(", "*", ")", "from", "documents", "where", "document_status_code", "=", "value" ]
[ "How", "many", "documents", "have", "the", "status", "code", "done", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List the document type code for the document with the id 2.
SELECT document_type_code FROM Documents WHERE document_id = 2;
[ "SELECT", "document_type_code", "FROM", "Documents", "WHERE", "document_id", "=", "2", ";" ]
[ "select", "document_type_code", "from", "documents", "where", "document_id", "=", "value" ]
[ "List", "the", "document", "type", "code", "for", "the", "document", "with", "the", "id", "2", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List the document ids for any documents with the status code done and the type code paper.
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper";
[ "SELECT", "document_id", "FROM", "Documents", "WHERE", "document_status_code", "=", "``", "done", "''", "AND", "document_type_code", "=", "``", "Paper", "''", ";" ]
[ "select", "document_id", "from", "documents", "where", "document_status_code", "=", "value", "and", "document_type_code", "=", "value" ]
[ "List", "the", "document", "ids", "for", "any", "documents", "with", "the", "status", "code", "done", "and", "the", "type", "code", "paper", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the name of the shipping agent of the document with id 2?
SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2;
[ "SELECT", "Ref_Shipping_Agents.shipping_agent_name", "FROM", "Ref_Shipping_Agents", "JOIN", "Documents", "ON", "Documents.shipping_agent_code", "=", "Ref_Shipping_Agents.shipping_agent_code", "WHERE", "Documents.document_id", "=", "2", ";" ]
[ "select", "ref_shipping_agents.shipping_agent_name", "from", "ref_shipping_agents", "join", "documents", "on", "documents.shipping_agent_code", "=", "ref_shipping_agents.shipping_agent_code", "where", "documents.document_id", "=", "value" ]
[ "What", "is", "the", "name", "of", "the", "shipping", "agent", "of", "the", "document", "with", "id", "2", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
How many documents were shipped by USPS?
SELECT count(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS";
[ "SELECT", "count", "(", "*", ")", "FROM", "Ref_Shipping_Agents", "JOIN", "Documents", "ON", "Documents.shipping_agent_code", "=", "Ref_Shipping_Agents.shipping_agent_code", "WHERE", "Ref_Shipping_Agents.shipping_agent_name", "=", "``", "USPS", "''", ";" ]
[ "select", "count", "(", "*", ")", "from", "ref_shipping_agents", "join", "documents", "on", "documents.shipping_agent_code", "=", "ref_shipping_agents.shipping_agent_code", "where", "ref_shipping_agents.shipping_agent_name", "=", "value" ]
[ "How", "many", "documents", "were", "shipped", "by", "USPS", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.
SELECT Ref_Shipping_Agents.shipping_agent_name , count(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY count(Documents.document_id) DESC LIMIT 1;
[ "SELECT", "Ref_Shipping_Agents.shipping_agent_name", ",", "count", "(", "Documents.document_id", ")", "FROM", "Ref_Shipping_Agents", "JOIN", "Documents", "ON", "Documents.shipping_agent_code", "=", "Ref_Shipping_Agents.shipping_agent_code", "GROUP", "BY", "Ref_Shipping_Agents.shipping_agent_code", "ORDER", "BY", "count", "(", "Documents.document_id", ")", "DESC", "LIMIT", "1", ";" ]
[ "select", "ref_shipping_agents.shipping_agent_name", ",", "count", "(", "documents.document_id", ")", "from", "ref_shipping_agents", "join", "documents", "on", "documents.shipping_agent_code", "=", "ref_shipping_agents.shipping_agent_code", "group", "by", "ref_shipping_agents.shipping_agent_code", "order", "by", "count", "(", "documents.document_id", ")", "desc", "limit", "value" ]
[ "Which", "shipping", "agent", "shipped", "the", "most", "documents", "?", "List", "the", "shipping", "agent", "name", "and", "the", "number", "of", "documents", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the receipt date of the document with id 3?
SELECT receipt_date FROM Documents WHERE document_id = 3;
[ "SELECT", "receipt_date", "FROM", "Documents", "WHERE", "document_id", "=", "3", ";" ]
[ "select", "receipt_date", "from", "documents", "where", "document_id", "=", "value" ]
[ "What", "is", "the", "receipt", "date", "of", "the", "document", "with", "id", "3", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What address was the document with id 4 mailed to?
SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4;
[ "SELECT", "Addresses.address_details", "FROM", "Addresses", "JOIN", "Documents_Mailed", "ON", "Documents_Mailed.mailed_to_address_id", "=", "Addresses.address_id", "WHERE", "document_id", "=", "4", ";" ]
[ "select", "addresses.address_details", "from", "addresses", "join", "documents_mailed", "on", "documents_mailed.mailed_to_address_id", "=", "addresses.address_id", "where", "document_id", "=", "value" ]
[ "What", "address", "was", "the", "document", "with", "id", "4", "mailed", "to", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is the mail date of the document with id 7?
SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7;
[ "SELECT", "mailing_date", "FROM", "Documents_Mailed", "WHERE", "document_id", "=", "7", ";" ]
[ "select", "mailing_date", "from", "documents_mailed", "where", "document_id", "=", "value" ]
[ "What", "is", "the", "mail", "date", "of", "the", "document", "with", "id", "7", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS";
[ "SELECT", "document_id", "FROM", "Documents", "WHERE", "document_status_code", "=", "``", "done", "''", "AND", "document_type_code", "=", "``", "Paper", "''", "EXCEPT", "SELECT", "document_id", "FROM", "Documents", "JOIN", "Ref_Shipping_Agents", "ON", "Documents.shipping_agent_code", "=", "Ref_Shipping_Agents.shipping_agent_code", "WHERE", "Ref_Shipping_Agents.shipping_agent_name", "=", "``", "USPS", "''", ";" ]
[ "select", "document_id", "from", "documents", "where", "document_status_code", "=", "value", "and", "document_type_code", "=", "value", "except", "select", "document_id", "from", "documents", "join", "ref_shipping_agents", "on", "documents.shipping_agent_code", "=", "ref_shipping_agents.shipping_agent_code", "where", "ref_shipping_agents.shipping_agent_name", "=", "value" ]
[ "List", "the", "document", "ids", "of", "documents", "with", "the", "status", "done", "and", "type", "Paper", ",", "which", "not", "shipped", "by", "the", "shipping", "agent", "named", "USPS", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS";
[ "SELECT", "document_id", "FROM", "Documents", "WHERE", "document_status_code", "=", "``", "done", "''", "AND", "document_type_code", "=", "``", "Paper", "''", "INTERSECT", "SELECT", "document_id", "FROM", "Documents", "JOIN", "Ref_Shipping_Agents", "ON", "Documents.shipping_agent_code", "=", "Ref_Shipping_Agents.shipping_agent_code", "WHERE", "Ref_Shipping_Agents.shipping_agent_name", "=", "``", "USPS", "''", ";" ]
[ "select", "document_id", "from", "documents", "where", "document_status_code", "=", "value", "and", "document_type_code", "=", "value", "intersect", "select", "document_id", "from", "documents", "join", "ref_shipping_agents", "on", "documents.shipping_agent_code", "=", "ref_shipping_agents.shipping_agent_code", "where", "ref_shipping_agents.shipping_agent_name", "=", "value" ]
[ "List", "document", "id", "of", "documents", "status", "is", "done", "and", "document", "type", "is", "Paper", "and", "the", "document", "is", "shipped", "by", "shipping", "agent", "named", "USPS", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
What is draft detail of the document with id 7?
SELECT draft_details FROM Document_Drafts WHERE document_id = 7;
[ "SELECT", "draft_details", "FROM", "Document_Drafts", "WHERE", "document_id", "=", "7", ";" ]
[ "select", "draft_details", "from", "document_drafts", "where", "document_id", "=", "value" ]
[ "What", "is", "draft", "detail", "of", "the", "document", "with", "id", "7", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
How many draft copies does the document with id 2 have?
SELECT count(*) FROM Draft_Copies WHERE document_id = 2;
[ "SELECT", "count", "(", "*", ")", "FROM", "Draft_Copies", "WHERE", "document_id", "=", "2", ";" ]
[ "select", "count", "(", "*", ")", "from", "draft_copies", "where", "document_id", "=", "value" ]
[ "How", "many", "draft", "copies", "does", "the", "document", "with", "id", "2", "have", "?" ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
Which document has the most draft copies? List its document id and number of draft copies.
SELECT document_id , count(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY count(copy_number) DESC LIMIT 1;
[ "SELECT", "document_id", ",", "count", "(", "copy_number", ")", "FROM", "Draft_Copies", "GROUP", "BY", "document_id", "ORDER", "BY", "count", "(", "copy_number", ")", "DESC", "LIMIT", "1", ";" ]
[ "select", "document_id", ",", "count", "(", "copy_number", ")", "from", "draft_copies", "group", "by", "document_id", "order", "by", "count", "(", "copy_number", ")", "desc", "limit", "value" ]
[ "Which", "document", "has", "the", "most", "draft", "copies", "?", "List", "its", "document", "id", "and", "number", "of", "draft", "copies", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
Which documents have more than 1 draft copies? List document id and number of draft copies.
SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1;
[ "SELECT", "document_id", ",", "count", "(", "*", ")", "FROM", "Draft_Copies", "GROUP", "BY", "document_id", "HAVING", "count", "(", "*", ")", ">", "1", ";" ]
[ "select", "document_id", ",", "count", "(", "*", ")", "from", "draft_copies", "group", "by", "document_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "Which", "documents", "have", "more", "than", "1", "draft", "copies", "?", "List", "document", "id", "and", "number", "of", "draft", "copies", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List all employees in the circulation history of the document with id 1. List the employee's name.
SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1;
[ "SELECT", "Employees.employee_name", "FROM", "Employees", "JOIN", "Circulation_History", "ON", "Circulation_History.employee_id", "=", "Employees.employee_id", "WHERE", "Circulation_History.document_id", "=", "1", ";" ]
[ "select", "employees.employee_name", "from", "employees", "join", "circulation_history", "on", "circulation_history.employee_id", "=", "employees.employee_id", "where", "circulation_history.document_id", "=", "value" ]
[ "List", "all", "employees", "in", "the", "circulation", "history", "of", "the", "document", "with", "id", "1", ".", "List", "the", "employee", "'s", "name", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
List the employees who have not showed up in any circulation history of documents. List the employee's name.
SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id
[ "SELECT", "employee_name", "FROM", "Employees", "EXCEPT", "SELECT", "Employees.employee_name", "FROM", "Employees", "JOIN", "Circulation_History", "ON", "Circulation_History.employee_id", "=", "Employees.employee_id" ]
[ "select", "employee_name", "from", "employees", "except", "select", "employees.employee_name", "from", "employees", "join", "circulation_history", "on", "circulation_history.employee_id", "=", "employees.employee_id" ]
[ "List", "the", "employees", "who", "have", "not", "showed", "up", "in", "any", "circulation", "history", "of", "documents", ".", "List", "the", "employee", "'s", "name", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.
SELECT Employees.employee_name , count(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id , Circulation_History.draft_number , Circulation_History.copy_number ORDER BY count(*) DESC LIMIT 1;
[ "SELECT", "Employees.employee_name", ",", "count", "(", "*", ")", "FROM", "Employees", "JOIN", "Circulation_History", "ON", "Circulation_History.employee_id", "=", "Employees.employee_id", "GROUP", "BY", "Circulation_History.document_id", ",", "Circulation_History.draft_number", ",", "Circulation_History.copy_number", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1", ";" ]
[ "select", "employees.employee_name", ",", "count", "(", "*", ")", "from", "employees", "join", "circulation_history", "on", "circulation_history.employee_id", "=", "employees.employee_id", "group", "by", "circulation_history.document_id", ",", "circulation_history.draft_number", ",", "circulation_history.copy_number", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Which", "employee", "has", "showed", "up", "in", "most", "circulation", "history", "documents", ".", "List", "the", "employee", "'s", "name", "and", "the", "number", "of", "drafts", "and", "copies", "." ]
cre_Doc_Control_Systems
[ "CREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15) NOT NULL,\ndocument_type_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_type_code)\n);", "CREATE TABLE Roles (\nrole_code CHAR(15) NOT NULL,\nrole_description VARCHAR(255),\nPRIMARY KEY (role_code)\n);", "CREATE TABLE Addresses (\naddress_id INTEGER NOT NULL,\naddress_details VARCHAR(255),\nPRIMARY KEY (address_id)\n);", "CREATE TABLE Ref_Document_Status (\ndocument_status_code CHAR(15) NOT NULL,\ndocument_status_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (document_status_code)\n);", "CREATE TABLE Ref_Shipping_Agents (\nshipping_agent_code CHAR(15) NOT NULL,\nshipping_agent_name VARCHAR(255) NOT NULL,\nshipping_agent_description VARCHAR(255) NOT NULL,\nPRIMARY KEY (shipping_agent_code)\n);", "CREATE TABLE Documents (\ndocument_id INTEGER NOT NULL,\ndocument_status_code CHAR(15) NOT NULL,\ndocument_type_code CHAR(15) NOT NULL,\nshipping_agent_code CHAR(15),\nreceipt_date DATETIME,\nreceipt_number VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (document_id),\nFOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types (document_type_code),\nFOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status (document_status_code),\nFOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents (shipping_agent_code)\n);", "CREATE TABLE Employees (\nemployee_id INTEGER NOT NULL,\nrole_code CHAR(15) NOT NULL,\nemployee_name VARCHAR(255),\nother_details VARCHAR(255),\nPRIMARY KEY (employee_id),\nFOREIGN KEY (role_code) REFERENCES Roles (role_code)\n);", "CREATE TABLE Document_Drafts (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ndraft_details VARCHAR(255),\nPRIMARY KEY (document_id, draft_number),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id)\n);", "CREATE TABLE Draft_Copies (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number),\nFOREIGN KEY (document_id, draft_number) REFERENCES Document_Drafts (document_id,draft_number)\n);", "CREATE TABLE Circulation_History (\ndocument_id INTEGER NOT NULL,\ndraft_number INTEGER NOT NULL,\ncopy_number INTEGER NOT NULL,\nemployee_id INTEGER NOT NULL,\nPRIMARY KEY (document_id, draft_number, copy_number, employee_id),\nFOREIGN KEY (document_id, draft_number, copy_number) REFERENCES Draft_Copies (document_id,draft_number,copy_number),\nFOREIGN KEY (employee_id) REFERENCES Employees (employee_id)\n);", "CREATE TABLE Documents_Mailed (\ndocument_id INTEGER NOT NULL,\nmailed_to_address_id INTEGER NOT NULL,\nmailing_date DATETIME,\nPRIMARY KEY (document_id, mailed_to_address_id),\nFOREIGN KEY (document_id) REFERENCES Documents (document_id),\nFOREIGN KEY (mailed_to_address_id) REFERENCES Addresses (address_id)\n);" ]
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.
SELECT document_id , count(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id;
[ "SELECT", "document_id", ",", "count", "(", "DISTINCT", "employee_id", ")", "FROM", "Circulation_History", "GROUP", "BY", "document_id", ";" ]
[ "select", "document_id", ",", "count", "(", "distinct", "employee_id", ")", "from", "circulation_history", "group", "by", "document_id" ]
[ "For", "each", "document", ",", "list", "the", "number", "of", "employees", "who", "have", "showed", "up", "in", "the", "circulation", "history", "of", "that", "document", ".", "List", "the", "document", "ids", "and", "number", "of", "employees", "." ]
company_1
[]
List all department names ordered by their starting date.
SELECT dname FROM department ORDER BY mgr_start_date
[ "SELECT", "dname", "FROM", "department", "ORDER", "BY", "mgr_start_date" ]
[ "select", "dname", "from", "department", "order", "by", "mgr_start_date" ]
[ "List", "all", "department", "names", "ordered", "by", "their", "starting", "date", "." ]
company_1
[]
find all dependent names who have a spouse relation with some employee.
SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse'
[ "SELECT", "Dependent_name", "FROM", "dependent", "WHERE", "relationship", "=", "'Spouse", "'" ]
[ "select", "dependent_name", "from", "dependent", "where", "relationship", "=", "value" ]
[ "find", "all", "dependent", "names", "who", "have", "a", "spouse", "relation", "with", "some", "employee", "." ]
company_1
[]
how many female dependents are there?
SELECT count(*) FROM dependent WHERE sex = 'F'
[ "SELECT", "count", "(", "*", ")", "FROM", "dependent", "WHERE", "sex", "=", "'F", "'" ]
[ "select", "count", "(", "*", ")", "from", "dependent", "where", "sex", "=", "value" ]
[ "how", "many", "female", "dependents", "are", "there", "?" ]
company_1
[]
Find the names of departments that are located in Houston.
SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston'
[ "SELECT", "t1.dname", "FROM", "department", "AS", "t1", "JOIN", "dept_locations", "AS", "t2", "ON", "t1.dnumber", "=", "t2.dnumber", "WHERE", "t2.dlocation", "=", "'Houston", "'" ]
[ "select", "t1", ".", "dname", "from", "department", "as", "t1", "join", "dept_locations", "as", "t2", "on", "t1", ".", "dnumber", "=", "t2", ".", "dnumber", "where", "t2", ".", "dlocation", "=", "value" ]
[ "Find", "the", "names", "of", "departments", "that", "are", "located", "in", "Houston", "." ]
company_1
[]
Return the first names and last names of employees who earn more than 30000 in salary.
SELECT fname , lname FROM employee WHERE salary > 30000
[ "SELECT", "fname", ",", "lname", "FROM", "employee", "WHERE", "salary", ">", "30000" ]
[ "select", "fname", ",", "lname", "from", "employee", "where", "salary", ">", "value" ]
[ "Return", "the", "first", "names", "and", "last", "names", "of", "employees", "who", "earn", "more", "than", "30000", "in", "salary", "." ]
company_1
[]
Find the number of employees of each gender whose salary is lower than 50000.
SELECT count(*) , sex FROM employee WHERE salary < 50000 GROUP BY sex
[ "SELECT", "count", "(", "*", ")", ",", "sex", "FROM", "employee", "WHERE", "salary", "<", "50000", "GROUP", "BY", "sex" ]
[ "select", "count", "(", "*", ")", ",", "sex", "from", "employee", "where", "salary", "<", "value", "group", "by", "sex" ]
[ "Find", "the", "number", "of", "employees", "of", "each", "gender", "whose", "salary", "is", "lower", "than", "50000", "." ]
company_1
[]
list the first and last names, and the addresses of all employees in the ascending order of their birth date.
SELECT fname , lname , address FROM employee ORDER BY Bdate
[ "SELECT", "fname", ",", "lname", ",", "address", "FROM", "employee", "ORDER", "BY", "Bdate" ]
[ "select", "fname", ",", "lname", ",", "address", "from", "employee", "order", "by", "bdate" ]
[ "list", "the", "first", "and", "last", "names", ",", "and", "the", "addresses", "of", "all", "employees", "in", "the", "ascending", "order", "of", "their", "birth", "date", "." ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
what are the event details of the services that have the type code 'Marriage'?
SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'
[ "SELECT", "T1.event_details", "FROM", "EVENTS", "AS", "T1", "JOIN", "Services", "AS", "T2", "ON", "T1.Service_ID", "=", "T2.Service_ID", "WHERE", "T2.Service_Type_Code", "=", "'Marriage", "'" ]
[ "select", "t1", ".", "event_details", "from", "events", "as", "t1", "join", "services", "as", "t2", "on", "t1", ".", "service_id", "=", "t2", ".", "service_id", "where", "t2", ".", "service_type_code", "=", "value" ]
[ "what", "are", "the", "event", "details", "of", "the", "services", "that", "have", "the", "type", "code", "'Marriage", "'", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
What are the ids and details of events that have more than one participants?
SELECT T1.event_id , T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING count(*) > 1
[ "SELECT", "T1.event_id", ",", "T1.event_details", "FROM", "EVENTS", "AS", "T1", "JOIN", "Participants_in_Events", "AS", "T2", "ON", "T1.Event_ID", "=", "T2.Event_ID", "GROUP", "BY", "T1.Event_ID", "HAVING", "count", "(", "*", ")", ">", "1" ]
[ "select", "t1", ".", "event_id", ",", "t1", ".", "event_details", "from", "events", "as", "t1", "join", "participants_in_events", "as", "t2", "on", "t1", ".", "event_id", "=", "t2", ".", "event_id", "group", "by", "t1", ".", "event_id", "having", "count", "(", "*", ")", ">", "value" ]
[ "What", "are", "the", "ids", "and", "details", "of", "events", "that", "have", "more", "than", "one", "participants", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
How many events have each participants attended? List the participant id, type and the number.
SELECT T1.Participant_ID , T1.Participant_Type_Code , count(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID
[ "SELECT", "T1.Participant_ID", ",", "T1.Participant_Type_Code", ",", "count", "(", "*", ")", "FROM", "Participants", "AS", "T1", "JOIN", "Participants_in_Events", "AS", "T2", "ON", "T1.Participant_ID", "=", "T2.Participant_ID", "GROUP", "BY", "T1.Participant_ID" ]
[ "select", "t1", ".", "participant_id", ",", "t1", ".", "participant_type_code", ",", "count", "(", "*", ")", "from", "participants", "as", "t1", "join", "participants_in_events", "as", "t2", "on", "t1", ".", "participant_id", "=", "t2", ".", "participant_id", "group", "by", "t1", ".", "participant_id" ]
[ "How", "many", "events", "have", "each", "participants", "attended", "?", "List", "the", "participant", "id", ",", "type", "and", "the", "number", "." ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
What are all the the participant ids, type code and details?
SELECT Participant_ID , Participant_Type_Code , Participant_Details FROM Participants
[ "SELECT", "Participant_ID", ",", "Participant_Type_Code", ",", "Participant_Details", "FROM", "Participants" ]
[ "select", "participant_id", ",", "participant_type_code", ",", "participant_details", "from", "participants" ]
[ "What", "are", "all", "the", "the", "participant", "ids", ",", "type", "code", "and", "details", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
How many participants belong to the type 'Organizer'?
SELECT count(*) FROM participants WHERE participant_type_code = 'Organizer'
[ "SELECT", "count", "(", "*", ")", "FROM", "participants", "WHERE", "participant_type_code", "=", "'Organizer", "'" ]
[ "select", "count", "(", "*", ")", "from", "participants", "where", "participant_type_code", "=", "value" ]
[ "How", "many", "participants", "belong", "to", "the", "type", "'Organizer", "'", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
List the type of the services in alphabetical order.
SELECT service_type_code FROM services ORDER BY service_type_code
[ "SELECT", "service_type_code", "FROM", "services", "ORDER", "BY", "service_type_code" ]
[ "select", "service_type_code", "from", "services", "order", "by", "service_type_code" ]
[ "List", "the", "type", "of", "the", "services", "in", "alphabetical", "order", "." ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
List the service id and details for the events.
SELECT service_id , event_details FROM EVENTS
[ "SELECT", "service_id", ",", "event_details", "FROM", "EVENTS" ]
[ "select", "service_id", ",", "event_details", "from", "events" ]
[ "List", "the", "service", "id", "and", "details", "for", "the", "events", "." ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
How many events had participants whose details had the substring 'Dr.'
SELECT count(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'
[ "SELECT", "count", "(", "*", ")", "FROM", "participants", "AS", "T1", "JOIN", "Participants_in_Events", "AS", "T2", "ON", "T1.Participant_ID", "=", "T2.Participant_ID", "WHERE", "T1.participant_details", "LIKE", "'", "%", "Dr.", "%", "'" ]
[ "select", "count", "(", "*", ")", "from", "participants", "as", "t1", "join", "participants_in_events", "as", "t2", "on", "t1", ".", "participant_id", "=", "t2", ".", "participant_id", "where", "t1", ".", "participant_details", "like", "value" ]
[ "How", "many", "events", "had", "participants", "whose", "details", "had", "the", "substring", "'Dr", ".", "'" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
What is the most common participant type?
SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "participant_type_code", "FROM", "participants", "GROUP", "BY", "participant_type_code", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "participant_type_code", "from", "participants", "group", "by", "participant_type_code", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "most", "common", "participant", "type", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
Which service id and type has the least number of participants?
SELECT T3.service_id , T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY count(*) ASC LIMIT 1
[ "SELECT", "T3.service_id", ",", "T4.Service_Type_Code", "FROM", "participants", "AS", "T1", "JOIN", "Participants_in_Events", "AS", "T2", "ON", "T1.Participant_ID", "=", "T2.Participant_ID", "JOIN", "EVENTS", "AS", "T3", "ON", "T2.Event_ID", "=", "T3.Event_ID", "JOIN", "services", "AS", "T4", "ON", "T3.service_id", "=", "T4.service_id", "GROUP", "BY", "T3.service_id", "ORDER", "BY", "count", "(", "*", ")", "ASC", "LIMIT", "1" ]
[ "select", "t3", ".", "service_id", ",", "t4", ".", "service_type_code", "from", "participants", "as", "t1", "join", "participants_in_events", "as", "t2", "on", "t1", ".", "participant_id", "=", "t2", ".", "participant_id", "join", "events", "as", "t3", "on", "t2", ".", "event_id", "=", "t3", ".", "event_id", "join", "services", "as", "t4", "on", "t3", ".", "service_id", "=", "t4", ".", "service_id", "group", "by", "t3", ".", "service_id", "order", "by", "count", "(", "*", ")", "asc", "limit", "value" ]
[ "Which", "service", "id", "and", "type", "has", "the", "least", "number", "of", "participants", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
What is the id of the event with the most participants?
SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "Event_ID", "FROM", "Participants_in_Events", "GROUP", "BY", "Event_ID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "event_id", "from", "participants_in_events", "group", "by", "event_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "id", "of", "the", "event", "with", "the", "most", "participants", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
Which events id does not have any participant with detail 'Kenyatta Kuhn'?
SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'
[ "SELECT", "event_id", "FROM", "EVENTS", "EXCEPT", "SELECT", "T1.event_id", "FROM", "Participants_in_Events", "AS", "T1", "JOIN", "Participants", "AS", "T2", "ON", "T1.Participant_ID", "=", "T2.Participant_ID", "WHERE", "Participant_Details", "=", "'Kenyatta", "Kuhn", "'" ]
[ "select", "event_id", "from", "events", "except", "select", "t1", ".", "event_id", "from", "participants_in_events", "as", "t1", "join", "participants", "as", "t2", "on", "t1", ".", "participant_id", "=", "t2", ".", "participant_id", "where", "participant_details", "=", "value" ]
[ "Which", "events", "id", "does", "not", "have", "any", "participant", "with", "detail", "'Kenyatta", "Kuhn", "'", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
Which services type had both successful and failure event details?
SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
[ "SELECT", "T1.service_type_code", "FROM", "services", "AS", "T1", "JOIN", "EVENTS", "AS", "T2", "ON", "T1.service_id", "=", "T2.service_id", "WHERE", "T2.event_details", "=", "'Success", "'", "INTERSECT", "SELECT", "T1.service_type_code", "FROM", "services", "AS", "T1", "JOIN", "EVENTS", "AS", "T2", "ON", "T1.service_id", "=", "T2.service_id", "WHERE", "T2.event_details", "=", "'Fail", "'" ]
[ "select", "t1", ".", "service_type_code", "from", "services", "as", "t1", "join", "events", "as", "t2", "on", "t1", ".", "service_id", "=", "t2", ".", "service_id", "where", "t2", ".", "event_details", "=", "value", "intersect", "select", "t1", ".", "service_type_code", "from", "services", "as", "t1", "join", "events", "as", "t2", "on", "t1", ".", "service_id", "=", "t2", ".", "service_id", "where", "t2", ".", "event_details", "=", "value" ]
[ "Which", "services", "type", "had", "both", "successful", "and", "failure", "event", "details", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
How many events did not have any participants?
SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events)
[ "SELECT", "count", "(", "*", ")", "FROM", "EVENTS", "WHERE", "event_id", "NOT", "IN", "(", "SELECT", "event_id", "FROM", "Participants_in_Events", ")" ]
[ "select", "count", "(", "*", ")", "from", "events", "where", "event_id", "not", "in", "(", "select", "event_id", "from", "participants_in_events", ")" ]
[ "How", "many", "events", "did", "not", "have", "any", "participants", "?" ]
local_govt_in_alabama
[ "CREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nService_Type_Code CHAR(15) NOT NULL,\nPRIMARY KEY (Service_ID)\n);", "CREATE TABLE Participants (\nParticipant_ID INTEGER NOT NULL,\nParticipant_Type_Code CHAR(15) NOT NULL,\nParticipant_Details VARCHAR(255),\nPRIMARY KEY (Participant_ID)\n);", "CREATE TABLE Events (\nEvent_ID INTEGER NOT NULL,\nService_ID INTEGER NOT NULL,\nEvent_Details VARCHAR(255),\nPRIMARY KEY (Event_ID),\nFOREIGN KEY (Service_ID) REFERENCES Services (Service_ID)\n);", "CREATE TABLE Participants_in_Events (\nEvent_ID INTEGER NOT NULL,\nParticipant_ID INTEGER NOT NULL,\nPRIMARY KEY (Event_ID, Participant_ID),\nFOREIGN KEY (Participant_ID) REFERENCES Participants (Participant_ID),\nFOREIGN KEY (Event_ID) REFERENCES Events (Event_ID)\n);" ]
What are all the distinct participant ids who attended any events?
SELECT count(DISTINCT participant_id) FROM participants_in_Events
[ "SELECT", "count", "(", "DISTINCT", "participant_id", ")", "FROM", "participants_in_Events" ]
[ "select", "count", "(", "distinct", "participant_id", ")", "from", "participants_in_events" ]
[ "What", "are", "all", "the", "distinct", "participant", "ids", "who", "attended", "any", "events", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the name of the race held most recently?
SELECT name FROM races ORDER BY date DESC LIMIT 1
[ "SELECT", "name", "FROM", "races", "ORDER", "BY", "date", "DESC", "LIMIT", "1" ]
[ "select", "name", "from", "races", "order", "by", "date", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "race", "held", "most", "recently", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the name of the race that occurred most recently?
SELECT name FROM races ORDER BY date DESC LIMIT 1
[ "SELECT", "name", "FROM", "races", "ORDER", "BY", "date", "DESC", "LIMIT", "1" ]
[ "select", "name", "from", "races", "order", "by", "date", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "race", "that", "occurred", "most", "recently", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the name and date of the most recent race?
SELECT name , date FROM races ORDER BY date DESC LIMIT 1
[ "SELECT", "name", ",", "date", "FROM", "races", "ORDER", "BY", "date", "DESC", "LIMIT", "1" ]
[ "select", "name", ",", "date", "from", "races", "order", "by", "date", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "and", "date", "of", "the", "most", "recent", "race", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the name and date of the race that occurred most recently?
SELECT name , date FROM races ORDER BY date DESC LIMIT 1
[ "SELECT", "name", ",", "date", "FROM", "races", "ORDER", "BY", "date", "DESC", "LIMIT", "1" ]
[ "select", "name", ",", "date", "from", "races", "order", "by", "date", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "and", "date", "of", "the", "race", "that", "occurred", "most", "recently", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find the names of all races held in 2017.
SELECT name FROM races WHERE YEAR = 2017
[ "SELECT", "name", "FROM", "races", "WHERE", "YEAR", "=", "2017" ]
[ "select", "name", "from", "races", "where", "year", "=", "value" ]
[ "Find", "the", "names", "of", "all", "races", "held", "in", "2017", "." ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the names of all the races that occurred in the year 2017?
SELECT name FROM races WHERE YEAR = 2017
[ "SELECT", "name", "FROM", "races", "WHERE", "YEAR", "=", "2017" ]
[ "select", "name", "from", "races", "where", "year", "=", "value" ]
[ "What", "are", "the", "names", "of", "all", "the", "races", "that", "occurred", "in", "the", "year", "2017", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find the distinct names of all races held between 2014 and 2017?
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
[ "SELECT", "DISTINCT", "name", "FROM", "races", "WHERE", "YEAR", "BETWEEN", "2014", "AND", "2017" ]
[ "select", "distinct", "name", "from", "races", "where", "year", "between", "value", "and", "value" ]
[ "Find", "the", "distinct", "names", "of", "all", "races", "held", "between", "2014", "and", "2017", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the unique names of all race held between 2014 and 2017?
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
[ "SELECT", "DISTINCT", "name", "FROM", "races", "WHERE", "YEAR", "BETWEEN", "2014", "AND", "2017" ]
[ "select", "distinct", "name", "from", "races", "where", "year", "between", "value", "and", "value" ]
[ "What", "are", "the", "unique", "names", "of", "all", "race", "held", "between", "2014", "and", "2017", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
[ "SELECT", "DISTINCT", "T1.forename", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.milliseconds", "<", "93000" ]
[ "select", "distinct", "t1", ".", "forename", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "milliseconds", "<", "value" ]
[ "List", "the", "forename", "and", "surname", "of", "all", "distinct", "drivers", "who", "once", "had", "laptime", "less", "than", "93000", "milliseconds", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?
SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
[ "SELECT", "DISTINCT", "T1.forename", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.milliseconds", "<", "93000" ]
[ "select", "distinct", "t1", ".", "forename", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "milliseconds", "<", "value" ]
[ "What", "are", "the", "forenames", "and", "surnames", "of", "all", "unique", "drivers", "who", "had", "a", "lap", "time", "of", "less", "than", "93000", "milliseconds", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000
[ "SELECT", "DISTINCT", "T1.driverid", ",", "T1.nationality", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.milliseconds", ">", "100000" ]
[ "select", "distinct", "t1", ".", "driverid", ",", "t1", ".", "nationality", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "milliseconds", ">", "value" ]
[ "Find", "all", "the", "distinct", "id", "and", "nationality", "of", "drivers", "who", "have", "had", "laptime", "more", "than", "100000", "milliseconds", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the different driver ids and nationalities of all drivers who had a laptime of more than 100000 milliseconds?
SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000
[ "SELECT", "DISTINCT", "T1.driverid", ",", "T1.nationality", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.milliseconds", ">", "100000" ]
[ "select", "distinct", "t1", ".", "driverid", ",", "t1", ".", "nationality", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "milliseconds", ">", "value" ]
[ "What", "are", "the", "different", "driver", "ids", "and", "nationalities", "of", "all", "drivers", "who", "had", "a", "laptime", "of", "more", "than", "100000", "milliseconds", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the forename and surname of the driver who has the smallest laptime?
SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
[ "SELECT", "T1.forename", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "ORDER", "BY", "T2.milliseconds", "LIMIT", "1" ]
[ "select", "t1", ".", "forename", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "order", "by", "t2", ".", "milliseconds", "limit", "value" ]
[ "What", "are", "the", "forename", "and", "surname", "of", "the", "driver", "who", "has", "the", "smallest", "laptime", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the forename and surname of the driver with the shortest laptime?
SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
[ "SELECT", "T1.forename", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "ORDER", "BY", "T2.milliseconds", "LIMIT", "1" ]
[ "select", "t1", ".", "forename", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "order", "by", "t2", ".", "milliseconds", "limit", "value" ]
[ "What", "is", "the", "forename", "and", "surname", "of", "the", "driver", "with", "the", "shortest", "laptime", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the id and family name of the driver who has the longest laptime?
SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
[ "SELECT", "T1.driverid", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "ORDER", "BY", "T2.milliseconds", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "driverid", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "order", "by", "t2", ".", "milliseconds", "desc", "limit", "value" ]
[ "What", "is", "the", "id", "and", "family", "name", "of", "the", "driver", "who", "has", "the", "longest", "laptime", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the id and last name of the driver with the longest laptime?
SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
[ "SELECT", "T1.driverid", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "ORDER", "BY", "T2.milliseconds", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "driverid", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "order", "by", "t2", ".", "milliseconds", "desc", "limit", "value" ]
[ "What", "is", "the", "id", "and", "last", "name", "of", "the", "driver", "with", "the", "longest", "laptime", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
SELECT T1.driverid , T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2
[ "SELECT", "T1.driverid", ",", "T1.forename", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "POSITION", "=", "'1", "'", "GROUP", "BY", "T1.driverid", "HAVING", "count", "(", "*", ")", ">", "=", "2" ]
[ "select", "t1", ".", "driverid", ",", "t1", ".", "forename", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "position", "=", "value", "group", "by", "t1", ".", "driverid", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "What", "is", "the", "id", ",", "forname", "and", "surname", "of", "the", "driver", "who", "had", "the", "first", "position", "in", "terms", "of", "laptime", "at", "least", "twice", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the id, first name, and last name of the driver who was in the first position for laptime at least twice?
SELECT T1.driverid , T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2
[ "SELECT", "T1.driverid", ",", "T1.forename", ",", "T1.surname", "FROM", "drivers", "AS", "T1", "JOIN", "laptimes", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "POSITION", "=", "'1", "'", "GROUP", "BY", "T1.driverid", "HAVING", "count", "(", "*", ")", ">", "=", "2" ]
[ "select", "t1", ".", "driverid", ",", "t1", ".", "forename", ",", "t1", ".", "surname", "from", "drivers", "as", "t1", "join", "laptimes", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "position", "=", "value", "group", "by", "t1", ".", "driverid", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "What", "is", "the", "id", ",", "first", "name", ",", "and", "last", "name", "of", "the", "driver", "who", "was", "in", "the", "first", "position", "for", "laptime", "at", "least", "twice", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
How many drivers participated in the race Australian Grand Prix held in 2009?
SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
[ "SELECT", "count", "(", "*", ")", "FROM", "results", "AS", "T1", "JOIN", "races", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "WHERE", "T2.name", "=", "``", "Australian", "Grand", "Prix", "''", "AND", "YEAR", "=", "2009" ]
[ "select", "count", "(", "*", ")", "from", "results", "as", "t1", "join", "races", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "where", "t2", ".", "name", "=", "value", "and", "year", "=", "value" ]
[ "How", "many", "drivers", "participated", "in", "the", "race", "Australian", "Grand", "Prix", "held", "in", "2009", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
How many drivers were in the Australian Grand Prix held in 2009?
SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
[ "SELECT", "count", "(", "*", ")", "FROM", "results", "AS", "T1", "JOIN", "races", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "WHERE", "T2.name", "=", "``", "Australian", "Grand", "Prix", "''", "AND", "YEAR", "=", "2009" ]
[ "select", "count", "(", "*", ")", "from", "results", "as", "t1", "join", "races", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "where", "t2", ".", "name", "=", "value", "and", "year", "=", "value" ]
[ "How", "many", "drivers", "were", "in", "the", "Australian", "Grand", "Prix", "held", "in", "2009", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
How many drivers did not participate in the races held in 2009?
SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )
[ "SELECT", "count", "(", "DISTINCT", "driverId", ")", "FROM", "results", "WHERE", "raceId", "NOT", "IN", "(", "SELECT", "raceId", "FROM", "races", "WHERE", "YEAR", "!", "=", "2009", ")" ]
[ "select", "count", "(", "distinct", "driverid", ")", "from", "results", "where", "raceid", "not", "in", "(", "select", "raceid", "from", "races", "where", "year", "!", "=", "value", ")" ]
[ "How", "many", "drivers", "did", "not", "participate", "in", "the", "races", "held", "in", "2009", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
How many drivers did not race in 2009?
SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )
[ "SELECT", "count", "(", "DISTINCT", "driverId", ")", "FROM", "results", "WHERE", "raceId", "NOT", "IN", "(", "SELECT", "raceId", "FROM", "races", "WHERE", "YEAR", "!", "=", "2009", ")" ]
[ "select", "count", "(", "distinct", "driverid", ")", "from", "results", "where", "raceid", "not", "in", "(", "select", "raceid", "from", "races", "where", "year", "!", "=", "value", ")" ]
[ "How", "many", "drivers", "did", "not", "race", "in", "2009", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Give me a list of names and years of races that had any driver whose forename is Lewis?
SELECT T2.name , T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
[ "SELECT", "T2.name", ",", "T2.year", "FROM", "results", "AS", "T1", "JOIN", "races", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T1.driverid", "=", "T3.driverid", "WHERE", "T3.forename", "=", "``", "Lewis", "''" ]
[ "select", "t2", ".", "name", ",", "t2", ".", "year", "from", "results", "as", "t1", "join", "races", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t1", ".", "driverid", "=", "t3", ".", "driverid", "where", "t3", ".", "forename", "=", "value" ]
[ "Give", "me", "a", "list", "of", "names", "and", "years", "of", "races", "that", "had", "any", "driver", "whose", "forename", "is", "Lewis", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the names and years of all races that had a driver with the last name Lewis?
SELECT T2.name , T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
[ "SELECT", "T2.name", ",", "T2.year", "FROM", "results", "AS", "T1", "JOIN", "races", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T1.driverid", "=", "T3.driverid", "WHERE", "T3.forename", "=", "``", "Lewis", "''" ]
[ "select", "t2", ".", "name", ",", "t2", ".", "year", "from", "results", "as", "t1", "join", "races", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t1", ".", "driverid", "=", "t3", ".", "driverid", "where", "t3", ".", "forename", "=", "value" ]
[ "What", "are", "the", "names", "and", "years", "of", "all", "races", "that", "had", "a", "driver", "with", "the", "last", "name", "Lewis", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find the forename and surname of drivers whose nationality is German?
SELECT forename , surname FROM drivers WHERE nationality = "German"
[ "SELECT", "forename", ",", "surname", "FROM", "drivers", "WHERE", "nationality", "=", "``", "German", "''" ]
[ "select", "forename", ",", "surname", "from", "drivers", "where", "nationality", "=", "value" ]
[ "Find", "the", "forename", "and", "surname", "of", "drivers", "whose", "nationality", "is", "German", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the first and last name of all the German drivers?
SELECT forename , surname FROM drivers WHERE nationality = "German"
[ "SELECT", "forename", ",", "surname", "FROM", "drivers", "WHERE", "nationality", "=", "``", "German", "''" ]
[ "select", "forename", ",", "surname", "from", "drivers", "where", "nationality", "=", "value" ]
[ "What", "is", "the", "first", "and", "last", "name", "of", "all", "the", "German", "drivers", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
[ "SELECT", "T2.driverid", ",", "T3.forename", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Australian", "Grand", "Prix", "''", "INTERSECT", "SELECT", "T2.driverid", ",", "T3.forename", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Chinese", "Grand", "Prix", "''" ]
[ "select", "t2", ".", "driverid", ",", "t3", ".", "forename", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value", "intersect", "select", "t2", ".", "driverid", ",", "t3", ".", "forename", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value" ]
[ "Find", "the", "id", "and", "forenames", "of", "drivers", "who", "participated", "both", "the", "races", "with", "name", "Australian", "Grand", "Prix", "and", "the", "races", "with", "name", "Chinese", "Grand", "Prix", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the id and first name of all the drivers who participated in the Australian Grand Prix and the Chinese Grand Prix?
SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid , T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
[ "SELECT", "T2.driverid", ",", "T3.forename", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Australian", "Grand", "Prix", "''", "INTERSECT", "SELECT", "T2.driverid", ",", "T3.forename", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Chinese", "Grand", "Prix", "''" ]
[ "select", "t2", ".", "driverid", ",", "t3", ".", "forename", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value", "intersect", "select", "t2", ".", "driverid", ",", "t3", ".", "forename", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value" ]
[ "What", "is", "the", "id", "and", "first", "name", "of", "all", "the", "drivers", "who", "participated", "in", "the", "Australian", "Grand", "Prix", "and", "the", "Chinese", "Grand", "Prix", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
[ "SELECT", "T3.forename", ",", "T3.surname", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Australian", "Grand", "Prix", "''", "EXCEPT", "SELECT", "T3.forename", ",", "T3.surname", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Chinese", "Grand", "Prix", "''" ]
[ "select", "t3", ".", "forename", ",", "t3", ".", "surname", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value", "except", "select", "t3", ".", "forename", ",", "t3", ".", "surname", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value" ]
[ "What", "are", "the", "forenames", "and", "surnames", "of", "drivers", "who", "participated", "in", "the", "races", "named", "Australian", "Grand", "Prix", "but", "not", "the", "races", "named", "Chinese", "Grand", "Prix", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?
SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename , T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
[ "SELECT", "T3.forename", ",", "T3.surname", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Australian", "Grand", "Prix", "''", "EXCEPT", "SELECT", "T3.forename", ",", "T3.surname", "FROM", "races", "AS", "T1", "JOIN", "results", "AS", "T2", "ON", "T1.raceid", "=", "T2.raceid", "JOIN", "drivers", "AS", "T3", "ON", "T2.driverid", "=", "T3.driverid", "WHERE", "T1.name", "=", "``", "Chinese", "Grand", "Prix", "''" ]
[ "select", "t3", ".", "forename", ",", "t3", ".", "surname", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value", "except", "select", "t3", ".", "forename", ",", "t3", ".", "surname", "from", "races", "as", "t1", "join", "results", "as", "t2", "on", "t1", ".", "raceid", "=", "t2", ".", "raceid", "join", "drivers", "as", "t3", "on", "t2", ".", "driverid", "=", "t3", ".", "driverid", "where", "t1", ".", "name", "=", "value" ]
[ "What", "are", "the", "first", "and", "last", "names", "of", "all", "drivers", "who", "participated", "in", "the", "Australian", "Grand", "Prix", "but", "not", "the", "Chinese", "Grand", "Prix", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find all the forenames of distinct drivers who was in position 1 as standing and won?
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
[ "SELECT", "DISTINCT", "T1.forename", "FROM", "drivers", "AS", "T1", "JOIN", "driverstandings", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.position", "=", "1", "AND", "T2.wins", "=", "1" ]
[ "select", "distinct", "t1", ".", "forename", "from", "drivers", "as", "t1", "join", "driverstandings", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "position", "=", "value", "and", "t2", ".", "wins", "=", "value" ]
[ "Find", "all", "the", "forenames", "of", "distinct", "drivers", "who", "was", "in", "position", "1", "as", "standing", "and", "won", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are all the different first names of the drivers who are in position as standing and won?
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
[ "SELECT", "DISTINCT", "T1.forename", "FROM", "drivers", "AS", "T1", "JOIN", "driverstandings", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.position", "=", "1", "AND", "T2.wins", "=", "1" ]
[ "select", "distinct", "t1", ".", "forename", "from", "drivers", "as", "t1", "join", "driverstandings", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "position", "=", "value", "and", "t2", ".", "wins", "=", "value" ]
[ "What", "are", "all", "the", "different", "first", "names", "of", "the", "drivers", "who", "are", "in", "position", "as", "standing", "and", "won", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
[ "SELECT", "DISTINCT", "T1.forename", "FROM", "drivers", "AS", "T1", "JOIN", "driverstandings", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.position", "=", "1", "AND", "T2.wins", "=", "1", "AND", "T2.points", ">", "20" ]
[ "select", "distinct", "t1", ".", "forename", "from", "drivers", "as", "t1", "join", "driverstandings", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "position", "=", "value", "and", "t2", ".", "wins", "=", "value", "and", "t2", ".", "points", ">", "value" ]
[ "Find", "all", "the", "forenames", "of", "distinct", "drivers", "who", "won", "in", "position", "1", "as", "driver", "standing", "and", "had", "more", "than", "20", "points", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
[ "SELECT", "DISTINCT", "T1.forename", "FROM", "drivers", "AS", "T1", "JOIN", "driverstandings", "AS", "T2", "ON", "T1.driverid", "=", "T2.driverid", "WHERE", "T2.position", "=", "1", "AND", "T2.wins", "=", "1", "AND", "T2.points", ">", "20" ]
[ "select", "distinct", "t1", ".", "forename", "from", "drivers", "as", "t1", "join", "driverstandings", "as", "t2", "on", "t1", ".", "driverid", "=", "t2", ".", "driverid", "where", "t2", ".", "position", "=", "value", "and", "t2", ".", "wins", "=", "value", "and", "t2", ".", "points", ">", "value" ]
[ "What", "are", "the", "first", "names", "of", "the", "different", "drivers", "who", "won", "in", "position", "1", "as", "driver", "standing", "and", "had", "more", "than", "20", "points", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the numbers of constructors for different nationalities?
SELECT count(*) , nationality FROM constructors GROUP BY nationality
[ "SELECT", "count", "(", "*", ")", ",", "nationality", "FROM", "constructors", "GROUP", "BY", "nationality" ]
[ "select", "count", "(", "*", ")", ",", "nationality", "from", "constructors", "group", "by", "nationality" ]
[ "What", "are", "the", "numbers", "of", "constructors", "for", "different", "nationalities", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
For each nationality, how many different constructors are there?
SELECT count(*) , nationality FROM constructors GROUP BY nationality
[ "SELECT", "count", "(", "*", ")", ",", "nationality", "FROM", "constructors", "GROUP", "BY", "nationality" ]
[ "select", "count", "(", "*", ")", ",", "nationality", "from", "constructors", "group", "by", "nationality" ]
[ "For", "each", "nationality", ",", "how", "many", "different", "constructors", "are", "there", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the numbers of races for each constructor id?
SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid
[ "SELECT", "count", "(", "*", ")", ",", "constructorid", "FROM", "constructorStandings", "GROUP", "BY", "constructorid" ]
[ "select", "count", "(", "*", ")", ",", "constructorid", "from", "constructorstandings", "group", "by", "constructorid" ]
[ "What", "are", "the", "numbers", "of", "races", "for", "each", "constructor", "id", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
For each constructor id, how many races are there?
SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid
[ "SELECT", "count", "(", "*", ")", ",", "constructorid", "FROM", "constructorStandings", "GROUP", "BY", "constructorid" ]
[ "select", "count", "(", "*", ")", ",", "constructorid", "from", "constructorstandings", "group", "by", "constructorid" ]
[ "For", "each", "constructor", "id", ",", "how", "many", "races", "are", "there", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the names of races that were held after 2017 and the circuits were in the country of Spain?
SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
[ "SELECT", "T1.name", "FROM", "races", "AS", "T1", "JOIN", "circuits", "AS", "T2", "ON", "T1.circuitid", "=", "T2.circuitid", "WHERE", "T2.country", "=", "``", "Spain", "''", "AND", "T1.year", ">", "2017" ]
[ "select", "t1", ".", "name", "from", "races", "as", "t1", "join", "circuits", "as", "t2", "on", "t1", ".", "circuitid", "=", "t2", ".", "circuitid", "where", "t2", ".", "country", "=", "value", "and", "t1", ".", "year", ">", "value" ]
[ "What", "are", "the", "names", "of", "races", "that", "were", "held", "after", "2017", "and", "the", "circuits", "were", "in", "the", "country", "of", "Spain", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the names of the races held after 2017 in Spain?
SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
[ "SELECT", "T1.name", "FROM", "races", "AS", "T1", "JOIN", "circuits", "AS", "T2", "ON", "T1.circuitid", "=", "T2.circuitid", "WHERE", "T2.country", "=", "``", "Spain", "''", "AND", "T1.year", ">", "2017" ]
[ "select", "t1", ".", "name", "from", "races", "as", "t1", "join", "circuits", "as", "t2", "on", "t1", ".", "circuitid", "=", "t2", ".", "circuitid", "where", "t2", ".", "country", "=", "value", "and", "t1", ".", "year", ">", "value" ]
[ "What", "are", "the", "names", "of", "the", "races", "held", "after", "2017", "in", "Spain", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the unique names of races that held after 2000 and the circuits were in Spain?
SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
[ "SELECT", "DISTINCT", "T1.name", "FROM", "races", "AS", "T1", "JOIN", "circuits", "AS", "T2", "ON", "T1.circuitid", "=", "T2.circuitid", "WHERE", "T2.country", "=", "``", "Spain", "''", "AND", "T1.year", ">", "2000" ]
[ "select", "distinct", "t1", ".", "name", "from", "races", "as", "t1", "join", "circuits", "as", "t2", "on", "t1", ".", "circuitid", "=", "t2", ".", "circuitid", "where", "t2", ".", "country", "=", "value", "and", "t1", ".", "year", ">", "value" ]
[ "What", "are", "the", "unique", "names", "of", "races", "that", "held", "after", "2000", "and", "the", "circuits", "were", "in", "Spain", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the names of all races held after 2000 in Spain?
SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
[ "SELECT", "DISTINCT", "T1.name", "FROM", "races", "AS", "T1", "JOIN", "circuits", "AS", "T2", "ON", "T1.circuitid", "=", "T2.circuitid", "WHERE", "T2.country", "=", "``", "Spain", "''", "AND", "T1.year", ">", "2000" ]
[ "select", "distinct", "t1", ".", "name", "from", "races", "as", "t1", "join", "circuits", "as", "t2", "on", "t1", ".", "circuitid", "=", "t2", ".", "circuitid", "where", "t2", ".", "country", "=", "value", "and", "t1", ".", "year", ">", "value" ]
[ "What", "are", "the", "names", "of", "all", "races", "held", "after", "2000", "in", "Spain", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841)
[ "SELECT", "DISTINCT", "driverid", ",", "STOP", "FROM", "pitstops", "WHERE", "duration", "<", "(", "SELECT", "max", "(", "duration", ")", "FROM", "pitstops", "WHERE", "raceid", "=", "841", ")" ]
[ "select", "distinct", "driverid", ",", "stop", "from", "pitstops", "where", "duration", "<", "(", "select", "max", "(", "duration", ")", "from", "pitstops", "where", "raceid", "=", "value", ")" ]
[ "Find", "the", "distinct", "driver", "id", "and", "the", "stop", "number", "of", "all", "drivers", "that", "have", "a", "shorter", "pit", "stop", "duration", "than", "some", "drivers", "in", "the", "race", "with", "id", "841", "." ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What is the id and stop number for each driver that has a shorter pit stop than the driver in the race with id 841?
SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841)
[ "SELECT", "DISTINCT", "driverid", ",", "STOP", "FROM", "pitstops", "WHERE", "duration", "<", "(", "SELECT", "max", "(", "duration", ")", "FROM", "pitstops", "WHERE", "raceid", "=", "841", ")" ]
[ "select", "distinct", "driverid", ",", "stop", "from", "pitstops", "where", "duration", "<", "(", "select", "max", "(", "duration", ")", "from", "pitstops", "where", "raceid", "=", "value", ")" ]
[ "What", "is", "the", "id", "and", "stop", "number", "for", "each", "driver", "that", "has", "a", "shorter", "pit", "stop", "than", "the", "driver", "in", "the", "race", "with", "id", "841", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841)
[ "SELECT", "DISTINCT", "driverid", ",", "STOP", "FROM", "pitstops", "WHERE", "duration", ">", "(", "SELECT", "min", "(", "duration", ")", "FROM", "pitstops", "WHERE", "raceid", "=", "841", ")" ]
[ "select", "distinct", "driverid", ",", "stop", "from", "pitstops", "where", "duration", ">", "(", "select", "min", "(", "duration", ")", "from", "pitstops", "where", "raceid", "=", "value", ")" ]
[ "Find", "the", "distinct", "driver", "id", "of", "all", "drivers", "that", "have", "a", "longer", "stop", "duration", "than", "some", "drivers", "in", "the", "race", "whose", "id", "is", "841", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
What are the different ids and stop durations of all the drivers whose stop lasted longer than the driver in the race with the id 841?
SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841)
[ "SELECT", "DISTINCT", "driverid", ",", "STOP", "FROM", "pitstops", "WHERE", "duration", ">", "(", "SELECT", "min", "(", "duration", ")", "FROM", "pitstops", "WHERE", "raceid", "=", "841", ")" ]
[ "select", "distinct", "driverid", ",", "stop", "from", "pitstops", "where", "duration", ">", "(", "select", "min", "(", "duration", ")", "from", "pitstops", "where", "raceid", "=", "value", ")" ]
[ "What", "are", "the", "different", "ids", "and", "stop", "durations", "of", "all", "the", "drivers", "whose", "stop", "lasted", "longer", "than", "the", "driver", "in", "the", "race", "with", "the", "id", "841", "?" ]
formula_1
[ "CREATE TABLE IF NOT EXISTS \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KEY,\n \"circuitRef\" TEXT,\n \"name\" TEXT,\n \"location\" TEXT,\n \"country\" TEXT,\n \"lat\" REAL,\n \"lng\" REAL,\n \"alt\" INTEGER,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"races\" (\n\"raceId\" INTEGER PRIMARY KEY,\n \"year\" INTEGER,\n \"round\" INTEGER,\n \"circuitId\" INTEGER,\n \"name\" TEXT,\n \"date\" TEXT,\n \"time\" TEXT,\n \"url\" TEXT,\n FOREIGN KEY (\"circuitId\") REFERENCES \"circuits\"(\"circuitId\")\n);", "CREATE TABLE IF NOT EXISTS \"drivers\" (\n\"driverId\" INTEGER PRIMARY KEY,\n \"driverRef\" TEXT,\n \"number\" INTEGER,\n \"code\" TEXT,\n \"forename\" TEXT,\n \"surname\" TEXT,\n \"dob\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"status\" (\n\"statusId\" INTEGER PRIMARY KEY,\n \"status\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"seasons\" (\n\"year\" INTEGER PRIMARY KEY,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructors\" (\n\t\"constructorId\" INTEGER PRIMARY KEY,\n \"constructorRef\" TEXT,\n \"name\" TEXT,\n \"nationality\" TEXT,\n \"url\" TEXT\n);", "CREATE TABLE IF NOT EXISTS \"constructorStandings\" (\n\t\"constructorStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"results\" (\n\"resultId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"grid\" INTEGER,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"positionOrder\" INTEGER,\n \"points\" REAL,\n \"laps\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n \"fastestLap\" INTEGER,\n \"rank\" INTEGER,\n \"fastestLapTime\" TEXT,\n \"fastestLapSpeed\" TEXT,\n \"statusId\" INTEGER,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"driverStandings\" (\n\"driverStandingsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"points\" REAL,\n \"position\" INTEGER,\n \"positionText\" TEXT,\n \"wins\" INTEGER,\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"constructorResults\" (\n\"constructorResultsId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"constructorId\" INTEGER,\n \"points\" REAL,\n \"status\" REAL,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\")\n);", "CREATE TABLE IF NOT EXISTS \"qualifying\" (\n\"qualifyId\" INTEGER PRIMARY KEY,\n \"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"constructorId\" INTEGER,\n \"number\" INTEGER,\n \"position\" INTEGER,\n \"q1\" TEXT,\n \"q2\" TEXT,\n \"q3\" TEXT,\n FOREIGN KEY(\"constructorId\") REFERENCES \"constructors\"(\"constructorId\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"pitStops\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"stop\" INTEGER,\n \"lap\" INTEGER,\n \"time\" TEXT,\n \"duration\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY (\"raceId\", \"driverId\", \"stop\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);", "CREATE TABLE IF NOT EXISTS \"lapTimes\" (\n\"raceId\" INTEGER,\n \"driverId\" INTEGER,\n \"lap\" INTEGER,\n \"position\" INTEGER,\n \"time\" TEXT,\n \"milliseconds\" INTEGER,\n PRIMARY KEY(\"raceId\", \"driverId\", \"lap\"),\n FOREIGN KEY(\"raceId\") REFERENCES \"races\"(\"raceId\"),\n FOREIGN KEY (\"driverId\") REFERENCES \"drivers\"(\"driverId\")\n);" ]
List the forenames of all distinct drivers in alphabetical order?
SELECT DISTINCT forename FROM drivers ORDER BY forename ASC
[ "SELECT", "DISTINCT", "forename", "FROM", "drivers", "ORDER", "BY", "forename", "ASC" ]
[ "select", "distinct", "forename", "from", "drivers", "order", "by", "forename", "asc" ]
[ "List", "the", "forenames", "of", "all", "distinct", "drivers", "in", "alphabetical", "order", "?" ]