messages listlengths 3 3 | system stringclasses 1
value | user stringlengths 326 8.38k | assistant stringlengths 18 577 |
|---|---|---|---|
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_type_code FROM Ref_Document_Types; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT shipping_agent_name FROM Ref_Shipping_Agents; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT role_code FROM ROLES; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT role_description FROM ROLES WHERE role_code = "ED"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT count(*) FROM Employees; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_id , receipt_date FROM Documents; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT count(*) FROM Documents WHERE document_status_code = "done"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_type_code FROM Documents WHERE document_id = 2; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT receipt_date FROM Documents WHERE document_id = 3; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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"; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT draft_details FROM Document_Drafts WHERE document_id = 7; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT count(*) FROM Draft_Copies WHERE document_id = 2; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_id , count(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY count(copy_number) DESC LIMIT 1; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_id , count(*) FROM Draft_Copies GROUP BY document_id HAVING count(*) > 1; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | 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; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Ref_Document_Types (\ndocument_type_code CHAR(15... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Ref_Document_Types (
document_type_code CHAR(15) NOT NULL,
document_type_description VARCHAR(255) NOT NULL,
PRIMARY KEY (document_type_code)
)
CREATE TABLE Roles (
role_code CHAR(15) NOT NULL,
role_description VARCHAR(255),
PRIMARY KEY (role_code)
)
CREATE TABLE Addresses (
address_id... | SELECT document_id , count(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id; |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT dname FROM department ORDER BY mgr_start_date |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT count(*) FROM dependent WHERE sex = 'F' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT fname , lname FROM employee WHERE salary > 30000 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT count(*) , sex FROM employee WHERE salary < 50000 GROUP BY sex |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE works_on(\nEssn INTEGER,\nPno INTEGER,\nHours RE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno))
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER,
Dno INTEGER)
CREATE TABLE department(
Dname TEXT,
Dnumbe... | SELECT fname , lname , address FROM employee ORDER BY Bdate |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT Participant_ID , Participant_Type_Code , Participant_Details FROM Participants |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT count(*) FROM participants WHERE participant_type_code = 'Organizer' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT service_type_code FROM services ORDER BY service_type_code |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT service_id , event_details FROM EVENTS |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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.%' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY count(*) DESC LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY count(*) DESC LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | 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' |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT count(*) FROM EVENTS WHERE event_id NOT IN (SELECT event_id FROM Participants_in_Events) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE Services (\nService_ID INTEGER NOT NULL,\nServic... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE Services (
Service_ID INTEGER NOT NULL,
Service_Type_Code CHAR(15) NOT NULL,
PRIMARY KEY (Service_ID)
)
CREATE TABLE Participants (
Participant_ID INTEGER NOT NULL,
Participant_Type_Code CHAR(15) NOT NULL,
Participant_Details VARCHAR(255),
PRIMARY KEY (Participant_ID)
)
CREATE TABLE E... | SELECT count(DISTINCT participant_id) FROM participants_in_Events |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT name FROM races ORDER BY date DESC LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT name FROM races ORDER BY date DESC LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT name , date FROM races ORDER BY date DESC LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT name , date FROM races ORDER BY date DESC LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT name FROM races WHERE YEAR = 2017 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT name FROM races WHERE YEAR = 2017 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 ) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 ) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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" |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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" |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT forename , surname FROM drivers WHERE nationality = "German" |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT forename , surname FROM drivers WHERE nationality = "German" |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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.drive... |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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.drive... |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 = T... |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 = T... |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(*) , nationality FROM constructors GROUP BY nationality |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(*) , nationality FROM constructors GROUP BY nationality |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | 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 |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841) |
[
{
"role": "system",
"content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"circuits\" (\n\"circuitId\" INTEGER PRIMARY KE... | You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation. | ### Database Schema
CREATE TABLE "circuits" (
"circuitId" INTEGER PRIMARY KEY,
"circuitRef" TEXT,
"name" TEXT,
"location" TEXT,
"country" TEXT,
"lat" REAL,
"lng" REAL,
"alt" TEXT,
"url" TEXT
)
CREATE TABLE "races" (
"raceId" INTEGER PRIMARY KEY,
"year" INTEGER,
"round" INTEGER,
"circuitId" INTEGE... | SELECT DISTINCT forename FROM drivers ORDER BY forename ASC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.