aherntech/sparc huggingface dataset:
Database: hospital_1
Question sequence:
What is the number of employees in each department?
Which department has the most employees? Give me the department name.
SQL query sequence:
SELECT count(departmentID) FROM department GROUP BY departmentID
SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;
Final question: Find the department with the most employees.
Final SQL: SELECT name FROM department GROUP BY departmentID ORDER BY count(departmentID) DESC LIMIT 1;
Database: hospital_1
Question sequence:
How many employees does each department have?
Which department has the least employees?
Who is the head of this department? Find the employee id.
SQL query sequence:
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;
Final question: Tell me the employee id of the head of the department with the least employees.
Final SQL: SELECT head FROM department GROUP BY departmentID ORDER BY count(departmentID) LIMIT 1;
Database: hospital_1
Question sequence:
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.
SQL query sequence:
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;
Final question: Find the name and position of the head of the department with the least employees.
Final SQL: 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;
Database: hospital_1
Question sequence:
List the patient id for all the appointments.
What are the names of patients who have made appointments?
SQL query sequence:
SELECT patient FROM appointment
SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Final question: List the names of patients who have made appointments.
Final SQL: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Database: hospital_1
Question sequence:
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
SQL query sequence:
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
Final question: Which patients made more than one appointment? Tell me the name and phone number of these patients.
Final SQL: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1
Database: hospital_1
Question sequence:
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.
SQL query sequence:
SELECT START FROM appointment
SELECT * FROM appointment ORDER BY START DESC
SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1
Final question: What is the id of the appointment that started most recently?
Final SQL: SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1
Database: hospital_1
Question sequence:
What are the ids of the physicians who took appointments?
Also tell me their names.
SQL query sequence:
SELECT Physician FROM appointment
SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Final question: What are the names of all the physicians who took appointments.
Final SQL: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Database: hospital_1
Question sequence:
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?
SQL query sequence:
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
Final question: Which physicians have never taken any appointment? Find their names.
Final SQL: SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Database: hospital_1
Question sequence:
List the name of each physician.
Find the name of the primarily affiliated department for each physician.
Return both information together.
SQL query sequence:
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
Final question: What are the name and primarily affiliated department name of each physician?
Final SQL: 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
Database: hospital_1
Question sequence:
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.
SQL query sequence:
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
Final question: Find the name of the patient who made the appointment with the most recent start date.
Final SQL: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 WHERE T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
Database: hospital_1
Question sequence:
Find all the stays in room 112.
How many patients stayed in room 112?
SQL query sequence:
SELECT * FROM stay WHERE room  =  112
SELECT count(patient) FROM stay WHERE room  =  112
Final question: Count the number of patients who stayed in room 112.
Final SQL: SELECT count(patient) FROM stay WHERE room  =  112
Database: hospital_1
Question sequence:
What is the employee id of physician John Dorian?
Find all the prescriptions made by him.
How many patients' prescriptions are made by him?
SQL query sequence:
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"
Final question: Find the number of patients' prescriptions physician John Dorian made.
Final SQL: 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"
Database: hospital_1
Question sequence:
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?
SQL query sequence:
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
Final question: What is the name of the medication used for the patient staying in room 111?
Final SQL: 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
Database: hospital_1
Question sequence:
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?
SQL query sequence:
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
Final question: What is the id of the patient who stayed in room 111 most recently?
Final SQL: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
Database: hospital_1
Question sequence:
How many appointments does each nurse have?
Find the nurse with the most appointments. What is the nurse's name?
SQL query sequence:
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
Final question: Find the name of the nurse who has the largest number of appointments.
Final SQL: 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
Database: hospital_1
Question sequence:
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.
SQL query sequence:
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
Final question: Return the name of each physician and the number of patients he or she treats.
Final SQL: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
Database: hospital_1
Question sequence:
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?
SQL query sequence:
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
Final question: Which physicians are in charge of more than one patient? Give me their names.
Final SQL: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
Database: hospital_1
Question sequence:
What is the block floor each room is located on?
How many rooms does each block floor have?
SQL query sequence:
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
Final question: How many rooms does each block floor have?
Final SQL: 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
Database: hospital_1
Question sequence:
What is each room's block code?
How many rooms does each block code have?
SQL query sequence:
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
Final question: How many rooms are located for each block code?
Final SQL: 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
Database: hospital_1
Question sequence:
List all the rooms that are available.
What are the distinct block codes that have rooms available?
SQL query sequence:
SELECT * FROM room WHERE unavailable  =  0
SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Final question: Tell me the distinct block codes where some rooms are available.
Final SQL: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Database: hospital_1
Question sequence:
List all the room types.
How many distinct room types are there?
SQL query sequence:
SELECT roomtype FROM room
SELECT count(DISTINCT roomtype) FROM room
Final question: Find the number of distinct room types available.
Final SQL: SELECT count(DISTINCT roomtype) FROM room
Database: hospital_1
Question sequence:
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?
SQL query sequence:
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"
Final question: List the names of all the physicians who prescribe Thesisin as medication.
Final SQL: 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"
Database: hospital_1
Question sequence:
Which medication has brand X?
Find the physicians who prescribe this medication.
What are their name and position?
SQL query sequence:
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"
Final question: Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians.
Final SQL: 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"
Database: hospital_1
Question sequence:
Group all the medications by the brand.
How many medications are prescribed for each brand?
SQL query sequence:
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
Final question: How many medications are prescribed for each brand?
Final SQL: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Database: hospital_1
Question sequence:
Find the position title of each physician.
Which physicians have 'senior' in their titles?
Give me their names
SQL query sequence:
SELECT POSITION FROM physician
SELECT * FROM physician WHERE POSITION LIKE '%senior%'
SELECT name FROM physician WHERE POSITION LIKE '%senior%'
Final question: What are the names of the physicians who have 'senior' in their titles.
Final SQL: SELECT name FROM physician WHERE POSITION LIKE '%senior%'
Database: hospital_1
Question sequence:
List the dates of treatment undergoing.
What is the most recent undergoing treatment?
What is the patient of this treatment?
SQL query sequence:
SELECT dateundergoes FROM undergoes
SELECT * FROM undergoes ORDER BY dateundergoes LIMIT 1
SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
Final question: Which patient is undergoing the most recent treatment?
Final SQL: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
Database: hospital_1
Question sequence:
List all the patients who have an undergoing treatment.
Among them, who are staying in room 111?
What are their names?
SQL query sequence:
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
Final question: What are the names of patients who are staying in room 111 and have an undergoing treatment?
Final SQL: 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
Database: hospital_1
Question sequence:
List the distinct names of all the nurses
Order them in the alphabetical order.
SQL query sequence:
SELECT DISTINCT name FROM nurse
SELECT DISTINCT name FROM nurse ORDER BY name
Final question: What is the alphabetically ordered list of all the distinct names of nurses?
Final SQL: SELECT DISTINCT name FROM nurse ORDER BY name
Database: hospital_1
Question sequence:
Find the nurses in charge of undergoing treatments.
What are the distinct names of the nurses?
SQL query sequence:
SELECT AssistingNurse FROM undergoes
SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
Final question: Which nurses are in charge of patients undergoing treatments?
Final SQL: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
Database: hospital_1
Question sequence:
What are the distinct names of medications?
Sort them in an alphabetical order
SQL query sequence:
SELECT DISTINCT name FROM medication
SELECT DISTINCT name FROM medication ORDER BY name
Final question: What is the alphabetically ordered list of all distinct medications?
Final SQL: SELECT DISTINCT name FROM medication ORDER BY name
Database: hospital_1
Question sequence:
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?
SQL query sequence:
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
Final question: Find the physician who prescribed the highest dose. What is his or her name?
Final SQL: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
Database: hospital_1
Question sequence:
Which departments have some physicians primarily affiliated.
What are the distinct names of the departments?
SQL query sequence:
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
Final question: What are the names of departments that have primarily affiliated physicians.
Final SQL: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
Database: game_1
Question sequence:
What information do you have on video games?
How many of them are there?
SQL query sequence:
SELECT * FROM Video_games
SELECT count(*) FROM Video_games
Final question: How many video games do you have?
Final SQL: SELECT count(*) FROM Video_games
Database: game_1
Question sequence:
What are the game types for each video game?
Give me a list of the different game types?
How long is that list?
SQL query sequence:
SELECT gtype FROM Video_games
SELECT DISTINCT gtype FROM Video_games
SELECT count(DISTINCT gtype) FROM Video_games
Final question: What is the count of different game types?
Final SQL: SELECT count(DISTINCT gtype) FROM Video_games
Database: game_1
Question sequence:
What is the type of each game?
What is a list of the different types?
SQL query sequence:
SELECT gtype FROM Video_games
SELECT DISTINCT gtype FROM Video_games
Final question: What are the different types of video games?
Final SQL: SELECT DISTINCT gtype FROM Video_games
Database: game_1
Question sequence:
What is the type of each video game?
Also, what are their names?
Order the above information by the game name alphabetically.
SQL query sequence:
SELECT gtype FROM Video_games
SELECT gname ,  gtype FROM Video_games
SELECT gname ,  gtype FROM Video_games ORDER BY gname
Final question: What are the names of all the video games and their types in alphabetical order?
Final SQL: SELECT gname ,  gtype FROM Video_games ORDER BY gname
Database: game_1
Question sequence:
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?
SQL query sequence:
SELECT * FROM Video_games
SELECT * FROM Video_games WHERE gtype  =  "collectible card game"
SELECT gname FROM Video_games WHERE gtype  =  "collectible card game"
Final question: What are the names of all video games that are collectible cards?
Final SQL: SELECT gname FROM Video_games WHERE gtype  =  "Collectible card game"
Database: game_1
Question sequence:
What is the name of each game?
What information do you have on the game called Call of Destiny?
What type is it?
SQL query sequence:
SELECT gname FROM Video_games
SELECT * FROM Video_games WHERE gname  =  "Call of Destiny"
SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny"
Final question: What type of game is Call of Destiny?
Final SQL: SELECT gtype FROM Video_games WHERE gname  =  "Call of Destiny"
Database: game_1
Question sequence:
SQL query sequence:
Final question: Count the number of video games with Massively multiplayer online game type .
Final SQL: SELECT count(*) FROM Video_games WHERE gtype  =  "Massively multiplayer online game"
Database: game_1
Question sequence:
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?
SQL query sequence:
SELECT gtype FROM Video_games
SELECT * FROM Video_games GROUP BY gtype
SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype
Final question: What are the types of video games and how many are in each type?
Final SQL: SELECT gtype ,  count(*) FROM Video_games GROUP BY gtype
Database: game_1
Question sequence:
What are the game types?
Order the list of game types by number of games in descending order.
Which type has the most?
SQL query sequence:
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
Final question: What type has the most games?
Final SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) DESC LIMIT 1
Database: game_1
Question sequence:
What are the different game types?
Order the list of game types by number of games in ascending order.
Which type has the most?
SQL query sequence:
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
Final question: What is the type with the fewest games?
Final SQL: SELECT gtype FROM Video_games GROUP BY gtype ORDER BY count(*) LIMIT 1
Database: game_1
Question sequence:
What are the student ids?
Which of those are for students who live in the city with the code CHI?
SQL query sequence:
SELECT StuID FROM Student
SELECT StuID FROM Student WHERE city_code  =  "CHI"
Final question: What are the ids of all students who live in CHI?
Final SQL: SELECT StuID FROM Student WHERE city_code  =  "CHI"