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 Activity (\n actid INTEGER PRIMARY KEY,\n acti... | 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 Activity (
actid INTEGER PRIMARY KEY,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER,
FOREIGN KEY(stuid) REFERENCES Student(StuID),
FOREIGN KEY(actid) REFERENCES Activity(actid)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEG... | SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = 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 Activity (\n actid INTEGER PRIMARY KEY,\n acti... | 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 Activity (
actid INTEGER PRIMARY KEY,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER,
FOREIGN KEY(stuid) REFERENCES Student(StuID),
FOREIGN KEY(actid) REFERENCES Activity(actid)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEG... | SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' |
[
{
"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 Activity (\n actid INTEGER PRIMARY KEY,\n acti... | 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 Activity (
actid INTEGER PRIMARY KEY,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER,
FOREIGN KEY(stuid) REFERENCES Student(StuID),
FOREIGN KEY(actid) REFERENCES Activity(actid)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEG... | SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name FROM airports WHERE city = 'Goroka' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name FROM airports WHERE city = 'Goroka' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name , city , country , elevation FROM airports WHERE city = 'New York' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name , city , country , elevation FROM airports WHERE city = 'New York' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airlines |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airlines |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airlines WHERE country = 'Russia' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airlines WHERE country = 'Russia' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT max(elevation) FROM airports WHERE country = 'Iceland' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT max(elevation) FROM airports WHERE country = 'Iceland' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name FROM airports WHERE country = 'Cuba' OR country = 'Argentina' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airlines WHERE name LIKE 'Orbit%' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airlines WHERE name LIKE 'Orbit%' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name FROM airports WHERE elevation BETWEEN -50 AND 50 |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airports ORDER BY elevation 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airports ORDER BY elevation 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airports WHERE name LIKE '%International%' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airports WHERE name LIKE '%International%' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(DISTINCT city) FROM airports WHERE country = 'Greenland' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE country = 'Canada' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name , city , country FROM airports ORDER BY elevation 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name , city , country FROM airports ORDER BY elevation 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name , city , country FROM airports ORDER BY elevation 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT name , city , country FROM airports ORDER BY elevation 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name , T1.city , T2.dst_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid GROUP BY T2.dst_apid 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10 |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name , T2.alid FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T2.alid ORDER BY count(*) DESC LIMIT 10 |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name , T1.city , T2.src_apid FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T2.src_apid 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(DISTINCT dst_apid) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid WHERE T1.name = 'American Airlines' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airlines GROUP BY country 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airlines GROUP BY country 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airlines WHERE active = 'Y' GROUP BY country 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country FROM airlines WHERE active = 'Y' GROUP BY country 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT country , count(*) FROM airlines GROUP BY country ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , country FROM airports GROUP BY country ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , city FROM airports WHERE country = 'United States' GROUP BY city ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city FROM airports WHERE country = 'United States' GROUP BY city HAVING count(*) > 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM (SELECT city FROM airports GROUP BY city HAVING count(*) > 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city , count(*) FROM airports GROUP BY city 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city , count(*) FROM airports GROUP BY city 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*) |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city FROM airports GROUP BY city HAVING count(*) > 2 ORDER BY count(*) |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) , T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name ORDER BY count(*) DESC |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT avg(elevation) , country FROM airports GROUP BY country |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT avg(elevation) , country FROM airports GROUP BY country |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city FROM airports GROUP BY city 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT city FROM airports GROUP BY city 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.country , T1.name , count(*) FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.country , T1.name |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid WHERE T2.country = 'Italy' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM routes AS T1 JOIN airports AS T2 ON T1.dst_apid = T2.apid JOIN airlines AS T3 ON T1.alid = T3.alid WHERE T2.country = 'Italy' AND T3.name = 'American Airlines' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport' |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT count(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT rid FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'United States') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') |
[
{
"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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name FROM airlines AS T1 JOIN routes AS T2 ON T1.alid = T2.alid GROUP BY T1.name 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name 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 routes (\n rid integer PRIMARY KEY,\n dst_ap... | 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 routes (
rid integer PRIMARY KEY,
dst_apid integer, -- Id of destination airport
dst_ap varchar(4), -- 3-letter (IATA) or 4-letter (ICAO) code of the destination airport
src_apid bigint, -- Id of source airport
src_ap varchar(4), ... | SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.country = 'China' GROUP BY T1.name 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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_id FROM orders ORDER BY date_order_placed 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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_id FROM orders ORDER BY date_order_placed 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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_id , customer_id FROM orders ORDER BY date_order_placed 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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_id , customer_id FROM orders ORDER BY date_order_placed 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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452" |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_item_id FROM order_items WHERE product_id = 11 |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT order_item_id FROM order_items WHERE product_id = 11 |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing" |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" |
[
{
"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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_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 `Customers` (\n`customer_id` INTEGER PRIMARY KEY... | 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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_name` VARCHAR(80),
`customer_details` VARCHAR(255)
)
CREATE TABLE `Invoices` (
`invoice_number` INTEGER PRIMARY KEY,
`invoice_date` DATETIME,
`invoice_details` VARCHAR(255)
)
CREATE TABLE `Orders` (
`order_id` INTEGER PRIMARY ... | SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.