Datasets:
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 |
---|---|---|---|---|
[
"What is the number of employees in each department?",
"Which department has the most employees? Give me the department name."
] | [
"SELECT count(departmentID) FROM department GROUP BY departmentID",
"SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;"
] | Find the department with the most employees. | SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1; | hospital_1 |
[
"How many employees does each department have?",
"Which department has the least employees?",
"Who is the head of this department? Find the employee id."
] | [
"SELECT count(departmentID) FROM department GROUP BY departmentID",
"SELECT * FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;",
"SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;"
] | Tell me the employee id of the head of the department with the least employees. | SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1; | hospital_1 |
[
"How many employees does each department have?",
"Which department has the smallest number of employees?",
"Tell me the name and position of the head of this department."
] | [
"SELECT count(departmentID) FROM department GROUP BY departmentID",
"SELECT * FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;",
"SELECT T2.name , T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;"
] | Find the name and position of the head of the department with the least employees. | SELECT T2.name , T2.position FROM department AS T1 JOIN physician AS T2 ON T1.head = T2.EmployeeID GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1; | hospital_1 |
[
"List the patient id for all the appointments.",
"What are the names of patients who have made appointments?"
] | [
"SELECT patient FROM appointment",
"SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn"
] | List the names of patients who have made appointments. | SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn | hospital_1 |
[
"Find the number of appointments each patient has made.",
"Which patients made more than one appointment?",
"Tell me the name and phone number of these patients"
] | [
"SELECT count(*) FROM appointment GROUP BY patient",
"SELECT * FROM appointment GROUP BY patient HAVING count(*) > 1",
"SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count(*) > 1"
] | Which patients made more than one appointment? Tell me the name and phone number of these patients. | SELECT name , phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient = T2.ssn GROUP BY T1.patient HAVING count(*) > 1 | hospital_1 |
[
"What is the start date of each appointment?",
"Sort the appointments by the starting date in descending order.",
"Which appointment has the most recent starting date? Give me the appointment id."
] | [
"SELECT START FROM appointment",
"SELECT * FROM appointment ORDER BY START DESC",
"SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1"
] | What is the id of the appointment that started most recently? | SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1 | hospital_1 |
[
"What are the ids of the physicians who took appointments?",
"Also tell me their names."
] | [
"SELECT Physician FROM appointment",
"SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID"
] | What are the names of all the physicians who took appointments. | SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | hospital_1 |
[
"List all the physician names.",
"Find the names of the physicians who took appointments.",
"Then what are the names of physicians who never took any appointment?"
] | [
"SELECT name FROM physician",
"SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID",
"SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID"
] | Which physicians have never taken any appointment? Find their names. | SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician = T2.EmployeeID | hospital_1 |
[
"List the name of each physician.",
"Find the name of the primarily affiliated department for each physician.",
"Return both information together."
] | [
"SELECT name FROM physician",
"SELECT T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1",
"SELECT T1.name , T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1"
] | What are the name and primarily affiliated department name of each physician? | SELECT T1.name , T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID = T2.physician JOIN department AS T3 ON T2.department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 | hospital_1 |
[
"Sort all the appointments by the start date from recent to past.",
"Which appointment has the most recent start date?",
"Find the name of the patient who made that appointment."
] | [
"SELECT * FROM appointment ORDER BY START DESC",
"SELECT * FROM appointment ORDER BY START DESC LIMIT 1",
"SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 WHERE T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1"
] | Find the name of the patient who made the appointment with the most recent start date. | SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 WHERE T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1 | hospital_1 |
[
"Find all the stays in room 112.",
"How many patients stayed in room 112?"
] | [
"SELECT * FROM stay WHERE room = 112",
"SELECT count(patient) FROM stay WHERE room = 112"
] | Count the number of patients who stayed in room 112. | SELECT count(patient) FROM stay WHERE room = 112 | hospital_1 |
[
"What is the employee id of physician John Dorian?",
"Find all the prescriptions made by him.",
"How many patients' prescriptions are made by him?"
] | [
"SELECT employeeid FROM physician WHERE name = \"John Dorian\"",
"SELECT * FROM prescribes AS T1 JOIN physician AS T2 ON T1.physician = T2.employeeid WHERE T2.name = \"John Dorian\"",
"SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = \"John Dorian\""
] | Find the number of patients' prescriptions physician John Dorian made. | SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = "John Dorian" | hospital_1 |
[
"Which patient is staying in room 111? Tell me the patient id.",
"What is the id of the medication used for this patient?",
"What is the name of the medication?"
] | [
"SELECT patient FROM stay WHERE room = 111",
"SELECT T3.Medication FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN WHERE room = 111",
"SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111"
] | What is the name of the medication used for the patient staying in room 111? | SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient = T2.SSN JOIN Prescribes AS T3 ON T3.Patient = T2.SSN JOIN Medication AS T4 ON T3.Medication = T4.Code WHERE room = 111 | hospital_1 |
[
"Find the patients who stayed in room 111.",
"Sort the patients by the stay start date, from recent to past.",
"Which patient stayed there most recently?"
] | [
"SELECT patient FROM stay WHERE room = 111",
"SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC",
"SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1"
] | What is the id of the patient who stayed in room 111 most recently? | SELECT patient FROM stay WHERE room = 111 ORDER BY staystart DESC LIMIT 1 | hospital_1 |
[
"How many appointments does each nurse have?",
"Find the nurse with the most appointments. What is the nurse's name?"
] | [
"SELECT count(*) FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid",
"SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1"
] | Find the name of the nurse who has the largest number of appointments. | SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid = T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1 | hospital_1 |
[
"Group the patients by the physician treating them.",
"How many patients is each physician taking care of?",
"For each physician, return his or her name and the number of patients."
] | [
"SELECT * FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid",
"SELECT count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid",
"SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid"
] | Return the name of each physician and the number of patients he or she treats. | SELECT T1.name , count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid | hospital_1 |
[
"How many patients is each physician in change of?",
"Which physicians are in charge of more than one?",
"What are the name of these physicians?"
] | [
"SELECT count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid",
"SELECT * FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING count(*) > 1",
"SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING count(*) > 1"
] | Which physicians are in charge of more than one patient? Give me their names. | SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid = T2.PCP GROUP BY T1.employeeid HAVING count(*) > 1 | hospital_1 |
[
"What is the block floor each room is located on?",
"How many rooms does each block floor have?"
] | [
"SELECT T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode",
"SELECT count(*) , T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor"
] | How many rooms does each block floor have? | SELECT count(*) , T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor | hospital_1 |
[
"What is each room's block code?",
"How many rooms does each block code have?"
] | [
"SELECT T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode",
"SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode"
] | How many rooms are located for each block code? | SELECT count(*) , T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockcode | hospital_1 |
[
"List all the rooms that are available.",
"What are the distinct block codes that have rooms available?"
] | [
"SELECT * FROM room WHERE unavailable = 0",
"SELECT DISTINCT blockcode FROM room WHERE unavailable = 0"
] | Tell me the distinct block codes where some rooms are available. | SELECT DISTINCT blockcode FROM room WHERE unavailable = 0 | hospital_1 |
[
"List all the room types.",
"How many distinct room types are there?"
] | [
"SELECT roomtype FROM room",
"SELECT count(DISTINCT roomtype) FROM room"
] | Find the number of distinct room types available. | SELECT count(DISTINCT roomtype) FROM room | hospital_1 |
[
"What is the code of the medication called Thesisin?",
"Which physicians prescribe this medication? Tell me the distinct ids.",
"What are the names of the physicians?"
] | [
"SELECT code FROM medication WHERE name = \"Thesisin\"",
"SELECT DISTINCT T1.physician FROM prescribes AS T1 JOIN medication AS T2 ON T2.code = T1.medication WHERE T2.name = \"Thesisin\"",
"SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = \"Thesisin\""
] | List the names of all the physicians who prescribe Thesisin as medication. | SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = "Thesisin" | hospital_1 |
[
"Which medication has brand X?",
"Find the physicians who prescribe this medication.",
"What are their name and position?"
] | [
"SELECT * FROM medication WHERE Brand = \"X\"",
"SELECT DISTINCT T1.physician FROM prescribes AS T1 JOIN medication AS T2 ON T2.code = T1.medication WHERE T2.Brand = \"X\"",
"SELECT DISTINCT T1.name , T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = \"X\""
] | Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians. | SELECT DISTINCT T1.name , T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand = "X" | hospital_1 |
[
"Group all the medications by the brand.",
"How many medications are prescribed for each brand?"
] | [
"SELECT * FROM medication GROUP BY brand",
"SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand"
] | How many medications are prescribed for each brand? | SELECT count(*) , T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand | hospital_1 |
[
"Find the position title of each physician.",
"Which physicians have 'senior' in their titles?",
"Give me their names"
] | [
"SELECT POSITION FROM physician",
"SELECT * FROM physician WHERE POSITION LIKE '%senior%'",
"SELECT name FROM physician WHERE POSITION LIKE '%senior%'"
] | What are the names of the physicians who have 'senior' in their titles. | SELECT name FROM physician WHERE POSITION LIKE '%senior%' | hospital_1 |
[
"List the dates of treatment undergoing.",
"What is the most recent undergoing treatment?",
"What is the patient of this treatment?"
] | [
"SELECT dateundergoes FROM undergoes",
"SELECT * FROM undergoes ORDER BY dateundergoes LIMIT 1",
"SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1"
] | Which patient is undergoing the most recent treatment? | SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1 | hospital_1 |
[
"List all the patients who have an undergoing treatment.",
"Among them, who are staying in room 111?",
"What are their names?"
] | [
"SELECT DISTINCT patient FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN",
"SELECT * FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111",
"SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111"
] | What are the names of patients who are staying in room 111 and have an undergoing treatment? | SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111 | hospital_1 |
[
"List the distinct names of all the nurses",
"Order them in the alphabetical order."
] | [
"SELECT DISTINCT name FROM nurse",
"SELECT DISTINCT name FROM nurse ORDER BY name"
] | What is the alphabetically ordered list of all the distinct names of nurses? | SELECT DISTINCT name FROM nurse ORDER BY name | hospital_1 |
[
"Find the nurses in charge of undergoing treatments.",
"What are the distinct names of the nurses?"
] | [
"SELECT AssistingNurse FROM undergoes",
"SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID"
] | Which nurses are in charge of patients undergoing treatments? | SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID | hospital_1 |
[
"What are the distinct names of medications?",
"Sort them in an alphabetical order"
] | [
"SELECT DISTINCT name FROM medication",
"SELECT DISTINCT name FROM medication ORDER BY name"
] | What is the alphabetically ordered list of all distinct medications? | SELECT DISTINCT name FROM medication ORDER BY name | hospital_1 |
[
"What is the list of the dose each physician prescribes?",
"Sort in the descending order of dose.",
"What are the names of the physician who prescribed the highest dose?"
] | [
"SELECT * FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician",
"SELECT * FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC",
"SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1"
] | Find the physician who prescribed the highest dose. What is his or her name? | SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1 | hospital_1 |
[
"Which departments have some physicians primarily affiliated.",
"What are the distinct names of the departments?"
] | [
"SELECT * FROM affiliated_with WHERE PrimaryAffiliation = 1",
"SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1"
] | What are the names of departments that have primarily affiliated physicians. | SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1 | hospital_1 |
[
"What information do you have on video games?",
"How many of them are there?"
] | [
"SELECT * FROM Video_games",
"SELECT count(*) FROM Video_games"
] | How many video games do you have? | SELECT count(*) FROM Video_games | game_1 |
[
"What are the game types for each video game?",
"Give me a list of the different game types?",
"How long is that list?"
] | [
"SELECT gtype FROM Video_games",
"SELECT DISTINCT gtype FROM Video_games",
"SELECT count(DISTINCT gtype) FROM Video_games"
] | What is the count of different game types? | SELECT count(DISTINCT gtype) FROM Video_games | game_1 |
[
"What is the type of each game?",
"What is a list of the different types?"
] | [
"SELECT gtype FROM Video_games",
"SELECT DISTINCT gtype FROM Video_games"
] | What are the different types of video games? | SELECT DISTINCT gtype FROM Video_games | game_1 |
[
"What is the type of each video game?",
"Also, what are their names?",
"Order the above information by the game name alphabetically."
] | [
"SELECT gtype FROM Video_games",
"SELECT gname , gtype FROM Video_games",
"SELECT gname , gtype FROM Video_games ORDER BY gname"
] | What are the names of all the video games and their types in alphabetical order? | SELECT gname , gtype FROM Video_games ORDER BY gname | game_1 |
[
"What information is there on video games?",
"What information do you have on video games that are of type collectible card game?",
"What are their names?"
] | [
"SELECT * FROM Video_games",
"SELECT * FROM Video_games WHERE gtype = \"collectible card game\"",
"SELECT gname FROM Video_games WHERE gtype = \"collectible card game\""
] | What are the names of all video games that are collectible cards? | SELECT gname FROM Video_games WHERE gtype = "Collectible card game" | game_1 |
[
"What is the name of each game?",
"What information do you have on the game called Call of Destiny?",
"What type is it?"
] | [
"SELECT gname FROM Video_games",
"SELECT * FROM Video_games WHERE gname = \"Call of Destiny\"",
"SELECT gtype FROM Video_games WHERE gname = \"Call of Destiny\""
] | What type of game is Call of Destiny? | SELECT gtype FROM Video_games WHERE gname = "Call of Destiny" | game_1 |
[] | [] | Count the number of video games with Massively multiplayer online game type . | SELECT count(*) FROM Video_games WHERE gtype = "Massively multiplayer online game" | game_1 |
[
"What are the different types of video games?",
"For each type, what information is there on the games?",
"How many games are there for each type?"
] | [
"SELECT gtype FROM Video_games",
"SELECT * FROM Video_games GROUP BY gtype",
"SELECT gtype , count(*) FROM Video_games GROUP BY gtype"
] | What are the types of video games and how many are in each type? | SELECT gtype , count(*) FROM Video_games GROUP BY gtype | game_1 |
[
"What are the game types?",
"Order the list of game types by number of games in descending order.",
"Which type has the most?"
] | [
"SELECT gtype FROM Video_games",
"SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC",
"SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1"
] | What type has the most games? | SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1 | game_1 |
[
"What are the different game types?",
"Order the list of game types by number of games in ascending order.",
"Which type has the most?"
] | [
"SELECT gtype FROM Video_games",
"SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*)",
"SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1"
] | What is the type with the fewest games? | SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1 | game_1 |
[
"What are the student ids?",
"Which of those are for students who live in the city with the code CHI?"
] | [
"SELECT StuID FROM Student",
"SELECT StuID FROM Student WHERE city_code = \"CHI\""
] | What are the ids of all students who live in CHI? | SELECT StuID FROM Student WHERE city_code = "CHI" | game_1 |
[
"What information do you have on the students?",
"What are their ids?",
"Which of those are for students who have advisor 1121?"
] | [
"SELECT * FROM Student",
"SELECT StuID FROM Student",
"SELECT StuID FROM Student WHERE Advisor = 1121"
] | What are the ids of all students who have advisor number 1121? | SELECT StuID FROM Student WHERE Advisor = 1121 | game_1 |
[
"List all student information",
"Which of that information is for students in the major numbered 600?",
"What are their first names?"
] | [
"SELECT * FROM Student",
"SELECT * FROM Student WHERE major = 600",
"SELECT Fname FROM Student WHERE major = 600"
] | What are the first names for all students who are from the major numbered 600? | SELECT Fname FROM Student WHERE Major = 600 | game_1 |
[
"What are the different majors?",
"For each of those, what is the average age?",
"Also, what is the minimum and maximum for each of those?"
] | [
"SELECT major FROM Student",
"SELECT avg(age) FROM Student GROUP BY major",
"SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major"
] | What are the average, minimum, and max ages for each of the different majors? | SELECT major , avg(age) , min(age) , max(age) FROM Student GROUP BY major | game_1 |
[
"What information do you have on each advisor?",
"What is the name for each advisor?",
"Which of those are for advisors who have more than 1 students?"
] | [
"SELECT * FROM Student GROUP BY advisor",
"SELECT advisor FROM STUDENT GROUP BY advisor",
"SELECT advisor FROM STUDENT GROUP BY advisor HAVING count(*) >= 2"
] | What are the advisors | SELECT advisor FROM Student GROUP BY advisor HAVING count(*) >= 2 | game_1 |
[
"What sport does every student play?",
"What is a list of the different types of sports?",
"How long is that list?"
] | [
"SELECT sportname FROM Sportsinfo",
"SELECT DISTINCT sportname FROM Sportsinfo",
"SELECT count(DISTINCT sportname) FROM Sportsinfo"
] | How many different types of sports do we offer? | SELECT count(DISTINCT sportname) FROM Sportsinfo | game_1 |
[
"What is the student id of every student involved in sports?",
"Delete any repeats.",
"How many different student ids are there?"
] | [
"SELECT StuID FROM Sportsinfo",
"SELECT DISTINCT StuID FROM Sportsinfo",
"SELECT count(DISTINCT StuID) FROM Sportsinfo"
] | How many different students are involved in sports? | SELECT count(DISTINCT StuID) FROM Sportsinfo | game_1 |
[
"What information is there on all sport players?",
"Which of those are on scholarship?",
"What are their student ids?"
] | [
"SELECT * FROM Sportsinfo",
"SELECT * FROM Sportsinfo WHERE onscholarship = 'Y'",
"SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'"
] | What are the ids for all sporty students who are on scholarship? | SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' | game_1 |
[
"What information is there on all students who play sports?",
"Which subset of this information is for students on scholarships?",
"What are their last names?"
] | [
"SELECT * FROM Sportsinfo",
"SELECT * FROM Sportsinfo WHERE onscholarship = 'Y'",
"SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y'"
] | What are the last names for all scholarship students? | SELECT T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.onscholarship = 'Y' | game_1 |
[
"What sports information do you have?",
"How many games did each student play?",
"What is the total number played?"
] | [
"SELECT * FROM Sportsinfo",
"SELECT gamesplayed FROM Sportsinfo",
"SELECT sum(gamesplayed) FROM Sportsinfo"
] | What is the total number of games played? | SELECT sum(gamesplayed) FROM Sportsinfo | game_1 |
[
"How many games has each student played?",
"Which of those refer to football games played by scholarship students?",
"What is the total number of those games played?"
] | [
"SELECT gamesplayed FROM Sportsinfo",
"SELECT gamesplayed FROM Sportsinfo WHERE sportname = \"Football\" AND onscholarship = 'Y'",
"SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname = \"Football\" AND onscholarship = 'Y'"
] | What is the total number of all football games played by scholarship students? | SELECT sum(gamesplayed) FROM Sportsinfo WHERE sportname = "Football" AND onscholarship = 'Y' | game_1 |
[
"What information do you have on each sport?",
"How many students play each one?",
"Also, what are the names of each sport?"
] | [
"SELECT * FROM Sportsinfo GROUP BY sportname",
"SELECT count(*) FROM Sportsinfo GROUP BY sportname",
"SELECT sportname , count(*) FROM Sportsinfo GROUP BY sportname"
] | How many students play each sport? | SELECT sportname , count(*) FROM Sportsinfo GROUP BY sportname | game_1 |
[
"How many sports does each student play?",
"Also, how many games has each student played?",
"Also, what are their different student ids?"
] | [
"SELECT count(*) FROM Sportsinfo GROUP BY StuID",
"SELECT count(*) , sum(gamesplayed) FROM Sportsinfo GROUP BY StuID",
"SELECT StuID , count(*) , sum(gamesplayed) FROM Sportsinfo GROUP BY StuID"
] | What are the ids of all students along with how many sports and games did they play? | SELECT StuID , count(*) , sum(gamesplayed) FROM Sportsinfo GROUP BY StuID | game_1 |
[
"What are the student IDs for every student?",
"Which of those are for students who played more than 10 hours of a week for all sports?"
] | [
"SELECT StuID FROM Sportsinfo GROUP BY StuID",
"SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek) > 10"
] | What are the student IDs for everybody who worked for more than 10 hours per week on all sports? | SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING sum(hoursperweek) > 10 | game_1 |
[
"For each student, how many sports do they play?",
"Order the information in descending order by number of sports played.",
"What is the first and last name of student who played the most?"
] | [
"SELECT count(*) FROM Sportsinfo GROUP BY StuID",
"SELECT count(*) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID",
"SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1"
] | What is the first and last name of the student who played the most sports? | SELECT T2.Fname , T2.Lname FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1 | game_1 |
[
"What is the name of every sport?",
"Of those, which had students on scholarship?",
"Which sport has the most of those students?"
] | [
"SELECT sportname FROM Sportsinfo GROUP BY sportname",
"SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname",
"SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1"
] | What is the sport with the most scholarship students? | SELECT sportname FROM Sportsinfo WHERE onscholarship = 'Y' GROUP BY sportname ORDER BY count(*) DESC LIMIT 1 | game_1 |
[
"What are the student ids of all those who play sports?",
"What are the ids of all students?",
"Which ids are in the latter list but not the former?"
] | [
"SELECT StuID FROM Sportsinfo",
"SELECT StuID FROM Student",
"SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo"
] | What are the ids of all students who don't play sports? | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Sportsinfo | game_1 |
[
"What are the ids of all students who are in major 600?",
"What are the student ids for all those on scholarship?",
"What ids are in both categories?"
] | [
"SELECT StuID FROM Student WHERE major = 600",
"SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'",
"SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y'"
] | What are the student ids for those on scholarship in major number 600? | SELECT StuID FROM Student WHERE major = 600 INTERSECT SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' | game_1 |
[
"What are the ids of all female students?",
"What are the student ids of all those who play football?",
"What ids are for both?"
] | [
"SELECT StuID FROM Student WHERE sex = 'F'",
"SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\"",
"SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\""
] | What are the ids of all female students who play football? | SELECT StuID FROM Student WHERE sex = 'F' INTERSECT SELECT StuID FROM Sportsinfo WHERE sportname = "Football" | game_1 |
[
"What are the ids of all the students?",
"What are the ids of all those who play football?",
"What are the ids of those who don't play football?"
] | [
"SELECT StuID FROM Student WHERE sex = 'M'",
"SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\"",
"SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = \"Football\""
] | What are the ids of all male students who do not play football? | SELECT StuID FROM Student WHERE sex = 'M' EXCEPT SELECT StuID FROM Sportsinfo WHERE sportname = "Football" | game_1 |
[
"What information on sports do you have for the student named David Shieber?",
"How many hours per week does he practice in total?",
"Also, how many games does he play overall?"
] | [
"SELECT * FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = \"David\" AND T2.Lname = \"Shieber\"",
"SELECT sum(hoursperweek) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = \"David\" AND T2.Lname = \"Shieber\"",
"SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = \"David\" AND T2.Lname = \"Shieber\""
] | What is the total number of hours per work and number of games played by David Shieber? | SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = "David" AND T2.Lname = "Shieber" | game_1 |
[
"What sports information is there on students under the age of 20?",
"How many hours per week do they practice in total?",
"Also, how many games do they play overall?"
] | [
"SELECT * FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20",
"SELECT sum(hoursperweek) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20",
"SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20"
] | What is the total number of hours per week and number of games played by students under 20? | SELECT sum(hoursperweek) , sum(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.age < 20 | game_1 |
[
"What are the student ids of those who play games?",
"Give me a list of unique ids.",
"How long is it?"
] | [
"SELECT StuID FROM Plays_games",
"SELECT DISTINCT StuID FROM Plays_games",
"SELECT count(DISTINCT StuID) FROM Plays_games"
] | How many different students play games? | SELECT count(DISTINCT StuID) FROM Plays_games | game_1 |
[
"What are all the student ids?",
"What are the student ids of all who play games?",
"What are the ids of all those in the first category but not the second?"
] | [
"SELECT StuID FROM Student",
"SELECT StuID FROM Plays_games",
"SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games"
] | What are the ids of all students who are not video game players? | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games | game_1 |
[
"What are the ids of all students who play sports?",
"What are the student ids of all those who play games?",
"What are the ids of those who play sports but don't play games?"
] | [
"SELECT StuID FROM Sportsinfo",
"SELECT StuID FROM Plays_games",
"SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games"
] | What are the ids of all students who played video games and sports? | SELECT StuID FROM Sportsinfo INTERSECT SELECT StuID FROM Plays_games | game_1 |
[
"How many hours did each student play for each game?",
"What is the toal number of hours played for each game?",
"And what is the id of each game?"
] | [
"SELECT hours_played FROM Plays_games GROUP BY gameid",
"SELECT sum(hours_played) FROM Plays_games GROUP BY gameid",
"SELECT gameid , sum(hours_played) FROM Plays_games GROUP BY gameid"
] | What are ids and total number of hours played for each game? | SELECT gameid , sum(hours_played) FROM Plays_games GROUP BY gameid | game_1 |
[
"For each student id, how many hours did each student play?",
"How much did they play in total?",
"Also, what are their student ids?"
] | [
"SELECT hours_played FROM Plays_games GROUP BY Stuid",
"SELECT sum(hours_played) FROM Plays_games GROUP BY Stuid",
"SELECT Stuid , sum(hours_played) FROM Plays_games GROUP BY Stuid"
] | What are the ids of all students and number of hours played? | SELECT Stuid , sum(hours_played) FROM Plays_games GROUP BY Stuid | game_1 |
[
"What is the name of each game from its id?",
"Order the names by total hours played.",
"which one is first?"
] | [
"SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid",
"SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC",
"SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1"
] | What is the name of the game that has been played the most? | SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid ORDER BY sum(hours_played) DESC LIMIT 1 | game_1 |
[] | [] | What are the names of all the games that have been played for at least 1000 hours? | SELECT gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING sum(hours_played) >= 1000 | game_1 |
[] | [] | What are the names of all games played by Linda Smith? | SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = "Smith" AND T3.Fname = "Linda" | game_1 |
[
"What are the ids of all students who played football or Lacrosse?",
"What are the first names that correspond to those ids?",
"Also, what are their last names?"
] | [
"SELECT StuID FROM SportsInfo WHERE SportName = \"Football\" OR SportName = \"Lacrosse\"",
"SELECT T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = \"Football\" OR T1.SportName = \"Lacrosse\"",
"SELECT T2.lname , T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = \"Football\" OR T1.SportName = \"Lacrosse\""
] | What is the first and last name of all students who play Football or Lacrosse? | SELECT T2.lname , T2.fname FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.SportName = "Football" OR T1.SportName = "Lacrosse" | game_1 |
[
"What are the student ids of all who played Football?",
"Which of those ids are also marked as having played Lacrosse?",
"What are the first names and ages that correspond to those student ids?"
] | [
"SELECT StuID FROM Sportsinfo WHERE SportName = \"Football\"",
"SELECT StuID FROM Sportsinfo WHERE SportName = \"Football\" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = \"Lacrosse\"",
"SELECT fname , age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = \"Football\" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = \"Lacrosse\")"
] | What are the first names and ages of all students who are playing both Football and Lacrosse? | SELECT fname , age FROM Student WHERE StuID IN (SELECT StuID FROM Sportsinfo WHERE SportName = "Football" INTERSECT SELECT StuID FROM Sportsinfo WHERE SportName = "Lacrosse") | game_1 |
[
"What are the distinct classroom buildings?",
"Of those, which have capacity of over 50?"
] | [
"SELECT DISTINCT building FROM classroom",
"SELECT DISTINCT building FROM classroom WHERE capacity > 50"
] | What are the distinct buildings with capacities of greater than 50? | SELECT DISTINCT building FROM classroom WHERE capacity > 50 | college_2 |
[
"Which classrooms are not in Lamberton?",
"How many are there?"
] | [
"SELECT * FROM classroom WHERE building ! = 'Lamberton'",
"SELECT count(*) FROM classroom WHERE building ! = 'Lamberton'"
] | How many classrooms are not in Lamberton? | SELECT count(*) FROM classroom WHERE building ! = 'Lamberton' | college_2 |
[
"What is the average department budget?",
"Which departments have a budget higher than average?",
"What are their names and buildings?"
] | [
"SELECT avg(budget) FROM department",
"SELECT * FROM department WHERE budget > (SELECT avg(budget) FROM department)",
"SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department)"
] | Give the name and building of the departments with greater than average budget. | SELECT dept_name , building FROM department WHERE budget > (SELECT avg(budget) FROM department) | college_2 |
[
"Which classrooms have capacity between 50 and 100?",
"What are their buildings and room numbers?"
] | [
"SELECT * FROM classroom WHERE capacity BETWEEN 50 AND 100",
"SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100"
] | What are the room numbers and corresponding buildings for classrooms which can seat between 50 to 100 students? | SELECT building , room_number FROM classroom WHERE capacity BETWEEN 50 AND 100 | college_2 |
[
"Order the departments by budget in decreasing order.",
"Which is has the highest budget?",
"What is its name and building?"
] | [
"SELECT * FROM department ORDER BY budget DESC",
"SELECT * FROM department ORDER BY budget DESC LIMIT 1",
"SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1"
] | What is the department name and corresponding building for the department with the greatest budget? | SELECT dept_name , building FROM department ORDER BY budget DESC LIMIT 1 | college_2 |
[
"What are the names of students in the History department?",
"Which one has the most credits?"
] | [
"SELECT name FROM student WHERE dept_name = 'History'",
"SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1"
] | Give the name of the student in the History department with the most credits. | SELECT name FROM student WHERE dept_name = 'History' ORDER BY tot_cred DESC LIMIT 1 | college_2 |
[
"What are all the classrooms in Lamberton?",
"How many are there?"
] | [
"SELECT * FROM classroom WHERE building = 'Lamberton'",
"SELECT count(*) FROM classroom WHERE building = 'Lamberton'"
] | Count the number of classrooms in Lamberton. | SELECT count(*) FROM classroom WHERE building = 'Lamberton' | college_2 |
[
"What are the student ids of students with advisors?",
"How many are there?"
] | [
"SELECT DISTINCT s_id FROM advisor",
"SELECT count(DISTINCT s_id) FROM advisor"
] | Count the number of students who have advisors. | SELECT count(DISTINCT s_id) FROM advisor | college_2 |
[
"What are all the department names of departments that offer courses?",
"How many are there?"
] | [
"SELECT DISTINCT dept_name FROM course",
"SELECT count(DISTINCT dept_name) FROM course"
] | Count the number of departments which offer courses. | SELECT count(DISTINCT dept_name) FROM course | college_2 |
[
"What are all the courses in the Physics department?",
"What are their course ids?",
"How many are there?"
] | [
"SELECT * FROM course WHERE dept_name = 'Physics'",
"SELECT DISTINCT course_id FROM course WHERE dept_name = 'Physics'",
"SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics'"
] | Count the number of courses in the Physics department. | SELECT count(DISTINCT course_id) FROM course WHERE dept_name = 'Physics' | college_2 |
[
"Which courses have some prerequisite?",
"Which ones have two prerequisites among them?",
"What are their titles?"
] | [
"SELECT * FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id",
"SELECT * FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2",
"SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2"
] | What are the titles for courses with two prerequisites? | SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) = 2 | college_2 |
[
"Which courses have more than 1 prerequisite?",
"What title, credit, and department name correspond to these?"
] | [
"SELECT * FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1",
"SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1"
] | What is the title, credit value, and department name for courses with more than one prerequisite? | SELECT T1.title , T1.credits , T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING count(*) > 1 | college_2 |
[
"What are the ids for courses that have some prerequisites?",
"How many courses do not in the resulting list?"
] | [
"SELECT course_id FROM prereq",
"SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)"
] | Count the number of courses without prerequisites. | SELECT count(*) FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) | college_2 |
[
"What are the ids for prerequisites?",
"Which courses do not have prerequisites?",
"What are their titles?"
] | [
"SELECT course_id FROM prereq",
"SELECT * FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)",
"SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq)"
] | What are the titles of courses without prerequisites? | SELECT title FROM course WHERE course_id NOT IN (SELECT course_id FROM prereq) | college_2 |
[
"What are the ids of instructors who have taught a course?",
"How many are there?"
] | [
"SELECT DISTINCT id FROM teaches",
"SELECT COUNT (DISTINCT id) FROM teaches"
] | Count the number of distinct instructors who have taught a course. | SELECT COUNT (DISTINCT id) FROM teaches | college_2 |
[
"What are the budgets of the Marketing department?",
"How about that for the Finance department?",
"What is their total budget?"
] | [
"SELECT budget FROM department WHERE dept_name = 'Marketing'",
"SELECT budget FROM department WHERE dept_name = 'Finance'",
"SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance'"
] | What is the sum of budgets of the Marketing and Finance departments? | SELECT sum(budget) FROM department WHERE dept_name = 'Marketing' OR dept_name = 'Finance' | college_2 |
[
"What is all the information about an instructor whose name contains 'Soisalon'?",
"What is their department name?"
] | [
"SELECT * FROM instructor WHERE name LIKE '%Soisalon%'",
"SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%'"
] | What is the name of the department with an instructure who has a name like 'Soisalon'? | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' | college_2 |
[
"How many rooms are there in Lamberton?",
"Of those, how many have capacity less than 50?"
] | [
"SELECT count(*) FROM classroom WHERE building = 'Lamberton'",
"SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50"
] | Count the number of rooms in Lamberton with capacity lower than 50. | SELECT count(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50 | college_2 |
[
"What is the average department budget?",
"Which departments have a budget higher than that?",
"What are their names and budgets?"
] | [
"SELECT avg(budget) FROM department",
"SELECT * FROM department WHERE budget > (SELECT avg(budget) FROM department)",
"SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department)"
] | What are the names and budgets of departments with budgets greater than the average? | SELECT dept_name , budget FROM department WHERE budget > (SELECT avg(budget) FROM department) | college_2 |
[
"What are the names of the professors in the Statistics department?",
"Which one earns the least?"
] | [
"SELECT name FROM instructor WHERE dept_name = 'Statistics'",
"SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1"
] | Give the name of the lowest earning instructor in the Statistics department. | SELECT name FROM instructor WHERE dept_name = 'Statistics' ORDER BY salary LIMIT 1 | college_2 |
[
"What are the titles of Statistics courses?",
"Of these, which are also listed as Psychology courses?"
] | [
"SELECT title FROM course WHERE dept_name = 'Statistics'",
"SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology'"
] | What is the title of a course that is listed in both the Statistics and Psychology departments? | SELECT title FROM course WHERE dept_name = 'Statistics' INTERSECT SELECT title FROM course WHERE dept_name = 'Psychology' | college_2 |
[
"What are the titles of Statistics courses?",
"Of these, which are not provided by the Psychology department?"
] | [
"SELECT title FROM course WHERE dept_name = 'Statistics'",
"SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology'"
] | What are the titles of courses that are in the Statistics department but not the Psychology department? | SELECT title FROM course WHERE dept_name = 'Statistics' EXCEPT SELECT title FROM course WHERE dept_name = 'Psychology' | college_2 |
[
"What are the ids of instructors who taught in the Fall of 2009?",
"Of those, which did not teach in the Spring of 2010?"
] | [
"SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009",
"SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010"
] | What are the ids of instructors who taught in the Fall of 2009 but not in the Spring of 2010? | SELECT id FROM teaches WHERE semester = 'Fall' AND YEAR = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND YEAR = 2010 | college_2 |
[
"What are the distinct names of all the students?",
"Of these, which took classes in 2009 or 2010?"
] | [
"SELECT DISTINCT name FROM student",
"SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010"
] | What are the names of the students who took classes in 2009 or 2010? | SELECT DISTINCT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE YEAR = 2009 OR YEAR = 2010 | college_2 |
[
"How many courses does each department have?",
"Order their names from greatest to least.",
"What are the top 3?"
] | [
"SELECT dept_name , count(*) FROM course GROUP BY dept_name",
"SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC",
"SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3"
] | What are the names of the 3 departments with the most courses? | SELECT dept_name FROM course GROUP BY dept_name ORDER BY count(*) DESC LIMIT 3 | college_2 |
[
"How many credits does each department offer?",
"What is the name of the department which offers the most?"
] | [
"SELECT dept_name , sum(credits) FROM course GROUP BY dept_name",
"SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1"
] | What is the name of the department with the most credits? | SELECT dept_name FROM course GROUP BY dept_name ORDER BY sum(credits) DESC LIMIT 1 | college_2 |
Dataset Card for SParC
SParC is a context-dependant multi-turn version of the Spider task 1.0. This dataset provides a chat-bot oriented test set for text-to-sql problems. Additional details may be obtained in the paper:
Paper Abstract
We present SParC, a dataset for cross-domainSemanticParsing inContext that consists of 4,298 coherent question sequences (12k+ individual questions annotated with SQL queries). It is obtained from controlled user interactions with 200 complex databases over 138 domains. We provide an in-depth analysis of SParC and show that it introduces new challenges compared to existing datasets. SParC demonstrates complex contextual dependencies, (2) has greater semantic diversity, and (3) requires generalization to unseen domains due to its cross-domain nature and the unseen databases at test time. We experiment with two state-of-the-art text-to-SQL models adapted to the context-dependent, cross-domain setup. The best model obtains an exact match accuracy of 20.2% over all questions and less than10% over all interaction sequences, indicating that the cross-domain setting and the con-textual phenomena of the dataset present significant challenges for future research. The dataset, baselines, and leaderboard are released at this https URL.
Citation Information
@misc{yu2019sparc,
title={SParC: Cross-Domain Semantic Parsing in Context},
author={Tao Yu and Rui Zhang and Michihiro Yasunaga and Yi Chern Tan and Xi Victoria Lin and Suyi Li and Heyang Er and Irene Li and Bo Pang and Tao Chen and Emily Ji and Shreya Dixit and David Proctor and Sungrok Shim and Jonathan Kraft and Vincent Zhang and Caiming Xiong and Richard Socher and Dragomir Radev},
year={2019},
eprint={1906.02285},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
- Downloads last month
- 35