Database: student_transcripts_tracking
# addresses ( address_id , line_1 , line_2 , line_3 , city , zip_postcode , state_province_county , country , other_address_details )
# courses ( course_id , course_name , course_description , other_details )
# departments ( department_id , department_name , department_description , other_details )
# degree_programs ( degree_program_id , department_id , degree_summary_name , degree_summary_description , other_details )
# sections ( section_id , course_id , section_name , section_description , other_details )
# semesters ( semester_id , semester_name , semester_description , other_details )
# students ( student_id , current_address_id , permanent_address_id , first_name , middle_name , last_name , cell_mobile_number , email_address , ssn , date_first_registered , date_left , other_student_details )
# student_enrolment ( student_enrolment_id , degree_program_id , semester_id , student_id , other_details )
# student_enrolment_courses ( student_course_id , course_id , student_enrolment_id )
# transcripts ( transcript_id , transcript_date , other_details )
# transcript_contents ( student_course_id , transcript_id )
# degree_programs.department_id = departments.department_id
# sections.course_id = courses.course_id
# students.permanent_address_id = addresses.address_id
# students.current_address_id = addresses.address_id
# student_enrolment.student_id = students.student_id
# student_enrolment.semester_id = semesters.semester_id
# student_enrolment.degree_program_id = degree_programs.degree_program_id
# student_enrolment_courses.student_enrolment_id = student_enrolment.student_enrolment_id
# student_enrolment_courses.course_id = courses.course_id
# transcript_contents.transcript_id = transcripts.transcript_id
# transcript_contents.student_course_id = student_enrolment_courses.student_course_id

Question: what are all the addresses including line 1 and line 2?
SQL: select line_1 , line_2 from addresses

Question: What is the first and second line for all addresses?
SQL: select line_1 , line_2 from addresses

Question: How many courses in total are listed?
SQL: select count ( * ) from courses

Question: How many courses are there?
SQL: select count ( * ) from courses

Question: How is the math course described?
SQL: select course_description from courses where course_name = 'math'

Question: What are the descriptions for all the math courses?
SQL: select course_description from courses where course_name = 'math'

Question: What is the zip code of the address in the city Port Chelsea?
SQL: select zip_postcode from addresses where city = 'Port Chelsea'

Question: What is the zip code for Port Chelsea?
SQL: select zip_postcode from addresses where city = 'Port Chelsea'

Question: Which department offers the most number of degrees? List department name and id.
SQL: select departments.department_name , degree_programs.department_id from degree_programs join departments on degree_programs.department_id = departments.department_id group by degree_programs.department_id order by count ( * ) desc limit 1

Question: What is the name and id of the department with the most number of degrees ?
SQL: select departments.department_name , degree_programs.department_id from degree_programs join departments on degree_programs.department_id = departments.department_id group by degree_programs.department_id order by count ( * ) desc limit 1

Question: How many departments offer any degree?
SQL: select count ( distinct department_id ) from degree_programs

Question: How many different departments offer degrees?
SQL: select count ( distinct department_id ) from degree_programs

Question: How many different degree names are offered?
SQL: select count ( distinct degree_summary_name ) from degree_programs

Question: How many different degrees are offered?
SQL: select count ( distinct degree_summary_name ) from degree_programs

Question: How many degrees does the engineering department offer?
SQL: select count ( * ) from departments join degree_programs on departments.department_id = degree_programs.department_id where departments.department_name = 'engineer'

Question: How many degrees does the engineering department have?
SQL: select count ( * ) from departments join degree_programs on departments.department_id = degree_programs.department_id where departments.department_name = 'engineer'

Question: What are the names and descriptions of all the sections?
SQL: select section_name , section_description from sections

Question: What are the names and descriptions for all the sections?
SQL: select section_name , section_description from sections

Question: What are the names and id of courses having at most 2 sections?
SQL: select courses.course_name , courses.course_id from courses join sections on courses.course_id = sections.course_id group by courses.course_id having count ( * ) <= 2

Question: What are the names and ids of every course with less than 2 sections?
SQL: select courses.course_name , courses.course_id from courses join sections on courses.course_id = sections.course_id group by courses.course_id having count ( * ) <= 2

Question: List the section_name in reversed lexicographical order.
SQL: select section_name from sections order by section_name desc

Question: What are the names of the sections in reverse alphabetical order?
SQL: select section_name from sections order by section_name desc

Question: What is the semester which most student registered in? Show both the name and the id.
SQL: select semesters.semester_name , semesters.semester_id from semesters join student_enrolment on semesters.semester_id = student_enrolment.semester_id group by semesters.semester_id order by count ( * ) desc limit 1

Question: For each semester, what is the name and id of the one with the most students registered?
SQL: select semesters.semester_name , semesters.semester_id from semesters join student_enrolment on semesters.semester_id = student_enrolment.semester_id group by semesters.semester_id order by count ( * ) desc limit 1

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%'

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%'

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 students.first_name , students.middle_name , students.last_name , students.student_id from students join student_enrolment on students.student_id = student_enrolment.student_id group by students.student_id having count ( * ) = 2

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 students.first_name , students.middle_name , students.last_name , students.student_id from students join student_enrolment on students.student_id = student_enrolment.student_id group by students.student_id having count ( * ) = 2

Question: Who is enrolled in a Bachelor degree program? List the first name, middle name, last name.
SQL: select distinct students.first_name , students.middle_name , students.last_name from students join student_enrolment on students.student_id = student_enrolment.student_id join degree_programs on student_enrolment.degree_program_id = degree_programs.degree_program_id where degree_programs.degree_summary_name = 'Bachelor'

Question: What are the first, middle, and last names for everybody enrolled in a Bachelors program?
SQL: select distinct students.first_name , students.middle_name , students.last_name from students join student_enrolment on students.student_id = student_enrolment.student_id join degree_programs on student_enrolment.degree_program_id = degree_programs.degree_program_id where degree_programs.degree_summary_name = 'Bachelor'

Question: Find the kind of program which most number of students are enrolled in?
SQL: select degree_programs.degree_summary_name from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id group by degree_programs.degree_summary_name order by count ( * ) desc limit 1

Question: What is the degree summary name that has the most number of students enrolled?
SQL: select degree_programs.degree_summary_name from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id group by degree_programs.degree_summary_name order by count ( * ) desc limit 1

Question: Find the program which most number of students are enrolled in. List both the id and the summary.
SQL: select degree_programs.degree_program_id , degree_programs.degree_summary_name from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id group by degree_programs.degree_program_id order by count ( * ) desc limit 1

Question: What is the program id and the summary of the degree that has the most students enrolled?
SQL: select degree_programs.degree_program_id , degree_programs.degree_summary_name from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id group by degree_programs.degree_program_id order by count ( * ) desc limit 1

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 students.student_id , students.first_name , students.middle_name , students.last_name , count ( * ) , students.student_id from students join student_enrolment on students.student_id = student_enrolment.student_id group by students.student_id order by count ( * ) desc limit 1

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 students.student_id , students.first_name , students.middle_name , students.last_name , count ( * ) , students.student_id from students join student_enrolment on students.student_id = student_enrolment.student_id group by students.student_id order by count ( * ) desc limit 1

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 )

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 )

Question: What are all the course names of the courses which ever have students enrolled in?
SQL: select distinct courses.course_name from courses join student_enrolment_courses on courses.course_id = student_enrolment_courses.course_id

Question: What are the names of all courses that have some students enrolled?
SQL: select distinct courses.course_name from courses join student_enrolment_courses on courses.course_id = student_enrolment_courses.course_id

Question: What's the name of the course with most number of enrollments?
SQL: select courses.course_name from courses join student_enrolment_courses on courses.course_id = student_enrolment_courses.course_id group by courses.course_name order by count ( * ) desc limit 1

Question: What is the name of the course with the most students enrolled?
SQL: select courses.course_name from courses join student_enrolment_courses on courses.course_id = student_enrolment_courses.course_id group by courses.course_name order by count ( * ) desc limit 1

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 students.last_name from students join addresses on students.current_address_id = addresses.address_id where addresses.state_province_county = 'NorthCarolina' except select distinct students.last_name from students join student_enrolment on students.student_id = student_enrolment.student_id

Question: What are the last name of the students who live in North Carolina but have not registered in any degree programs?
SQL: select students.last_name from students join addresses on students.current_address_id = addresses.address_id where addresses.state_province_county = 'NorthCarolina' except select distinct students.last_name from students join student_enrolment on students.student_id = student_enrolment.student_id

Question: Show the date and id of the transcript with at least 2 course results.
SQL: select transcripts.transcript_date , transcript_contents.transcript_id from transcript_contents join transcripts on transcript_contents.transcript_id = transcripts.transcript_id group by transcript_contents.transcript_id having count ( * ) >= 2

Question: What is the date and id of the transcript with at least 2 courses listed?
SQL: select transcripts.transcript_date , transcript_contents.transcript_id from transcript_contents join transcripts on transcript_contents.transcript_id = transcripts.transcript_id group by transcript_contents.transcript_id having count ( * ) >= 2

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'

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'

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

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

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

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

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

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

Question: Which address holds the most number of students currently? List the address id and all lines.
SQL: select addresses.address_id , addresses.line_1 , addresses.line_2 from addresses join students on addresses.address_id = students.current_address_id group by addresses.address_id order by count ( * ) desc limit 1

Question: What is the id, line 1, and line 2 of the address with the most students?
SQL: select addresses.address_id , addresses.line_1 , addresses.line_2 from addresses join students on addresses.address_id = students.current_address_id group by addresses.address_id order by count ( * ) desc limit 1

Question: On average, when were the transcripts printed?
SQL: select avg ( transcript_date ) from transcripts

Question: What is the average transcript date?
SQL: select avg ( transcript_date ) from 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

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

Question: How many transcripts are released?
SQL: select count ( * ) from transcripts

Question: How many transcripts are listed?
SQL: select count ( * ) from transcripts

Question: What is the last transcript release date?
SQL: select transcript_date from transcripts order by transcript_date desc limit 1

Question: When was the last transcript released?
SQL: select transcript_date from transcripts order by transcript_date desc limit 1

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

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

Question: Show the date of the transcript which shows the least number of results, also list the id.
SQL: select transcripts.transcript_date , transcript_contents.transcript_id from transcript_contents join transcripts on transcript_contents.transcript_id = transcripts.transcript_id group by transcript_contents.transcript_id order by count ( * ) asc limit 1

Question: What is the date and id of the transcript with the least number of results?
SQL: select transcripts.transcript_date , transcript_contents.transcript_id from transcript_contents join transcripts on transcript_contents.transcript_id = transcripts.transcript_id group by transcript_contents.transcript_id order by count ( * ) asc limit 1

Question: Find the semester when both Master students and Bachelor students got enrolled in.
SQL: select distinct student_enrolment.semester_id from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id where degree_summary_name = 'Master' intersect select distinct student_enrolment.semester_id from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id where degree_summary_name = 'Bachelor'

Question: What is the id of the semester that had both Masters and Bachelors students enrolled?
SQL: select distinct student_enrolment.semester_id from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id where degree_summary_name = 'Master' intersect select distinct student_enrolment.semester_id from degree_programs join student_enrolment on degree_programs.degree_program_id = student_enrolment.degree_program_id where degree_summary_name = 'Bachelor'

Question: How many different addresses do the students currently live?
SQL: select count ( distinct current_address_id ) from students

Question: What are the different addresses that have students living there?
SQL: select count ( distinct current_address_id ) from students

Question: List all the student details in reversed lexicographical order.
SQL: select other_student_details from students order by other_student_details desc

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

Question: Describe the section h.
SQL: select section_description from sections where section_name = 'h'

Question: What is the description for the section named h?
SQL: select section_description from sections where section_name = 'h'

Question: Find the first name of the students who permanently live in the country Haiti or have the cell phone number 09700166582 .
SQL: select students.first_name from students join addresses on students.permanent_address_id = addresses.address_id where addresses.country = 'haiti' or students.cell_mobile_number = '09700166582'

Question: What are the first names of the students who live in Haiti permanently or have the cell phone number 09700166582 ?
SQL: select students.first_name from students join addresses on students.permanent_address_id = addresses.address_id where addresses.country = 'haiti' or students.cell_mobile_number = '09700166582'