aherntech/sparc huggingface dataset:
Database: student_transcripts_tracking
Question sequence:
Give me the description of the department that offers the most number of degrees.
What's the name and id of that department?
SQL query sequence:
SELECT T2.department_description ,  T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY T1.department_id ORDER BY count(*) DESC LIMIT 1
SELECT T2.department_name ,  T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY T1.department_id ORDER BY count(*) DESC LIMIT 1
Final question: Which department offers the most number of degrees? List department name and id.
Final SQL: SELECT T2.department_name ,  T1.department_id FROM Degree_Programs AS T1 JOIN Departments AS T2 ON T1.department_id  =  T2.department_id GROUP BY T1.department_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking
Question sequence:
Show me all the degrees offered by the engineering department.
How many are there?
SQL query sequence:
SELECT * FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id  =  T2.department_id WHERE T1.department_name  =  'engineer'
SELECT count(*) FROM Departments AS T1 JOIN Degree_Programs AS T2 ON T1.department_id  =  T2.department_id WHERE T1.department_name  =  'engineer'
Final question: How many degrees does the engineering department offer?
Final 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
Question sequence:
Show me courses that have exactly 2 sections.
Show me names and ids for courses that have at most 2 sections.
SQL query sequence:
SELECT * FROM Courses AS T1 JOIN Sections AS T2 ON T1.course_id  =  T2.course_id GROUP BY T1.course_id HAVING count(*)  =  2
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
Final question: What are the names and id of courses having at most 2 sections?
Final 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
Question sequence:
Which semester did the least number of students register? Give me its name and id.
How about the semester that most number of students registered?
SQL query sequence:
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(*) ASC LIMIT 1
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
Final question: What is the semester which most student registered in? Show both the name and the id.
Final 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
Question sequence:
Show me all department names that contain the word "computer"
Show me their descriptions.
SQL query sequence:
SELECT * FROM Departments WHERE department_name LIKE '%computer%'
SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'
Final question: What is the description of the department whose name has the substring the computer?
Final SQL: SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'
Database: student_transcripts_tracking
Question sequence:
How many people are enrolled in 2 degree programs in one semester?
Show me their first, middle, and last names.
SQL query sequence:
SELECT count(*) FROM Students AS T1 JOIN Student_Enrolment AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id HAVING count(*)  =  2
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
Final question: Who are enrolled in 2 degree programs in one semester? List the first name, middle name and last name and the id.
Final 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
Question sequence:
How many people are enrolled in the Bachelor degree program?
What are their first, middle, and last names?
SQL query sequence:
SELECT DISTINCT count(*) 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'
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'
Final question: Who is enrolled in a Bachelor degree program? List the first name, middle name, last name.
Final 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
Question sequence:
Show me the descriptions of programs with 3 highest number of enrolled students.
Show me the name of program with the most enrolled students.
SQL query sequence:
SELECT T1.degree_summary_description 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 3
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
Final question: Find the kind of program which most number of students are enrolled in?
Final 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
Question sequence:
What is the description of the program that has the least number of enrolled students?
How about the program that has the most number of enrolled students?
Show me the id and summary.
SQL query sequence:
SELECT T1.degree_summary_description 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(*) ASC LIMIT 1
SELECT T1.degree_summary_description 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
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
Final question: Find the program which most number of students are enrolled in. List both the id and the summary.
Final 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
Question sequence:
Show me the id, first and last names of top 3 students who have enrolled for the most times in any program.
Show me just the top 1.
SQL query sequence:
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 3
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
Final 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.
Final 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
Question sequence:
Give me the description of a semester with no enrolled students.
What's the name of that semester?
SQL query sequence:
SELECT semester_description FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
Final question: Which semesters do not have any student enrolled? List the semester name.
Final SQL: SELECT semester_name FROM Semesters WHERE semester_id NOT IN( SELECT semester_id FROM Student_Enrolment )
Database: student_transcripts_tracking
Question sequence:
What's the name of the course with the least number of enrollments?
How many enrollments does the course with most enrollments have?
What's the name of that course?
SQL query sequence:
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(*) ASC LIMIT 1
SELECT count(*) 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
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
Final question: What's the name of the course with most number of enrollments?
Final 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
Question sequence:
How many students currently live in North Carolina?
How many of those students have not registered in any degree program?
What are their last names?
SQL query sequence:
SELECT count(*) FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id  =  T2.address_id WHERE T2.state_province_county  =  'NorthCarolina'
SELECT count(*) 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
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
Final 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.
Final 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
Question sequence:
Show me date and id of transcripts with exactly 2 course results.
How about transcripts with at least 2 course results?
SQL query sequence:
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
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
Final question: Show the date and id of the transcript with at least 2 course results.
Final 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
Question sequence:
What is the address of the student with first name Timothy and last name Ward?
What's his phone number?
SQL query sequence:
SELECT current_address_id FROM Students WHERE first_name  =  'Timmothy' AND last_name  =  'Ward'
SELECT cell_mobile_number FROM Students WHERE first_name  =  'Timmothy' AND last_name  =  'Ward'
Final question: What is the phone number of the man with the first name Timmothy and the last name Ward?
Final SQL: SELECT cell_mobile_number FROM Students WHERE first_name  =  'Timmothy' AND last_name  =  'Ward'
Database: student_transcripts_tracking
Question sequence:
Who was the last student to register? Show me the first, middle, and last names of that student.
Who was the first to register?
SQL query sequence:
SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_first_registered DESC LIMIT 1
SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1
Final question: Who is the first student to register? List the first name, middle name and last name.
Final SQL: SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_first_registered ASC LIMIT 1
Database: student_transcripts_tracking
Question sequence:
Who is the least recent graduate of the school? List the first, middle, and last names.
Who is the earliest graduate of the school?
SQL query sequence:
SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_left DESC LIMIT 1
SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_left ASC LIMIT 1
Final question: Who is the earliest graduate of the school? List the first name, middle name and last name.
Final SQL: SELECT first_name ,  middle_name ,  last_name FROM Students ORDER BY date_left ASC LIMIT 1
Database: student_transcripts_tracking
Question sequence:
Give me the id of the address that holds the most number of students?
How many students live there?
Give me all the lines as well as the id of that address.
SQL query sequence:
SELECT T1.address_id 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
SELECT count(*) 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
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
Final question: Which address holds the most number of students currently? List the address id and all lines.
Final 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
Question sequence:
Give me details of the first transcript released.
Tell me when it was released as well, along with its details.
SQL query sequence:
SELECT other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
SELECT transcript_date ,  other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
Final question: When is the first transcript released? List the date and details.
Final SQL: SELECT transcript_date ,  other_details FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
Database: student_transcripts_tracking
Question sequence:
What is the oldest transcript release date?
How about the latest?
SQL query sequence:
SELECT transcript_date FROM Transcripts ORDER BY transcript_date ASC LIMIT 1
SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1
Final question: What is the last transcript release date?
Final SQL: SELECT transcript_date FROM Transcripts ORDER BY transcript_date DESC LIMIT 1
Database: student_transcripts_tracking
Question sequence:
How many times, at minimum, can a course enrollment result show in different transcript? Show me the course enrollment id.
How many times at most?
SQL query sequence:
SELECT count(*) ,  student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) ASC LIMIT 1
SELECT count(*) ,  student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1
Final question: How many times at most can a course enrollment result show in different transcripts? Also show the course enrollment id.
Final SQL: SELECT count(*) ,  student_course_id FROM Transcript_Contents GROUP BY student_course_id ORDER BY count(*) DESC LIMIT 1
Database: student_transcripts_tracking
Question sequence:
Show other details of the transcript with least number of results.
Show me the date and id of that transcript.
SQL query sequence:
SELECT T2.other_details 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
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
Final question: Show the date of the transcript which shows the least number of results, also list the id.
Final 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
Question sequence:
Find a semester when there was a Master student enrolled.
How about a semester when there was a Bachelor student enrolled?
Find a semester that both types of students were enrolled in.
SQL query sequence:
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'
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'
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'
Final question: Find the semester when both Master students and Bachelor students got enrolled in.
Final 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: dog_kennels
Question sequence:
List all the information about the owners.
What about the Professionals?
Now show the states of them.
Which of them have both owners and professionals living there?
SQL query sequence:
SELECT * FROM Owners
SELECT * FROM Professionals
SELECT state FROM Professionals
SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
Final question: Which states have both owners and professionals living there?
Final SQL: SELECT state FROM Owners INTERSECT SELECT state FROM Professionals
Database: dog_kennels
Question sequence:
Show all the dog ages.
What is the maximum and minimum value?
Which of the dogs have gone through treatments?
What about the average age of them?
SQL query sequence:
SELECT age FROM Dogs
SELECT max(age), min(age) FROM Dogs
SELECT * FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )
SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )
Final question: What is the average age of the dogs who have gone through any treatments?
Final SQL: SELECT avg(age) FROM Dogs WHERE dog_id IN ( SELECT dog_id FROM Treatments )
Database: dog_kennels
Question sequence:
List all the professionals who are Employees.
How many of them live in Connecticut?
What about in Indiana?
Among all the professionals, which have done treatment only 1 treatments?
List the id, last name and cell phone of the professionals who live in the state of Indiana or have done treatment on more than 2 treatments?
SQL query sequence:
SELECT * FROM Professionals WHERE role_code = 'Employee'
SELECT count(*) FROM Professionals WHERE state  =  'Connecticut'
SELECT count(*) FROM Professionals WHERE state  =  'Indiana'
SELECT * FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id GROUP BY T1.professional_id HAVING count(*)  =  1
SELECT professional_id ,  last_name ,  cell_number FROM Professionals WHERE state  =  'Indiana' UNION SELECT T1.professional_id ,  T1.last_name ,  T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id GROUP BY T1.professional_id HAVING count(*)  >  2
Final question: Which professionals live in the state of Indiana or have done treatment on more than 2 treatments? List his or her id, last name and cell phone.
Final SQL: SELECT professional_id ,  last_name ,  cell_number FROM Professionals WHERE state  =  'Indiana' UNION SELECT T1.professional_id ,  T1.last_name ,  T1.cell_number FROM Professionals AS T1 JOIN Treatments AS T2 ON T1.professional_id  =  T2.professional_id GROUP BY T1.professional_id HAVING count(*)  >  2
Database: dog_kennels
Question sequence:
Show the dog name and total cost of each dog.
Which of them cost over 500?
What about more than 1000?
SQL query sequence:
SELECT name, sum(cost_of_treatment) FROM Treatments AS T1 JOIN dogs AS T2 ON T1.dog_id = T2.dog_id GROUP BY T1.dog_id
SELECT name FROM Treatments  AS T1 JOIN dogs AS T2 ON T1.dog_id = T2.dog_id GROUP BY T1.dog_id Having sum(cost_of_treatment) > 500
SELECT name FROM Dogs WHERE dog_id NOT IN( SELECT dog_id FROM Treatments GROUP BY dog_id HAVING sum(cost_of_treatment)  >  1000 )
Final question: Which dogs have not cost their owner more than 1000 for treatment? List the dog names.
Final SQL: SELECT name FROM Dogs WHERE dog_id NOT IN( SELECT dog_id FROM Treatments GROUP BY dog_id HAVING sum(cost_of_treatment)  >  1000 )
Database: dog_kennels
Question sequence:
List all the names of both Professionals and Owners.
What about the dog names?
Which human names are not used as dog names.
SQL query sequence:
SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners
SELECT name FROM Dogs
SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs
Final question: Which first names are used for professionals or owners but are not used as dog names?
Final SQL: SELECT first_name FROM Professionals UNION SELECT first_name FROM Owners EXCEPT SELECT name FROM Dogs