interaction_utterance
sequencelengths 0
6
| interaction_query
sequencelengths 0
6
| final_utterance
stringlengths 19
224
| final_query
stringlengths 22
577
| db_id
stringclasses 140
values |
---|---|---|---|---|
[
"Show the name for all trains.",
"Also show the time and service for them."
] | [
"SELECT name FROM train",
"SELECT name , TIME , service FROM train"
] | Show the name, time, and service for all trains. | SELECT name , TIME , service FROM train | train_station |
[
"Show information for all trains.",
"How many are there?"
] | [
"SELECT * FROM train",
"SELECT count(*) FROM train"
] | Show the number of trains | SELECT count(*) FROM train | train_station |
[
"Show the names of the trains.",
"Also show the services.",
"Order the result by time."
] | [
"SELECT name FROM train",
"SELECT name , service FROM train",
"SELECT name , service FROM train ORDER BY TIME"
] | Show the name and service for all trains in order by time. | SELECT name , service FROM train ORDER BY TIME | train_station |
[
"Show the name for each station.",
"For each station name, also count the number of trains."
] | [
"select name from station",
"SELECT T2.name , count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id"
] | Show the station name and number of trains in each station. | SELECT T2.name , count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id | train_station |
[
"Show the name for each train.",
"For each train, also show the station name."
] | [
"select name from train",
"SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id"
] | show the train name and station name for each train. | SELECT T2.name , T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id | train_station |
[
"Show all train names and times.",
"Show the results only for trains in stations in London.",
"Order them in descending order by train time."
] | [
"select name, time from train",
"SELECT T3.name , T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London'",
"SELECT T3.name , T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC"
] | Show all train names and times in stations in London in descending order by train time. | SELECT T3.name , T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC | train_station |
[
"Show the name for all train stations.",
"Order those names in descending order of the number of trains.",
"Which one has the most?"
] | [
"SELECT name FROM station",
"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY count(*) DESC",
"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY count(*) DESC LIMIT 1"
] | Show the station name with greatest number of trains. | SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY count(*) DESC LIMIT 1 | train_station |
[
"List the name for all stations.",
"Also count the number of trains for each.",
"Show those names with at least two trains."
] | [
"SELECT name FROM station",
"SELECT T2.name, count(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id",
"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING count(*) >= 2"
] | Show the station name with at least two trains. | SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING count(*) >= 2 | train_station |
[
"Show the location for all stations.",
"What are those locations with only 1 station?"
] | [
"SELECT LOCATION FROM station",
"SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*) = 1"
] | Show all locations with only 1 station. | SELECT LOCATION FROM station GROUP BY LOCATION HAVING count(*) = 1 | train_station |
[
"Show station id for all stations with a train.",
"Show the name of stations without any train."
] | [
"SELECT station_id FROM train_station",
"SELECT name FROM station WHERE station_id NOT IN (SELECT station_id FROM train_station)"
] | Show station names without any trains. | SELECT name FROM station WHERE station_id NOT IN (SELECT station_id FROM train_station) | train_station |
[
"What are the names for all the stations?",
"What are the names for those serving \"Ananthapuri Express\" trains?",
"How about those serving \"Guruvayur Express\"?",
"Which serve both?"
] | [
"select name from station",
"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = \"Ananthapuri Express\"",
"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = \"Guruvayur Express\"",
"SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = \"Ananthapuri Express\" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = \"Guruvayur Express\""
] | What are the names of the stations which serve both "Ananthapuri Express" and "Guruvayur Express" trains? | SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Ananthapuri Express" INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = "Guruvayur Express" | train_station |
[
"Show station ids for stations located in London.",
"Show the names for all trains.",
"Only show the names for the trains that do not pass any station located in London."
] | [
"SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = \"London\"",
"SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id",
"SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE T1.station_id NOT IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = \"London\")"
] | Find the names of the trains that do not pass any station located in London. | SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE T1.station_id NOT IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = "London") | train_station |
[
"Tell me the age of the student named Tracy.",
"Tell me the club she is in.",
"Tell me the last names of the members of the club \"Bootup Baltimore\"?"
] | [
"SELECT Age FROM Student WHERE Fname = \"Tracy\"",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.Fname = \"Tracy\"",
"SELECT t3.Lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubName = \"Bootup Baltimore\""
] | Find the last names of the members of the club "Bootup Baltimore". | SELECT t3.Lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubName = "Bootup Baltimore" | club_1 |
[
"Tell me the description of the club named \"Hopkins Student Enterprises\".",
"How about its location?",
"Tell me who are the members of the club named \"Hopkins Student Enterprises\"? Show me the last name."
] | [
"SELECT ClubDesc FROM Club WHERE ClubName = \"Hopkins Student Enterprises\"",
"SELECT ClubLocation FROM Club WHERE ClubName = \"Hopkins Student Enterprises\"",
"SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubName = \"Hopkins Student Enterprises\""
] | Who are the members of the club named "Hopkins Student Enterprises"? Show the last name. | SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" | club_1 |
[
"Tell me the major of the student named \"Eric\".",
"What club did he join?",
"How many members does the club \"Tennis Club\" have?"
] | [
"SELECT Major FROM Student WHERE Fname = \"Eric\"",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.Fname = \"Eric\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Tennis Club\""
] | How many members does the club "Tennis Club" has? | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club" | club_1 |
[
"Tell me the positions of the student named Lisa.",
"Tell me the club she is in.",
"Show me the the number of members of club \"Pen and Paper Gaming\"."
] | [
"SELECT Position FROM member_of_club AS t1 JOIN student AS t2 ON t1.stuid = t2.stuid WHERE T2.Fname = \"Lisa\"",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.Fname = \"Lisa\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Pen and Paper Gaming\""
] | Find the number of members of club "Pen and Paper Gaming". | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Pen and Paper Gaming" | club_1 |
[
"Tell me the advisor of \"Linda Smith\".",
"Tell me her age.",
"How many clubs does \"Linda Smith\" belong to?"
] | [
"SELECT Advisor FROM Student WHERE LName = \"Smith\" AND Fname = \"Linda\"",
"SELECT Age FROM Student WHERE LName = \"Smith\" AND Fname = \"Linda\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Linda\" AND t3.lname = \"Smith\""
] | How many clubs does "Linda Smith" belong to? | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith" | club_1 |
[
"Tell me Paul's sex.",
"Tell me the number of clubs where he is a member.",
"What is the number of clubs where \"Tracy Kim\" is a member?"
] | [
"SELECT Sex FROM Student WHERE Fname = \"Paul\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.Fname = \"Paul\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Tracy\" AND t3.lname = \"Kim\""
] | Find the number of clubs where "Tracy Kim" is a member. | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim" | club_1 |
[
"Tell me the location of club \"Tennis Club\".",
"What is the first name of the members in it?",
"Tell me all the female members of the club \"Bootup Baltimore\". Show the first name and last name."
] | [
"SELECT ClubLocation FROM Club WHERE ClubName = \"Tennis Club\"",
"SELECT t3.Fname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubName = \"Tennis Club\"",
"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.sex = \"F\""
] | Find all the female members of club "Bootup Baltimore". Show the first name and last name. | SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F" | club_1 |
[
"What is the description of the club named \"Hopkins Student Enterprises\"?",
"What are all the female members of the club? Show me the first name.",
"Who are the male members of the club? Show me the first name and last name."
] | [
"SELECT ClubDesc FROM Club WHERE ClubName = \"Hopkins Student Enterprises\"",
"SELECT t3.fname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t3.sex = \"F\"",
"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t3.sex = \"M\""
] | Find all the male members of club "Hopkins Student Enterprises". Show the first name and last name. | SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M" | club_1 |
[
"Tell me the first names of all the female students.",
"Tell me their majors.",
"Find all members of \"Bootup Baltimore\" whose major is \"600\". Show the first name and last name"
] | [
"SELECT Fname FROM Student WHERE Sex = \"F\"",
"SELECT Major FROM Student WHERE Sex = \"F\"",
"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.major = \"600\""
] | Find all members of "Bootup Baltimore" whose major is "600". Show the first name and last name. | SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600" | club_1 |
[
"Tell me the first names of students whose advisor is 1121.",
"Tell me the last names of students whose major is 600.",
"Tell me which club has the most members majoring in \"600\"."
] | [
"SELECT Fname FROM Student WHERE advisor = 1121",
"SELECT LName FROM Student WHERE major = 600",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = \"600\" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1"
] | Which club has the most members majoring in "600"? | SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1 | club_1 |
[
"Tell me the club Andy is in.",
"What is Andy's sex?",
"What is the name of the club that has the most female students."
] | [
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.Fname = \"Andy\"",
"SELECT Sex FROM Student WHERE Fname = \"Andy\"",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = \"F\" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1"
] | Find the name of the club that has the most female students. | SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1 | club_1 |
[
"How many students are in club \"Bootup Baltimore\"?",
"Tell me its location.",
"What is the first and last name of the president of this club?"
] | [
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"",
"SELECT ClubLocation FROM Club WHERE ClubName = \"Bootup Baltimore\"",
"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t2.position = \"President\""
] | What are the first and last name of the president of the club "Bootup Baltimore"? | SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President" | club_1 |
[
"Tell me the position of the student Jandy.",
"Tell me the club she is in.",
"Who is the \"CTO\" of club \"Hopkins Student Enterprises\"? Show the first name and last name."
] | [
"SELECT Position FROM member_of_club AS t1 JOIN student AS t2 ON t1.stuid = t2.stuid WHERE T2.Fname = \"Jandy\"",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.Fname = \"Jandy\"",
"SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" AND t2.position = \"CTO\""
] | Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name. | SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO" | club_1 |
[
"How many clubs are there in AKW?",
"Tell me their name.",
"How many different roles are there in the club \"Bootup Baltimore\"?"
] | [
"SELECT COUNT(*) FROM Club WHERE ClubLocation = \"AKW\"",
"SELECT ClubName FROM Club WHERE ClubLocation = \"AKW\"",
"SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = \"Bootup Baltimore\""
] | How many different roles are there in the club "Bootup Baltimore"? | SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore" | club_1 |
[
"How many students are there living in NYC?",
"Tell me the clubs they are in.",
"Tell me how many members of \"Bootup Baltimore\" are older than 18?"
] | [
"SELECT COUNT(*) FROM Student WHERE city_code = \"NYC\"",
"SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"NYC\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.age > 18"
] | How many members of "Bootup Baltimore" are older than 18? | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.age > 18 | club_1 |
[
"What's the age of the student named Derek?",
"Tell me the age of students in the club \"Bootup Baltimore\"?",
"How many members of that club are younger than 18?"
] | [
"SELECT Age FROM Student WHERE Fname = \"Derek\"",
"SELECT Age FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"",
"SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\" AND t3.age < 18"
] | How many members of club "Bootup Baltimore" are younger than 18? | SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.age < 18 | club_1 |
[
"Tell me first names of the students living in the city with city code \"LON\"",
"How about that of city with city code \"BAL\"",
"Tell me the names of all the clubs that have at least a member from the city with city code \"BAL\"."
] | [
"SELECT Fname FROM Student WHERE city_code = \"LON\"",
"SELECT Fname FROM Student WHERE city_code = \"BAL\"",
"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"BAL\""
] | Find the names of all the clubs that have at least a member from the city with city code "BAL". | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = "BAL" | club_1 |
[
"Tell me the location of the club \"Bootup Baltimore\".",
"Tell me the city code of the cities where at least a member of that club live in.",
"What are the names of the clubs that have at least a member from the city with the city code \"HOU\"?"
] | [
"SELECT ClubLocation FROM Club WHERE ClubName = \"Bootup Baltimore\"",
"SELECT t3.city_code FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.ClubName = \"Bootup Baltimore\"",
"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = \"HOU\""
] | Find the names of the clubs that have at least a member from the city with city code "HOU". | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.city_code = "HOU" | club_1 |
[
"Tell me the age of the student named \"Eric Tai\".",
"How about his advisor?",
"How many clubs does the student named \"Eric Tai\" belong to?"
] | [
"SELECT Age FROM Student WHERE Fname = \"Eric\" AND LName = \"Tai\"",
"SELECT Advisor FROM Student WHERE Fname = \"Eric\" AND LName = \"Tai\"",
"SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Eric\" AND t3.lname = \"Tai\""
] | How many clubs does the student named "Eric Tai" belong to? | SELECT count(DISTINCT t1.clubname) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Eric" AND t3.lname = "Tai" | club_1 |
[
"Tell me the city code of the city where \"Davis Steven\" lives.",
"What is his major?",
"Tell me the clubs having \"Davis Steven\" as a member."
] | [
"SELECT city_code FROM Student WHERE Lname = \"Davis\" AND FName = \"Steven\"",
"SELECT Major FROM Student WHERE Lname = \"Davis\" AND FName = \"Steven\"",
"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = \"Davis\" AND t3.lname = \"Steven\""
] | List the clubs having "Davis Steven" as a member. | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Davis" AND t3.lname = "Steven" | club_1 |
[
"What is the student id of the student with first name \"Arthur\"?",
"Who is his advisor?",
"Tell me the clubs that have at least a member with advisor \"1121\"."
] | [
"SELECT StuID FROM Student WHERE Fname = \"Arthur\"",
"SELECT Advisor FROM Student WHERE Fname = \"Arthur\"",
"SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121"
] | List the clubs that have at least a member with advisor "1121". | SELECT DISTINCT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.advisor = 1121 | club_1 |
[
"Tell me the age of the members of the club \"Tennis Club\".",
"How about that of the club \"Bootup Baltimore\"?",
"Can you show me the average number?"
] | [
"SELECT t3.age FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Tennis Club\"",
"SELECT t3.age FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\"",
"SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Bootup Baltimore\""
] | What is the average age of the members of the club "Bootup Baltimore"? | SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" | club_1 |
[
"Tell me the number of females in club \"Hopkins Student Enterprises\".",
"How about that of the members with age > 18?",
"I want to know the average age of members in that club."
] | [
"SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" and t3.Sex = \"F\"",
"SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\" and t3.Age > 18",
"SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = \"Hopkins Student Enterprises\""
] | Find the average age of members of the club "Hopkins Student Enterprises". | SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" | club_1 |
[
"How many churches are there?",
"What if we only count those opened before 1850?"
] | [
"SELECT count(*) FROM Church",
"SELECT count(*) FROM Church WHERE Open_Date < 1850"
] | How many churches opened before 1850 are there? | SELECT count(*) FROM Church WHERE Open_Date < 1850 | wedding |
[
"Show all churches.",
"Give me their name, open data, and organizer."
] | [
"SELECT * FROM Church",
"SELECT name , open_date , organized_by FROM Church"
] | Show the name, open date, and organizer for all churches. | SELECT name , open_date , organized_by FROM Church | wedding |
[
"Show all churches.",
"Sort them in descending order of opening date.",
"Show the church names."
] | [
"SELECT * FROM Church",
"SELECT * FROM church ORDER BY open_date DESC",
"SELECT name FROM church ORDER BY open_date DESC"
] | List all church names in descending order of opening date. | SELECT name FROM church ORDER BY open_date DESC | wedding |
[
"What is the opening date of each church?",
"Show the opening year in which at least two churches opened."
] | [
"SELECT open_date FROM church",
"SELECT open_date FROM church GROUP BY open_date HAVING count(*) >= 2"
] | Show the opening year in which at least two churches opened. | SELECT open_date FROM church GROUP BY open_date HAVING count(*) >= 2 | wedding |
[
"Which churches opened between 1830 and 1840?",
"Show their names and organizers."
] | [
"SELECT * FROM church WHERE open_date BETWEEN 1830 AND 1840",
"SELECT organized_by , name FROM church WHERE open_date BETWEEN 1830 AND 1840"
] | Show the organizer and name for churches that opened between 1830 and 1840. | SELECT organized_by , name FROM church WHERE open_date BETWEEN 1830 AND 1840 | wedding |
[
"What is the opening year of each church?",
"Show all opening years and the number of churches that opened in that year."
] | [
"SELECT open_date FROM church",
"SELECT open_date , count(*) FROM church GROUP BY open_date"
] | Show all opening years and the number of churches that opened in that year. | SELECT open_date , count(*) FROM church GROUP BY open_date | wedding |
[
"What is the opening date of each church?",
"Which churches opened most recently?",
"Show the name and opening year for three churches that opened most recently."
] | [
"SELECT open_date FROM church",
"SELECT * FROM church ORDER BY open_date DESC LIMIT 1",
"SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3"
] | Show the name and opening year for three churches that opened most recently. | SELECT name , open_date FROM church ORDER BY open_date DESC LIMIT 3 | wedding |
[
"Count the number of people in the record.",
"How many are female?",
"How many of them are older than 30?"
] | [
"SELECT count(*) FROM people",
"SELECT count(*) FROM people WHERE is_male = 'F'",
"SELECT count(*) FROM people WHERE is_male = 'F' AND age > 30"
] | How many female people are older than 30 in our record? | SELECT count(*) FROM people WHERE is_male = 'F' AND age > 30 | wedding |
[
"Show all people whose age is below 25.",
"What are their countries?",
"Which of these countries also have people older than 30?"
] | [
"SELECT * FROM people WHERE age < 25",
"SELECT country FROM people WHERE age < 25",
"SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30"
] | Show the country where people older than 30 and younger than 25 are from. | SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30 | wedding |
[
"What is the age of each person?",
"What is the average age?",
"What are the minimum, maximum, and average age?"
] | [
"SELECT age FROM people",
"SELECT min(age) FROM people",
"SELECT min(age) , max(age) , avg(age) FROM people"
] | Show the minimum, maximum, and average age for all people. | SELECT min(age) , max(age) , avg(age) FROM people | wedding |
[
"What is the average age of people?",
"Show people whose age is smaller than the average.",
"What are their names and countries?"
] | [
"SELECT min(age) FROM people",
"SELECT * FROM people WHERE age < (SELECT avg(age) FROM people)",
"SELECT name , country FROM people WHERE age < (SELECT avg(age) FROM people)"
] | Show the name and country for all people whose age is smaller than the average. | SELECT name , country FROM people WHERE age < (SELECT avg(age) FROM people) | wedding |
[
"Show the information about weddings after year 2014.",
"Show the male names in all weddings after 2014.",
"Show the pair of male and female names in all weddings after year 2014."
] | [
"SELECT * FROM wedding WHERE year > 2014",
"SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id WHERE T1.year > 2014",
"SELECT T2.name , T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014"
] | Show the pair of male and female names in all weddings after year 2014 | SELECT T2.name , T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T1.year > 2014 | wedding |
[
"What are the ids of the males who had a wedding?",
"Show all the male people who have not had a wedding.",
"What are their names and ages?"
] | [
"SELECT male_id FROM wedding",
"SELECT * FROM people WHERE is_male = 'T' AND people_id NOT IN (SELECT male_id FROM wedding)",
"SELECT name , age FROM people WHERE is_male = 'T' AND people_id NOT IN (SELECT male_id FROM wedding)"
] | Show the name and age for all male people who don't have a wedding. | SELECT name , age FROM people WHERE is_male = 'T' AND people_id NOT IN (SELECT male_id FROM wedding) | wedding |
[
"Which churches had a wedding in year 2015?",
"Show all names of the churches except for those."
] | [
"SELECT * FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015",
"SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015"
] | Show all church names except for those that had a wedding in year 2015. | SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id WHERE T2.year = 2015 | wedding |
[
"How many weddings were hosted in each church?",
"Show all church names that have hosted least two weddings."
] | [
"SELECT count(*) FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id",
"SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING count(*) >= 2"
] | Show all church names that have hosted least two weddings. | SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id = T2.church_id GROUP BY T1.church_id HAVING count(*) >= 2 | wedding |
[
"Show all female people from Canada.",
"Show those that had a wedding in year 2016.",
"What are their names?"
] | [
"SELECT * FROM people WHERE is_male = 'F' AND country = 'Canada'",
"SELECT * FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada'",
"SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada'"
] | Show the names for all females from Canada having a wedding in year 2016. | SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id = T2.people_id WHERE T1.year = 2016 AND T2.is_male = 'F' AND T2.country = 'Canada' | wedding |
[
"How many weddings are there in total?",
"What about in the year 2016?"
] | [
"SELECT count(*) FROM wedding",
"SELECT count(*) FROM wedding WHERE YEAR = 2016"
] | How many weddings are there in year 2016? | SELECT count(*) FROM wedding WHERE YEAR = 2016 | wedding |
[
"Show all people older than 30.",
"Show all the weddings of people older than 30.",
"Show the church names for the weddings of all people older than 30."
] | [
"SELECT * FROM people WHERE age > 30",
"SELECT * FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id WHERE T2.age > 30 OR T3.age > 30",
"SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30"
] | Show the church names for the weddings of all people older than 30. | SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id = T2.people_id JOIN people AS T3 ON T1.female_id = T3.people_id JOIN church AS T4 ON T4.church_id = T1.church_id WHERE T2.age > 30 OR T3.age > 30 | wedding |
[
"Show the country of each person.",
"Count the number of people from each country.",
"Also show the country name."
] | [
"SELECT country FROM people",
"SELECT count(*) FROM people GROUP BY country",
"SELECT country , count(*) FROM people GROUP BY country"
] | Show all countries and the number of people from each country. | SELECT country , count(*) FROM people GROUP BY country | wedding |
[
"How many people are there?",
"How many people aged 40?",
"How many people aged either 35 or 36?",
"Please show their names."
] | [
"SELECT COUNT(*) FROM people",
"SELECT COUNT(*) FROM people WHERE Age = 40",
"SELECT COUNT(*) FROM people WHERE Age = 35 OR Age = 36",
"SELECT Name FROM people WHERE Age = 35 OR Age = 36"
] | Show the names of people aged either 35 or 36. | SELECT Name FROM people WHERE Age = 35 OR Age = 36 | debate |
[
"Who is the oldest person?",
"Who is the youngest person?",
"What is his party?"
] | [
"SELECT name FROM people ORDER BY Age DESC LIMIT 1",
"SELECT name FROM people ORDER BY Age ASC LIMIT 1",
"SELECT Party FROM people ORDER BY Age ASC LIMIT 1"
] | What is the party of the youngest people? | SELECT Party FROM people ORDER BY Age ASC LIMIT 1 | debate |
[
"How many parties are there?",
"How many people are there in each party?",
"Which party has the most people?"
] | [
"SELECT COUNT(DISTINCT Party) FROM people",
"SELECT Party, COUNT(*) FROM people GROUP BY Party",
"SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1"
] | Show the party that has the most people. | SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1 | debate |
[
"How many people have been on the negative side?",
"How about the affirmative side?",
"Please give their full names.",
"Please also show the dates and venues of debates."
] | [
"SELECT COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID",
"SELECT COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID",
"SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID",
"SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID"
] | Show the names of people, and dates and venues of debates they are on the affirmative side. | SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID | debate |
[
"Show the names of people that won the debate on the nagative side.",
"Please list the names of people who have been on the negative side.",
"Please also show the dates and venues of debates",
"Could you please order the results in ascending alphabetical order of name?"
] | [
"SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID WHERE If_Affirmative_Win = \"F\"",
"SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID",
"SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID",
"SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name ASC"
] | Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name. | SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID ORDER BY T3.Name ASC | debate |
[
"How many people have ever been on the affirmative side of debates?",
"What is the average size of the audience in a debate?",
"How many debates have an audience size bigger than 200?",
"Show the names of people that are on the affirmative side of these debates."
] | [
"SELECT COUNT(*) FROM people WHERE People_id IN (SELECT Affirmative FROM debate_people)",
"SELECT AVG(Num_of_Audience) FROM debate",
"SELECT COUNT(*) FROM debate WHERE Num_of_Audience > 200",
"SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200"
] | Show the names of people that are on affirmative side of debates with number of audience bigger than 200. | SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID WHERE T2.Num_of_Audience > 200 | debate |
[
"How many people have ever been on the affirmative side of debates?",
"Please show their names.",
"Please also show the number of times they have been on the affirmative side of debates."
] | [
"SELECT COUNT(*) FROM people WHERE People_id IN (SELECT Affirmative FROM debate_people)",
"SELECT name FROM people WHERE People_id IN (SELECT Affirmative FROM debate_people)",
"SELECT T2.Name , COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name"
] | Show the names of people and the number of times they have been on the affirmative side of debates. | SELECT T2.Name , COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative = T2.People_ID GROUP BY T2.Name | debate |
[
"How many people have ever been on the negative side of debates?",
"How many times have they been on the negative side of debates?",
"How many of them have been on the negative side of debates at least twice?",
"Show their names."
] | [
"SELECT COUNT(DISTINCT T2.People_ID) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID",
"SELECT T2.Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name",
"SELECT COUNT(DISTINCT T2.Name) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2",
"SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2"
] | Show the names of people who have been on the negative side of debates at least twice. | SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative = T2.People_ID GROUP BY T2.Name HAVING COUNT(*) >= 2 | debate |
[
"Show me all the companies.",
"Which of these companies operate flights?",
"Which companies operated flights with velocity less than 200?",
"What are the distinct types of these companies?"
] | [
"SELECT name FROM operate_company",
"SELECT DISTINCT name FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id",
"SELECT DISTINCT name FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id WHERE t2.velocity < 200",
"SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200"
] | What are the distinct types of the companies that have operated any flights with velocity less than 200? | SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200 | flight_company |
[
"List the names of all the companies.",
"How many flights did each of these companies operate?",
"Show me only the companies that operated more than one flight.",
"Show me only the ids and the names of these companies."
] | [
"SELECT name FROM operate_company",
"SELECT t1.name, count(*) FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id GROUP BY t1.id",
"SELECT t1.name, count(*) FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id GROUP BY t1.id HAVING count(*) > 1",
"SELECT T1.id , T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING count(*) > 1"
] | What are the ids and names of the companies that operated more than one flight? | SELECT T1.id , T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING count(*) > 1 | flight_company |
[
"Show me the names of all the airports",
"What are the number of flights for each of these airports?",
"Which airport had the most number of flights?",
"Show me the id and IATA code of this airport as well."
] | [
"SELECT name FROM airport",
"SELECT name, count(*) FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id",
"SELECT t1.name FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1",
"SELECT T1.id, T1.name, T1.IATA FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1"
] | What is the id, name and IATA code of the airport that had most number of flights? | SELECT T1.id, T1.name, T1.IATA FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1 | flight_company |
[
"Show me the names of all the pilots.",
"Which of these pilots piloted a flight in the United States?",
"What about the pilots who did it at 'Billund Airport'?",
"Which pilots did either one of those?"
] | [
"SELECT DISTINCT pilot FROM flight",
"SELECT DISTINCT t2.pilot FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id WHERE t1.Country = \"United States\"",
"SELECT DISTINCT t2.pilot FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id WHERE t1.name = \"Billund Airport\"",
"SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport'"
] | What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'? | SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport' | flight_company |
[
"Show me all the company names.",
"What are the types of these companies?",
"How many companies have type 'Joint Venture'?",
"Tell me the most common company type."
] | [
"SELECT name FROM operate_company",
"SELECT name, type FROM operate_company",
"SELECT count(*) FROM operate_company GROUP BY type HAVING type = 'Joint Venture'",
"SELECT TYPE , count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1"
] | What is the most common company type, and how many are there? | SELECT TYPE , count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1 | flight_company |
[
"List the names of all the pilots.",
"Which companies did Thompson fly for?",
"List all the airports where he drove an aircraft.",
"What is the total number of airports where he has not driven an aircraft?"
] | [
"SELECT DISTINCT pilot FROM flight",
"SELECT DISTINCT t2.name FROM flight as t1 join operate_company AS t2 ON t1.company_id = t2.id AND t1.pilot = 'Thompson'",
"SELECT DISTINCT t2.name FROM flight as t1 join airport AS t2 ON t1.airport_id = t2.id AND t1.pilot = 'Thompson'",
"SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' );"
] | How many airports haven't the pilot 'Thompson' driven an aircraft? | SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot = 'Thompson' ); | flight_company |
[
"Show me the names of all the pilots",
"Which of these pilots flied for a company that runs 'Cargo' activities?",
"Which pilots flied for a company that runs 'Catering services' activities?",
"Which pilots flied for companies that ran both of those activities?"
] | [
"SELECT pilot FROM flight",
"SELECT * FROM flight as t1 join operate_company AS t2 ON t1.company_id = t2.id WHERE principal_activities = 'Cargo'",
"SELECT * FROM flight as t1 join operate_company AS t2 ON t1.company_id = t2.id WHERE principal_activities = 'Catering services'",
"SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services'"
] | List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities. | SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services' | flight_company |
[
"Show me all the airports.",
"Show me the names of all airports.",
"Which of these airports start with the word 'international'?",
"What about the ones that contains the word \"international\"?"
] | [
"SELECT * FROM airport",
"SELECT name FROM airport",
"SELECT name FROM airport WHERE name LIKE \"international%\"",
"SELECT name FROM airport WHERE name LIKE '%international%'"
] | Which of the airport names contains the word 'international'? | SELECT name FROM airport WHERE name LIKE '%international%' | flight_company |
[
"Tell me about all the airports.",
"Tell me the names of these airports.",
"How many companies operate in \"Akureyi airport\"?",
"What about for each airport?"
] | [
"SELECT * FROM airport",
"SELECT name FROM airport",
"SELECT count(t2.company_id) FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id HAVING t1.name = \"Akureyri Airport\"",
"SELECT T3.id , count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id"
] | How many companies operates airlines in each airport? | SELECT T3.id , count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id | flight_company |
[
"Show me everything about the airports.",
"What are the countries with these airports?",
"Which of these countries have more than 1 airport?",
"Which of them have more than 2?"
] | [
"SELECT * FROM airport",
"SELECT distinct country FROM airport",
"SELECT country FROM airport GROUP BY country HAVING count(*) > 1",
"SELECT country FROM airport GROUP BY country HAVING count(*) > 2"
] | which countries have more than 2 airports? | SELECT country FROM airport GROUP BY country HAVING count(*) > 2 | flight_company |
[
"What is all the information about the counties?",
"How many are there?"
] | [
"SELECT * FROM county",
"SELECT count(*) FROM county"
] | How many counties are there in total? | SELECT count(*) FROM county | election |
[
"Show me all the information about counties.",
"I want to now the names of these counties.",
"I also want to know their population."
] | [
"SELECT * FROM county",
"SELECT County_name FROM county",
"SELECT Population FROM county"
] | Show the county name and population of all counties. | SELECT County_name , Population FROM county | election |
[
"Show me all the information about counties.",
"I also want to know their population.",
"Tell me the average number."
] | [
"SELECT * FROM county",
"SELECT Population FROM county",
"SELECT avg(Population) FROM county"
] | Show the average population of all counties. | SELECT avg(Population) FROM county | election |
[
"Please show me the information of population about all counties.",
"What's the maximum one?",
"I want to know the minimum one."
] | [
"SELECT Population FROM county",
"SELECT max(Population) FROM county",
"SELECT min(Population) FROM county"
] | Return the maximum and minimum population among all counties. | SELECT max(Population) , min(Population) FROM county | election |
[
"Please tell me all the information about elections.",
"I only want to know the districts.",
"Give me the unique ones."
] | [
"SELECT * FROM election",
"SELECT District FROM election",
"SELECT DISTINCT District FROM election"
] | Show all the distinct districts for elections. | SELECT DISTINCT District FROM election | election |
[
"Please tell me the information about all counties.",
"I want to know the county \"Howard\" specifically.",
"Just show me the zip code of that county?"
] | [
"SELECT * FROM county",
"SELECT * FROM county WHERE County_name = \"Howard\"",
"SELECT Zip_code FROM county WHERE County_name = \"Howard\""
] | Show the zip code of the county with name "Howard". | SELECT Zip_code FROM county WHERE County_name = "Howard" | election |
[
"Please tell me the information about elections.",
"Just give me the information about delegates.",
"How about the one from district 1?"
] | [
"SELECT * FROM election",
"SELECT Delegate FROM election",
"SELECT Delegate FROM election WHERE District = 1"
] | Show the delegate from district 1 in election. | SELECT Delegate FROM election WHERE District = 1 | election |
[
"Please tell me all the information about elections.",
"Just give me the information about delegate",
"I also want to know the committees."
] | [
"SELECT * FROM election",
"SELECT Delegate FROM election",
"SELECT Delegate , Committee FROM election"
] | Show the delegate and committee information of elections. | SELECT Delegate , Committee FROM election | election |
[
"Tell me the information about all parties",
"Who are the governors of those parties",
"Just give me the distinct results.",
"Give the number of those governors."
] | [
"SELECT * FROM party",
"SELECT Governor FROM party",
"SELECT DISTINCT Governor FROM party",
"SELECT count(DISTINCT Governor) FROM party"
] | How many distinct governors are there? | SELECT count(DISTINCT Governor) FROM party | election |
[
"Tell me the information about all parties",
"I want to know the information about the Democratic party specifically.",
"Who is their lieutenant governor?",
"Tell me the comptroller of that party."
] | [
"SELECT * FROM party",
"SELECT * FROM party WHERE Party = \"Democratic\"",
"SELECT Lieutenant_Governor FROM party WHERE Party = \"Democratic\"",
"SELECT Comptroller FROM party WHERE Party = \"Democratic\""
] | Show the lieutenant governor and comptroller from the democratic party. | SELECT Lieutenant_Governor , Comptroller FROM party WHERE Party = "Democratic" | election |
[
"Tell me all the information about parties whose governor is Eliot Spitzer.",
"I want to know the years in which he was the governor.",
"Excellent. Just tell me the distinct ones."
] | [
"SELECT * FROM party WHERE Governor = \"Eliot Spitzer\"",
"SELECT YEAR FROM party WHERE Governor = \"Eliot Spitzer\"",
"SELECT DISTINCT YEAR FROM party WHERE Governor = \"Eliot Spitzer\""
] | In which distinct years was the governor "Eliot Spitzer"? | SELECT DISTINCT YEAR FROM party WHERE Governor = "Eliot Spitzer" | election |
[
"Please tell me all the information about elections."
] | [
"SELECT * FROM election"
] | Show all the information about election. | SELECT * FROM election | election |
[
"Tell me all the names of the counties.",
"I want to know their delegates including their names."
] | [
"SELECT County_name FROM county",
"SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District"
] | Show the delegates and the names of county they belong to. | SELECT T2.Delegate , T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District | election |
[
"Tell me all the names of the counties.",
"Okay. I want to know their delegates.",
"Furthermore, please tell me which ones' population is smaller than 100000?"
] | [
"SELECT County_name FROM county",
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District",
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000"
] | Which delegates are from counties with population smaller than 100000? | SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population < 100000 | election |
[
"Tell me all the names of the counties.",
"Okay. I want to know their delegates.",
"Furthermore, please tell me which ones' population is larger than 50000?",
"Wonderful! How many unique ones are there?"
] | [
"SELECT County_name FROM county",
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District",
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000",
"SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000"
] | How many distinct delegates are from counties with population larger than 50000? | SELECT count(DISTINCT T2.Delegate) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.Population > 50000 | election |
[
"Tell me all the names of the counties.",
"Okay. I want to know their delegates.",
"Which one's committee is \"Appropriations\"?"
] | [
"SELECT County_name FROM county",
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District",
"SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = \"Appropriations\""
] | What are the names of the county that the delegates on "Appropriations" committee belong to? | SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T2.Committee = "Appropriations" | election |
[
"Tell me all the information about the democratic party.",
"Okay. I want to know all the party delegates and names."
] | [
"SELECT * FROM party WHERE Party = \"Democratic\"",
"SELECT T1.Delegate , T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID"
] | Show the delegates and the names of the party they belong to. | SELECT T1.Delegate , T2.Party FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID | election |
[
"I want to know the governor of the liberal party.",
"Which one's delegate is from district 1.",
"Who is its governor?"
] | [
"SELECT Governor FROM party WHERE Party = \"Liberal\"",
"SELECT * FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1",
"SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1"
] | Who were the governors of the parties associated with delegates from district 1? | SELECT T2.Governor FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 | election |
[
"Tell me all the parties.",
"Which one's delegates are from district 1 or district 2?",
"Who were these parties' comptrollers?"
] | [
"SELECT * FROM party",
"SELECT * FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2",
"SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2"
] | Who were the comptrollers of the parties associated with the delegates from district 1 or district 2? | SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 | election |
[
"Tell me the delegates from committees Appropriations?",
"which ones have delegates from Democratic party."
] | [
"SELECT Delegate FROM election WHERE Committee = \"Appropriations\"",
"SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = \"Democratic\""
] | Return all the committees that have delegates from Democratic party. | SELECT T1.Committee FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" | election |
[
"Tell me all the information about the counties.",
"For now, I just want to know these counties' names.",
"I also want to know the number of delegates of these counties"
] | [
"SELECT * FROM county",
"SELECT County_name FROM county",
"SELECT T1.County_name , COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id"
] | Show the name of each county along with the corresponding number of delegates from that county. | SELECT T1.County_name , COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id | election |
[
"Tell me all the information about the counties.",
"For now, I just want to know the parties.",
"I also want to know the number of delegates of these parties."
] | [
"SELECT * FROM county",
"SELECT DISTINCT T1.County_name, T3.Party FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District JOIN party AS T3 ON T2.Party = T3.Party_ID",
"SELECT T2.Party , COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party"
] | Show the name of each party and the corresponding number of delegates from that party. | SELECT T2.Party , COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T1.Party | election |
[
"tell me the population of the county named Howard?",
"I want to know all the counties' names.",
"Sort them in ascending order by population."
] | [
"SELECT Population FROM county WHERE County_name = \"Howard\"",
"SELECT County_name FROM county",
"SELECT County_name FROM county ORDER BY Population ASC"
] | Return the names of all counties sorted by population in ascending order. | SELECT County_name FROM county ORDER BY Population ASC | election |
[
"Tell me the county with zip code D21.",
"Okay. I want to know all the names of the counties.",
"Sort them in descending alphabetical order."
] | [
"SELECT County_name FROM county WHERE Zip_code = \"D21\"",
"SELECT County_name FROM county",
"SELECT County_name FROM county ORDER BY County_name DESC"
] | Return the names of all counties sorted by county name in descending alphabetical order. | SELECT County_name FROM county ORDER BY County_name DESC | election |
[
"Tell me the population of the county named Colony.",
"How about the one named Mansfield?",
"Just show me which county has the biggest population."
] | [
"SELECT Population FROM county WHERE County_name = \"Colony\"",
"SELECT Population FROM county WHERE County_name = \"Mansfield\"",
"SELECT County_name FROM county ORDER BY Population DESC LIMIT 1"
] | Show the name of the county with the biggest population. | SELECT County_name FROM county ORDER BY Population DESC LIMIT 1 | election |
[
"Tell me the population of the county named Colony.",
"How about Mansfield's",
"just show me 3 ones which have the smallest population."
] | [
"SELECT Population FROM county WHERE County_name = \"Colony\"",
"SELECT Population FROM county WHERE County_name = \"Mansfield\"",
"SELECT County_name FROM county ORDER BY Population ASC LIMIT 3"
] | Show the 3 counties with the smallest population. | SELECT County_name FROM county ORDER BY Population ASC LIMIT 3 | election |
[
"Tell me the delegates of the county named Howard.",
"How about its committees?",
"just show me the counties which have at least two delegates."
] | [
"SELECT T2.Delegate FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.County_name = \"Howard\"",
"SELECT T2.Committee FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District WHERE T1.County_name = \"Howard\"",
"SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2"
] | Show the names of counties that have at least two delegates. | SELECT T1.County_name FROM county AS T1 JOIN election AS T2 ON T1.County_id = T2.District GROUP BY T1.County_id HAVING COUNT(*) >= 2 | election |
[
"Tell me the information of all the parties.",
"I just want to know their names.",
"just show me the ones which have at least two records."
] | [
"SELECT * FROM party",
"SELECT Party FROM party",
"SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2"
] | Show the name of the party that has at least two records. | SELECT Party FROM party GROUP BY Party HAVING COUNT(*) >= 2 | election |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.