target-benchmark/spider-queries huggingface dataset:
Database: student_transcripts_tracking (tables: degree_programs, departments)
Question: How many degrees does the engineering department have?
SQL: SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id  =  T2.department_id WHERE T1.department_name  =  'engineer'
Database: student_transcripts_tracking (tables: sections)
Question: What are the names and descriptions of all the sections?
SQL: SELECT section_name ,  section_description FROM Sections
Database: student_transcripts_tracking (tables: sections)
Question: What are the names and descriptions for all the sections?
SQL: SELECT section_name ,  section_description FROM Sections
Database: student_transcripts_tracking (tables: courses, sections)
Question: What are the names and id of courses having at most 2 sections?
SQL: SELECT T1.course_name ,  T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_id HAVING count(*)  <=  2
Database: student_transcripts_tracking (tables: courses, sections)
Question: What are the names and ids of every course with less than 2 sections?
SQL: SELECT T1.course_name ,  T1.course_id FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_id HAVING count(*)  <=  2
Database: student_transcripts_tracking (tables: sections)
Question: List the section_name in reversed lexicographical order.
SQL: SELECT section_name FROM Sections ORDER BY section_name DESC
Database: student_transcripts_tracking (tables: sections)
Question: What are the names of the sections in reverse alphabetical order?
SQL: SELECT section_name FROM Sections ORDER BY section_name DESC
Database: student_transcripts_tracking (tables: semesters, student_enrolment)
Question: What is the semester which most student registered in? Show both the name and the id.
SQL: SELECT T1.semester_name ,  T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id  =  T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: semesters, student_enrolment)
Question: For each semester, what is the name and id of the one with the most students registered?
SQL: SELECT T1.semester_name ,  T1.semester_id FROM Semesters AS T1 JOIN Student_Enrolment AS T2 ON T1.semester_id  =  T2.semester_id GROUP BY T1.semester_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: departments)
Question: What is the description of the department whose name has the substring the computer?
SQL: SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'
Database: student_transcripts_tracking (tables: departments)
Question: What is the department description for the one whose name has the word computer?
SQL: SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'
Database: student_transcripts_tracking (tables: student_enrolment, students)
Question: Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id.
SQL: SELECT T1.first_name ,  T1.middle_name ,  T1.last_name ,  T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING count(*)  =  2
Database: student_transcripts_tracking (tables: student_enrolment, students)
Question: What are the first, middle, and last names, along with the ids, of all students who enrolled in 2 degree programs in one semester?
SQL: SELECT T1.first_name ,  T1.middle_name ,  T1.last_name ,  T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING count(*)  =  2
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment, students)
Question: Who is enrolled in a Bachelor degree program? List the first name, middle name, last name.
SQL: SELECT DISTINCT T1.first_name ,  T1.middle_name ,  T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id  =  T3.degree_program_id WHERE T3.degree_summary_name  =  'Bachelor'
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment, students)
Question: What are the first, middle, and last names for everybody enrolled in a Bachelors program?
SQL: SELECT DISTINCT T1.first_name ,  T1.middle_name ,  T1.last_name FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id JOIN Degree_Programs AS T3 ON T2.degree_program_id  =  T3.degree_program_id WHERE T3.degree_summary_name  =  'Bachelor'
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment)
Question: Find the kind of program which most number of students are enrolled in?
SQL: SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment)
Question: What is the degree summary name that has the most number of students enrolled?
SQL: SELECT T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id GROUP BY T1.degree_summary_name ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment)
Question: Find the program which most number of students are enrolled in. List both the id and the summary.
SQL: SELECT T1.degree_program_id ,  T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment)
Question: What is the program id and the summary of the degree that has the most students enrolled?
SQL: SELECT T1.degree_program_id ,  T1.degree_summary_name FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id GROUP BY T1.degree_program_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: student_enrolment, students)
Question: Which student has enrolled for the most times in any program? List the id, first name, middle name, last name, the number of enrollments and student id.
SQL: SELECT T1.student_id ,  T1.first_name ,  T1.middle_name ,  T1.last_name ,  count(*) ,  T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: student_enrolment, students)
Question: What is the first, middle, and last name, along with the id and number of enrollments, for the student who enrolled the most in any program?
SQL: SELECT T1.student_id ,  T1.first_name ,  T1.middle_name ,  T1.last_name ,  count(*) ,  T1.student_id FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: semesters, student_enrolment)
Question: Which semesters do not have any student enrolled? List the semester name.
SQL: SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
Database: student_transcripts_tracking (tables: semesters, student_enrolment)
Question: What is the name of the semester with no students enrolled?
SQL: SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
Database: student_transcripts_tracking (tables: courses, student_enrolment_courses)
Question: What are all the course names of the courses which ever have students enrolled in?
SQL: SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id  =  T2.course_id
Database: student_transcripts_tracking (tables: courses, student_enrolment_courses)
Question: What are the names of all courses that have some students enrolled?
SQL: SELECT DISTINCT T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id  =  T2.course_id
Database: student_transcripts_tracking (tables: courses, student_enrolment_courses)
Question: What's the name of the course with most number of enrollments?
SQL: SELECT  T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: courses, student_enrolment_courses)
Question: What is the name of the course with the most students enrolled?
SQL: SELECT  T1.course_name FROM Courses AS T1 JOIN Student_Enrolment_Courses AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_name ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: addresses, student_enrolment, students)
Question: Find the last name of the students who currently live in the state of North Carolina but have not registered in any degree program.
SQL: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id  =  T2.address_id WHERE T2.state_province_county  =  'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id  =  T4.student_id
Database: student_transcripts_tracking (tables: addresses, student_enrolment, students)
Question: What are the last name of the students who live in North Carolina but have not registered in any degree programs?
SQL: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id  =  T2.address_id WHERE T2.state_province_county  =  'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id  =  T4.student_id
Database: student_transcripts_tracking (tables: transcript_contents, transcripts)
Question: Show the date and id of the transcript with at least 2 course results.
SQL: SELECT T2.transcript_date ,  T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id  =  T2.transcript_id GROUP BY T1.transcript_id HAVING count(*)  >=  2
Database: student_transcripts_tracking (tables: transcript_contents, transcripts)
Question: What is the date and id of the transcript with at least 2 courses listed?
SQL: SELECT T2.transcript_date ,  T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id  =  T2.transcript_id GROUP BY T1.transcript_id HAVING count(*)  >=  2
Database: student_transcripts_tracking (tables: students)
Question: What is the phone number of the man with the first name Timmothy and the last name Ward?
SQL: SELECT cell_mobile_number FROM Students WHERE first_name  =  'Timmothy' AND last_name  =  'Ward'
Database: student_transcripts_tracking (tables: students)
Question: What is the mobile phone number of the student named Timmothy Ward ?
SQL: select cell_mobile_number from students where first_name  =  'timmothy' and last_name  =  'ward'
Database: student_transcripts_tracking (tables: students)
Question: Who is the first student to register? List the first name, middle name and last name.
SQL: SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1
Database: student_transcripts_tracking (tables: students)
Question: What is the first, middle, and last name of the first student to register?
SQL: SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1
Database: student_transcripts_tracking (tables: students)
Question: Who is the earliest graduate of the school? List the first name, middle name and last name.
SQL: SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_left ASC LIMIT 1
Database: student_transcripts_tracking (tables: students)
Question: What is the first, middle, and last name of the earliest school graduate?
SQL: SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_left ASC LIMIT 1
Database: student_transcripts_tracking (tables: students)
Question: Whose permanent address is different from his or her current address? List his or her first name.
SQL: SELECT first_name FROM Students WHERE current_address_id != permanent_address_id
Database: student_transcripts_tracking (tables: students)
Question: What is the first name of the student whose permanent address is different from his or her current one?
SQL: SELECT first_name FROM Students WHERE current_address_id != permanent_address_id
Database: student_transcripts_tracking (tables: addresses, students)
Question: Which address holds the most number of students currently? List the address id and all lines.
SQL: SELECT T1.address_id ,  T1.line_1 ,  T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.current_address_id GROUP BY T1.address_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: addresses, students)
Question: What is the id, line 1, and line 2 of the address with the most students?
SQL: SELECT T1.address_id ,  T1.line_1 ,  T1.line_2 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.current_address_id GROUP BY T1.address_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: transcripts)
Question: On average, when were the transcripts printed?
SQL: SELECT avg(transcript_date) FROM Transcripts
Database: student_transcripts_tracking (tables: transcripts)
Question: What is the average transcript date?
SQL: SELECT avg(transcript_date) FROM Transcripts
Database: student_transcripts_tracking (tables: transcripts)
Question: When is the first transcript released? List the date and details.
SQL: SELECT transcript_date ,  other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
Database: student_transcripts_tracking (tables: transcripts)
Question: What is the earliest date of a transcript release, and what details can you tell me?
SQL: SELECT transcript_date ,  other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
Database: student_transcripts_tracking (tables: transcripts)
Question: How many transcripts are released?
SQL: SELECT count(*) FROM Transcripts
Database: student_transcripts_tracking (tables: transcripts)
Question: How many transcripts are listed?
SQL: SELECT count(*) FROM Transcripts
Database: student_transcripts_tracking (tables: transcripts)
Question: What is the last transcript release date?
SQL: SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1
Database: student_transcripts_tracking (tables: transcripts)
Question: When was the last transcript released?
SQL: SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1
Database: student_transcripts_tracking (tables: transcript_contents)
Question: How many times at most can a course enrollment result show in different transcripts? Also show the course enrollment id.
SQL: SELECT count(*) ,  student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: transcript_contents)
Question: What is the maximum number of times that a course shows up in different transcripts and what is that course's enrollment id?
SQL: SELECT count(*) ,  student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking (tables: transcript_contents, transcripts)
Question: Show the date of the transcript which shows the least number of results, also list the id.
SQL: SELECT T2.transcript_date ,  T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id  =  T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1
Database: student_transcripts_tracking (tables: transcript_contents, transcripts)
Question: What is the date and id of the transcript with the least number of results?
SQL: SELECT T2.transcript_date ,  T1.transcript_id FROM Transcript_Contents AS T1 JOIN Transcripts AS T2 ON T1.transcript_id  =  T2.transcript_id GROUP BY T1.transcript_id ORDER BY count(*) ASC LIMIT 1
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment)
Question: Find the semester when both Master students and Bachelor students got enrolled in.
SQL: SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Bachelor'
Database: student_transcripts_tracking (tables: degree_programs, student_enrolment)
Question: What is the id of the semester that had both Masters and Bachelors students enrolled?
SQL: SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Master' INTERSECT SELECT DISTINCT T2.semester_id FROM Degree_Programs AS T1 JOIN Student_Enrolment AS T2 ON T1.degree_program_id  =  T2.degree_program_id WHERE degree_summary_name  =  'Bachelor'
Database: student_transcripts_tracking (tables: students)
Question: How many different addresses do the students currently live?
SQL: SELECT count(DISTINCT current_address_id) FROM Students
Database: student_transcripts_tracking (tables: students)
Question: What are the different addresses that have students living there?
SQL: SELECT count(DISTINCT current_address_id) FROM Students
Database: student_transcripts_tracking (tables: students)
Question: List all the student details in reversed lexicographical order.
SQL: SELECT other_student_details FROM Students ORDER BY other_student_details DESC
Database: student_transcripts_tracking (tables: students)
Question: What other details can you tell me about students in reverse alphabetical order?
SQL: SELECT other_student_details FROM Students ORDER BY other_student_details DESC
Database: student_transcripts_tracking (tables: sections)
Question: Describe the section h.
SQL: SELECT section_description FROM Sections WHERE section_name  =  'h'
Database: student_transcripts_tracking (tables: sections)
Question: What is the description for the section named h?
SQL: SELECT section_description FROM Sections WHERE section_name  =  'h'
Database: student_transcripts_tracking (tables: addresses, students)
Question: Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .
SQL: select t1.first_name from students as t1 join addresses as t2 on t1.permanent_address_id  =  t2.address_id where t2.country  =  'haiti' or t1.cell_mobile_number  =  '09700166582'
Database: student_transcripts_tracking (tables: addresses, students)
Question: What are the first names of the students who live in Haiti permanently or have the cell phone number 09700166582 ?
SQL: select t1.first_name from students as t1 join addresses as t2 on t1.permanent_address_id  =  t2.address_id where t2.country  =  'haiti' or t1.cell_mobile_number  =  '09700166582'
Database: tvshow (tables: cartoon)
Question: List the title of all cartoons in alphabetical order.
SQL: SELECT Title FROM Cartoon ORDER BY title
Database: tvshow (tables: cartoon)
Question: What are the titles of the cartoons sorted alphabetically?
SQL: SELECT Title FROM Cartoon ORDER BY title
Database: tvshow (tables: cartoon)
Question: List all cartoon directed by "Ben Jones".
SQL: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones";
Database: tvshow (tables: cartoon)
Question: What are the names of all cartoons directed by Ben Jones?
SQL: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones";
Database: tvshow (tables: cartoon)
Question: How many cartoons were written by "Joseph Kuhr"?
SQL: SELECT count(*) FROM Cartoon WHERE Written_by = "Joseph Kuhr";
Database: tvshow (tables: cartoon)
Question: What is the number of cartoones written by Joseph Kuhr?
SQL: SELECT count(*) FROM Cartoon WHERE Written_by = "Joseph Kuhr";
Database: tvshow (tables: cartoon)
Question: list all cartoon titles and their directors ordered by their air date
SQL: SELECT title ,  Directed_by FROM Cartoon ORDER BY Original_air_date
Database: tvshow (tables: cartoon)
Question: What is the name and directors of all the cartoons that are ordered by air date?
SQL: SELECT title ,  Directed_by FROM Cartoon ORDER BY Original_air_date
Database: tvshow (tables: cartoon)
Question: List the title of all cartoon directed by "Ben Jones" or "Brandon Vietti".
SQL: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti";
Database: tvshow (tables: cartoon)
Question: What are the titles of all cartoons directed by Ben Jones or Brandon Vietti?
SQL: SELECT Title FROM Cartoon WHERE Directed_by = "Ben Jones" OR Directed_by = "Brandon Vietti";
Database: tvshow (tables: tv_channel)
Question: Which country has the most of TV Channels? List the country and number of TV Channels it has.
SQL: SELECT Country ,  count(*) FROM TV_Channel GROUP BY Country ORDER BY count(*) DESC LIMIT 1;
Database: tvshow (tables: tv_channel)
Question: What is the country with the most number of TV Channels and how many does it have?
SQL: SELECT Country ,  count(*) FROM TV_Channel GROUP BY Country ORDER BY count(*) DESC LIMIT 1;
Database: tvshow (tables: tv_channel)
Question: List the number of different series names and contents in the TV Channel table.
SQL: SELECT count(DISTINCT series_name) ,  count(DISTINCT content) FROM TV_Channel;
Database: tvshow (tables: tv_channel)
Question: How many different series and contents are listed in the TV Channel table?
SQL: SELECT count(DISTINCT series_name) ,  count(DISTINCT content) FROM TV_Channel;
Database: tvshow (tables: tv_channel)
Question: What is the content of TV Channel with serial name "Sky Radio"?
SQL: SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio";
Database: tvshow (tables: tv_channel)
Question: What is the content of the series Sky Radio?
SQL: SELECT Content FROM TV_Channel WHERE series_name = "Sky Radio";
Database: tvshow (tables: tv_channel)
Question: What is the Package Option of TV Channel with serial name "Sky Radio"?
SQL: SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";
Database: tvshow (tables: tv_channel)
Question: What are the Package Options of the TV Channels whose series names are Sky Radio?
SQL: SELECT Package_Option FROM TV_Channel WHERE series_name = "Sky Radio";
Database: tvshow (tables: tv_channel)
Question: How many TV Channel using language English?
SQL: SELECT count(*) FROM TV_Channel WHERE LANGUAGE = "English";
Database: tvshow (tables: tv_channel)
Question: How many TV Channels use the English language?
SQL: SELECT count(*) FROM TV_Channel WHERE LANGUAGE = "English";
Database: tvshow (tables: tv_channel)
Question: List the language used least number of TV Channel. List language and number of TV Channel.
SQL: SELECT LANGUAGE ,  count(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY count(*) ASC LIMIT 1;
Database: tvshow (tables: tv_channel)
Question: What are the languages used by the least number of TV Channels and how many channels use it?
SQL: SELECT LANGUAGE ,  count(*) FROM TV_Channel GROUP BY LANGUAGE ORDER BY count(*) ASC LIMIT 1;
Database: tvshow (tables: tv_channel)
Question: List each language and the number of TV Channels using it.
SQL: SELECT LANGUAGE ,  count(*) FROM TV_Channel GROUP BY LANGUAGE
Database: tvshow (tables: tv_channel)
Question: For each language, list the number of TV Channels that use it.
SQL: SELECT LANGUAGE ,  count(*) FROM TV_Channel GROUP BY LANGUAGE
Database: tvshow (tables: cartoon, tv_channel)
Question: What is the TV Channel that shows the cartoon "The Rise of the Blue Beetle!"? List the TV Channel's series name.
SQL: SELECT T1.series_name FROM TV_Channel AS T1 JOIN Cartoon AS T2 ON T1.id = T2.Channel WHERE T2.Title = "The Rise of the Blue Beetle!";