Search is not available for this dataset
db_id
stringlengths
3
31
query
stringlengths
20
523
question
stringlengths
3
224
schema
stringlengths
589
322M
query_res
stringlengths
0
363k
ship_1
SELECT count(*) , rank FROM captain GROUP BY rank
Count the number of captains that have each rank.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1, 'Commander, junior captain') (2, 'Lieutenant') (4, 'Midshipman')
ship_1
SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
How many captains with younger than 50 are in each rank?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1, 'Commander, junior captain') (1, 'Lieutenant') (3, 'Midshipman')
ship_1
SELECT count(*) , rank FROM captain WHERE age < 50 GROUP BY rank
Count the number of captains younger than 50 of each rank.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1, 'Commander, junior captain') (1, 'Lieutenant') (3, 'Midshipman')
ship_1
SELECT name FROM captain ORDER BY age DESC
Sort all captain names by their ages from old to young.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Gilbert Pears',) ('Captain Beves Conway',) ('Lieutenant Montagu Verling',) ('Lieutenant Hugh Bolitho',) ('Captain Sir Henry Langford',) ('Captain Henry Dumaresq',) ('Commander Richard Bolitho',)
ship_1
SELECT name FROM captain ORDER BY age DESC
What are the names of captains, sorted by age descending?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Gilbert Pears',) ('Captain Beves Conway',) ('Lieutenant Montagu Verling',) ('Lieutenant Hugh Bolitho',) ('Captain Sir Henry Langford',) ('Captain Henry Dumaresq',) ('Commander Richard Bolitho',)
ship_1
SELECT name , CLASS , rank FROM captain
Find the name, class and rank of all captains.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Sir Henry Langford', 'Third-rate ship of the line', 'Midshipman') ('Captain Beves Conway', 'Third-rate ship of the line', 'Midshipman') ('Lieutenant Hugh Bolitho', 'Cutter', 'Midshipman') ('Lieutenant Montagu Verling', 'Armed schooner', 'Midshipman') ('Captain Henry Dumaresq', 'Frigate', 'Lieutenant') ('Capta...
ship_1
SELECT name , CLASS , rank FROM captain
What are the names, classes, and ranks of all captains?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Sir Henry Langford', 'Third-rate ship of the line', 'Midshipman') ('Captain Beves Conway', 'Third-rate ship of the line', 'Midshipman') ('Lieutenant Hugh Bolitho', 'Cutter', 'Midshipman') ('Lieutenant Montagu Verling', 'Armed schooner', 'Midshipman') ('Captain Henry Dumaresq', 'Frigate', 'Lieutenant') ('Capta...
ship_1
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
Which rank is the most common among captains?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Midshipman',)
ship_1
SELECT rank FROM captain GROUP BY rank ORDER BY count(*) DESC LIMIT 1
Return the rank for which there are the fewest captains.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Midshipman',)
ship_1
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
Which classes have more than two captains?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Third-rate ship of the line',)
ship_1
SELECT CLASS FROM captain GROUP BY CLASS HAVING count(*) > 2
Give the classes that have more than two captains.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Third-rate ship of the line',)
ship_1
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
Find the name of captains whose rank are either Midshipman or Lieutenant.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Sir Henry Langford',) ('Captain Beves Conway',) ('Lieutenant Hugh Bolitho',) ('Lieutenant Montagu Verling',) ('Captain Henry Dumaresq',) ('Captain Gilbert Pears',)
ship_1
SELECT name FROM captain WHERE rank = 'Midshipman' OR rank = 'Lieutenant'
What are the names of captains that have either the rank Midshipman or Lieutenant?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Sir Henry Langford',) ('Captain Beves Conway',) ('Lieutenant Hugh Bolitho',) ('Lieutenant Montagu Verling',) ('Captain Henry Dumaresq',) ('Captain Gilbert Pears',)
ship_1
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
What are the average and minimum age of captains in different class?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(45.0, '45', 'Armed schooner') (43.0, '43', 'Cutter') (38.0, '38', 'Frigate') (38.0, '38', 'Sloop-of-war') (51.333333333333336, '40', 'Third-rate ship of the line')
ship_1
SELECT avg(age) , min(age) , CLASS FROM captain GROUP BY CLASS
Return the average and minimum age of captains in each class.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(45.0, '45', 'Armed schooner') (43.0, '43', 'Cutter') (38.0, '38', 'Frigate') (38.0, '38', 'Sloop-of-war') (51.333333333333336, '40', 'Third-rate ship of the line')
ship_1
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
Find the captain rank that has some captains in both Cutter and Armed schooner classes.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Midshipman',)
ship_1
SELECT rank FROM captain WHERE CLASS = 'Cutter' INTERSECT SELECT rank FROM captain WHERE CLASS = 'Armed schooner'
What are the ranks of captains that are both in the Cutter and Armed schooner classes?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Midshipman',)
ship_1
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
Find the captain rank that has no captain in Third-rate ship of the line class.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Commander, junior captain',)
ship_1
SELECT rank FROM captain EXCEPT SELECT rank FROM captain WHERE CLASS = 'Third-rate ship of the line'
What are the ranks of captains that have no captain that are in the Third-rate ship of the line class?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Commander, junior captain',)
ship_1
SELECT name FROM captain ORDER BY age LIMIT 1
What is the name of the youngest captain?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Henry Dumaresq',)
ship_1
SELECT name FROM captain ORDER BY age LIMIT 1
Return the name of the youngest captain.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Captain Henry Dumaresq',)
ship_1
SELECT count(*) FROM ship
how many ships are there?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(9,)
ship_1
SELECT count(*) FROM ship
Count the number of ships.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(9,)
ship_1
SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
Find the name, type, and flag of the ship that is built in the most recent year.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Gorgon', 'Panamax', 'Panama')
ship_1
SELECT name , TYPE , flag FROM ship ORDER BY built_year DESC LIMIT 1
What is the name, type, and flag of the ship that was built in the most recent year?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Gorgon', 'Panamax', 'Panama')
ship_1
SELECT count(*) , flag FROM ship GROUP BY flag
Group by ships by flag, and return number of ships that have each flag.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1, 'Malta') (8, 'Panama')
ship_1
SELECT count(*) , flag FROM ship GROUP BY flag
What are the different ship flags, and how many ships have each?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1, 'Malta') (8, 'Panama')
ship_1
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
Which flag is most widely used among all ships?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Panama',)
ship_1
SELECT flag FROM ship GROUP BY flag ORDER BY count(*) DESC LIMIT 1
Return the flag that is most common among all ships.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Panama',)
ship_1
SELECT name FROM ship ORDER BY built_year , CLASS
List all ship names in the order of built year and class.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Manxman',) ('HM Cutter Avenger',) ('HMS Trojan',) ('HM Sloop Sparrow',) ('HMS Phalarope',) ('HMS Undine',) ('HMS Gorgon',) ('HM Schooner Hotspur',) ('HMS Destiny',)
ship_1
SELECT name FROM ship ORDER BY built_year , CLASS
What are the names of ships, ordered by year they were built and their class?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Manxman',) ('HM Cutter Avenger',) ('HMS Trojan',) ('HM Sloop Sparrow',) ('HMS Phalarope',) ('HMS Undine',) ('HMS Gorgon',) ('HM Schooner Hotspur',) ('HMS Destiny',)
ship_1
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
Find the ship type that are used by both ships with Panama and Malta flags.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Panamax',)
ship_1
SELECT TYPE FROM ship WHERE flag = 'Panama' INTERSECT SELECT TYPE FROM ship WHERE flag = 'Malta'
What types of ships have both ships that have Panama Flags and Malta flags?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('Panamax',)
ship_1
SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
In which year were most of ships built?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1997.0,)
ship_1
SELECT built_year FROM ship GROUP BY built_year ORDER BY count(*) DESC LIMIT 1
What is the year in which most ships were built?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
(1997.0,)
ship_1
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1
Find the name of the ships that have more than one captain.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Gorgon',) ('HM Cutter Avenger',)
ship_1
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id GROUP BY t2.ship_id HAVING count(*) > 1
What are the names of ships that have more than one captain?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Gorgon',) ('HM Cutter Avenger',)
ship_1
SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
what are the names and classes of the ships that do not have any captain yet?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Trojan', 'KR') ('HM Sloop Sparrow', 'KR') ('HMS Phalarope', 'KR') ('HMS Undine', 'GL')
ship_1
SELECT name , CLASS FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain)
Return the names and classes of ships that do not have a captain?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Trojan', 'KR') ('HM Sloop Sparrow', 'KR') ('HMS Phalarope', 'KR') ('HMS Undine', 'GL')
ship_1
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
Find the name of the ship that is steered by the youngest captain.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Destiny',)
ship_1
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1
What is the name of the ship that is commanded by the youngest captain?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Destiny',)
ship_1
SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
Find the name and flag of ships that are not steered by any captain with Midshipman rank.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Destiny', 'Panama') ('HMS Trojan', 'Panama') ('HM Sloop Sparrow', 'Panama') ('HMS Phalarope', 'Panama') ('HMS Undine', 'Malta')
ship_1
SELECT name , flag FROM ship WHERE ship_id NOT IN (SELECT ship_id FROM captain WHERE rank = 'Midshipman')
What are the names and flags of ships that do not have a captain with the rank of Midshipman?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Destiny', 'Panama') ('HMS Trojan', 'Panama') ('HM Sloop Sparrow', 'Panama') ('HMS Phalarope', 'Panama') ('HMS Undine', 'Malta')
ship_1
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
Find the name of the ships that are steered by both a captain with Midshipman rank and a captain with Lieutenant rank.
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Gorgon',)
ship_1
SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Midshipman' INTERSECT SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id WHERE t2.rank = 'Lieutenant'
What are the names of ships that are commanded by both captains with the rank of Midshipman and captains with the rank of Lieutenant?
PRAGMA foreign_keys = ON; CREATE TABLE "captain" ( "Captain_ID" int, "Name" text, "Ship_ID" int, "age" text, "Class" text, "Rank" text, PRIMARY KEY ("Captain_ID"), FOREIGN KEY ("Ship_ID") REFERENCES "Ship"("Ship_ID") ); CREATE TABLE "Ship" ( "Ship_ID" int, "Name" text, "Type" text, "Built_Year" real, "Class" text, "F...
('HMS Gorgon',)
city_record
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
What is id of the city that hosted events in the most recent year?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('11',)
city_record
SELECT host_city FROM hosting_city ORDER BY YEAR DESC LIMIT 1
Find the city that hosted some events in the most recent year. What is the id of this city?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('11',)
city_record
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
Find the match ids of the cities that hosted competition "1994 FIFA World Cup qualification"?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(2,) (3,) (4,) (5,)
city_record
SELECT match_id FROM MATCH WHERE competition = "1994 FIFA World Cup qualification"
What is the match id of the competition called "1994 FIFA World Cup qualification"?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(2,) (3,) (4,) (5,)
city_record
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
Find the cities which were once a host city after 2010?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Wuxi ( Jiangsu )',) ('Taizhou ( Zhejiang )',) ('Jiaxing ( Zhejiang )',)
city_record
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2010
Which cities served as a host city after 2010?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Wuxi ( Jiangsu )',) ('Taizhou ( Zhejiang )',) ('Jiaxing ( Zhejiang )',)
city_record
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1
Which city has hosted the most events?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Nanjing ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY T2.host_city ORDER BY count(*) DESC LIMIT 1
Find the city that hosted the most events.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Nanjing ( Jiangsu )',)
city_record
SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
What is the venue of the competition "1994 FIFA World Cup qualification" hosted by "Nanjing ( Jiangsu )"?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Estadio Rigoberto López , Managua , Nicaragua',) ('Estadio Cuscatlán , San Salvador , El Salvador',)
city_record
SELECT T3.venue FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city JOIN MATCH AS T3 ON T2.match_id = T3.match_id WHERE T1.city = "Nanjing ( Jiangsu )" AND T3.competition = "1994 FIFA World Cup qualification"
Find the venue of the competition "1994 FIFA World Cup qualification" which was hosted by "Nanjing ( Jiangsu )".
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Estadio Rigoberto López , Managua , Nicaragua',) ('Estadio Cuscatlán , San Salvador , El Salvador',)
city_record
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
Give me the temperature of Shanghai in January.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(17.8,)
city_record
SELECT T2.Jan FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T1.city = "Shanghai"
What is the temperature of "Shanghai" city in January?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(17.8,)
city_record
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
What is the host year of city "Taizhou ( Zhejiang )"?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(2012,)
city_record
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
IN which year did city "Taizhou ( Zhejiang )" serve as a host city?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(2012,)
city_record
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
Which three cities have the largest regional population?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Shanghai',) ('Suzhou ( Jiangsu )',) ('Hangzhou ( Zhejiang )',)
city_record
SELECT city FROM city ORDER BY regional_population DESC LIMIT 3
What are the three largest cities in terms of regional population?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Shanghai',) ('Suzhou ( Jiangsu )',) ('Hangzhou ( Zhejiang )',)
city_record
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
Which city has the lowest GDP? Please list the city name and its GDP.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Jinhua ( Zhejiang )', 244.77)
city_record
SELECT city , GDP FROM city ORDER BY GDP LIMIT 1
What is the city with the smallest GDP? Return the city and its GDP.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Jinhua ( Zhejiang )', 244.77)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
Which city has the highest temperature in February?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Suzhou ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id ORDER BY T2.Feb DESC LIMIT 1
In February, which city marks the highest temperature?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Suzhou ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct
Give me a list of cities whose temperature in March is lower than that in July or higher than that in Oct?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Shanghai',) ('Nanjing ( Jiangsu )',) ('Hangzhou ( Zhejiang )',) ('Suzhou ( Jiangsu )',) ('Wuxi ( Jiangsu )',) ('Nantong ( Jiangsu )',) ('Jinhua ( Zhejiang )',) ('Jiaxing ( Zhejiang )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul OR T2.Mar > T2.Oct
Which cities' temperature in March is lower than that in July or higher than that in Oct?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Shanghai',) ('Nanjing ( Jiangsu )',) ('Hangzhou ( Zhejiang )',) ('Suzhou ( Jiangsu )',) ('Wuxi ( Jiangsu )',) ('Nantong ( Jiangsu )',) ('Jinhua ( Zhejiang )',) ('Jiaxing ( Zhejiang )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Give me a list of cities whose temperature in Mar is lower than that in July and which have also served as host cities?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Jiaxing ( Zhejiang )',) ('Nanjing ( Jiangsu )',) ('Shanghai',) ('Wuxi ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Jul INTERSECT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Which cities have lower temperature in March than in July and have been once host cities?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Jiaxing ( Zhejiang )',) ('Nanjing ( Jiangsu )',) ('Shanghai',) ('Wuxi ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Give me a list of cities whose temperature in Mar is lower than that in Dec and which have never been host cities.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Hangzhou ( Zhejiang )',) ('Nantong ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Mar < T2.Dec EXCEPT SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Which cities have lower temperature in March than in Dec and have never served as host cities?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Hangzhou ( Zhejiang )',) ('Nantong ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Jiaxing ( Zhejiang )',) ('Nanjing ( Jiangsu )',) ('Shanghai',) ('Taizhou ( Zhejiang )',) ('Wuxi ( Jiangsu )',)
city_record
SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.Feb > T2.Jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city
Which cities have higher temperature in Feb than in Jun or have once served as host cities?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Jiaxing ( Zhejiang )',) ('Nanjing ( Jiangsu )',) ('Shanghai',) ('Taizhou ( Zhejiang )',) ('Wuxi ( Jiangsu )',)
city_record
SELECT city FROM city WHERE regional_population > 10000000
Please give me a list of cities whose regional population is over 10000000.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Shanghai',) ('Suzhou ( Jiangsu )',)
city_record
SELECT city FROM city WHERE regional_population > 10000000
Which cities have regional population above 10000000?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Shanghai',) ('Suzhou ( Jiangsu )',)
city_record
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
Please give me a list of cities whose regional population is over 8000000 or under 5000000.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Changzhou ( Jiangsu )',) ('Jiaxing ( Zhejiang )',) ('Jinhua ( Zhejiang )',) ('Shanghai',) ('Shaoxing ( Zhejiang )',) ('Suzhou ( Jiangsu )',) ('Yangzhou ( Jiangsu )',)
city_record
SELECT city FROM city WHERE regional_population > 10000000 UNION SELECT city FROM city WHERE regional_population < 5000000
Which cities have regional population above 8000000 or below 5000000?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Changzhou ( Jiangsu )',) ('Jiaxing ( Zhejiang )',) ('Jinhua ( Zhejiang )',) ('Shanghai',) ('Shaoxing ( Zhejiang )',) ('Suzhou ( Jiangsu )',) ('Yangzhou ( Jiangsu )',)
city_record
SELECT count(*) , Competition FROM MATCH GROUP BY Competition
Find the number of matches in different competitions.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(4, '1994 FIFA World Cup qualification') (1, '2002 FIFA World Cup qualification') (1, 'Friendly match')
city_record
SELECT count(*) , Competition FROM MATCH GROUP BY Competition
For each competition, count the number of matches.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(4, '1994 FIFA World Cup qualification') (1, '2002 FIFA World Cup qualification') (1, 'Friendly match')
city_record
SELECT venue FROM MATCH ORDER BY date DESC
List venues of all matches in the order of their dates starting from the most recent one.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Rigoberto López , Managua , Nicaragua',) ('Estadio Cuscatlán , San Salvador , El Salvador',)
city_record
SELECT venue FROM MATCH ORDER BY date DESC
What are the venues of all the matches? Sort them in the descending order of match date.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Cuscatlán , San Salvador , El Salvador',) ('Estadio Rigoberto López , Managua , Nicaragua',) ('Estadio Cuscatlán , San Salvador , El Salvador',)
city_record
SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
what is the GDP of the city with the largest population.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(1919.57,)
city_record
SELECT gdp FROM city ORDER BY Regional_Population DESC LIMIT 1
Find the GDP of the city with the largest regional population.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(1919.57,)
city_record
SELECT t1.gdp , t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING count(*) > 1
What are the GDP and population of the city that already served as a host more than once?
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(614.55, 8004680)
city_record
SELECT t1.gdp , t1.Regional_Population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.Host_City HAVING count(*) > 1
Which cities have served as host cities more than once? Return me their GDP and population.
PRAGMA foreign_keys = ON; CREATE TABLE "city" ( "City_ID" int, "City" text, "Hanzi" text, "Hanyu_Pinyin" text, "Regional_Population" int, "GDP" real, PRIMARY KEY ("City_ID") ); CREATE TABLE "match" ( "Match_ID" int, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text, PRIMARY KEY ("Match_ID") ...
(614.55, 8004680)
e_government
SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name
List every individual's first name, middle name and last name in alphabetical order by last name.
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Ressie', 'Alysson', 'Bradtke') ('Shany', 'Colleen', "D'Amore") ('Katarina', 'Lacey', 'Dooley') ('Daron', 'Howard', 'Hand') ('Jeffery', 'Alberto', 'Jacobs') ('Geovanny', 'Antonia', 'Kerluke') ('Nella', 'Tommie', 'Kertzmann') ('Casper', 'Mitchell', 'Kutch') ('Oscar', 'Hosea', 'Maggio') ('Jaylen', 'Jewell', "O'Conner") ...
e_government
SELECT individual_first_name , individual_middle_name , individual_last_name FROM individuals ORDER BY individual_last_name
What are the first, middle, and last names of all individuals, ordered by last name?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Ressie', 'Alysson', 'Bradtke') ('Shany', 'Colleen', "D'Amore") ('Katarina', 'Lacey', 'Dooley') ('Daron', 'Howard', 'Hand') ('Jeffery', 'Alberto', 'Jacobs') ('Geovanny', 'Antonia', 'Kerluke') ('Nella', 'Tommie', 'Kertzmann') ('Casper', 'Mitchell', 'Kutch') ('Oscar', 'Hosea', 'Maggio') ('Jaylen', 'Jewell', "O'Conner") ...
e_government
SELECT DISTINCT form_type_code FROM forms
List all the types of forms.
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Basic',) ('Complex',)
e_government
SELECT DISTINCT form_type_code FROM forms
What are the different types of forms?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Basic',) ('Complex',)
e_government
SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
Find the name of the most popular party form.
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Property Change',)
e_government
SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY count(*) DESC LIMIT 1
What is the name of the party form that is most common?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Property Change',)
e_government
SELECT payment_method_code , party_phone FROM parties WHERE party_email = "enrico09@example.com"
Find the payment method and phone of the party with email "enrico09@example.com".
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Cheque', '05374656172')
e_government
SELECT payment_method_code , party_phone FROM parties WHERE party_email = "enrico09@example.com"
What is the payment method code and party phone of the party with the email 'enrico09@example.com'?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Cheque', '05374656172')
e_government
SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)
Find the emails of parties with the most popular party form.
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('alanna.boehm@example.net',) ('lucinda83@example.org',) ('erick.mills@example.com',)
e_government
SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id = t2.party_id WHERE t2.form_id = (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)
What are the party emails associated with parties that used the party form that is the most common?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('alanna.boehm@example.net',) ('lucinda83@example.org',) ('erick.mills@example.com',)
e_government
SELECT organization_name FROM organizations ORDER BY date_formed ASC
List all the name of organizations in order of the date formed.
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Green Party',) ('Labour Party',) ('Plaid Cymru',) ('Conservative',) ('Liberal Democrats',)
e_government
SELECT organization_name FROM organizations ORDER BY date_formed ASC
What are the names of organizations, ordered by the date they were formed, ascending?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Green Party',) ('Labour Party',) ('Plaid Cymru',) ('Conservative',) ('Liberal Democrats',)
e_government
SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
Find the name of the youngest organization.
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Liberal Democrats',)
e_government
SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
What is the name of the organization that was formed most recently?
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Liberal Democrats',)
e_government
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.organization_name = "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
Find the last name of the latest contact individual of the organization "Labour Party".
PRAGMA foreign_keys = ON; CREATE TABLE `Addresses` ( `address_id` INTEGER PRIMARY KEY, `line_1_number_building` VARCHAR(80), `town_city` VARCHAR(50), `zip_postcode` VARCHAR(20), `state_province_county` VARCHAR(50), `country` VARCHAR(50) ); INSERT INTO Addresses (`address_id`, `line_1_number_building`, `town_city`, `zi...
('Bradtke',)