[Schema (values) (types)]: | student_assessment |  Addresses : address_id (text) , line_1 (number) , line_2 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) | People : person_id (text) , first_name (number) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , login_name (text) , password (text) | Students : student_id (text) , student_details (number) | Courses : course_id (text) , course_name (number) , course_description (text) , other_details (text) | People_Addresses : person_address_id (text) , person_id (number) , address_id (text) , date_from (text) , date_to (text) | Student_Course_Registrations : student_id (text) , course_id (number) , registration_date (text) | Student_Course_Attendance : student_id (text) , course_id (number) , date_of_attendance (text) | Candidates : candidate_id (text) , candidate_details (number) | Candidate_Assessments : candidate_id (text) , qualification (number) , assessment_date (text) , asessment_outcome_code (text);
[Primary Keys]: addresses : address_id, people : person_id, students : student_id, courses : course_id, people_addresses : person_address_id, student_course_registrations : student_id, student_course_attendance : student_id, candidates : candidate_id, candidate_assessments : candidate_id
[Foreign Keys]: students : student_id = people : person_id | people_addresses : address_id = addresses : address_id | people_addresses : person_id = people : person_id | student_course_registrations : course_id = courses : course_id | student_course_registrations : student_id = students : student_id | student_course_attendance : student_id = student_course_registrations : student_id | student_course_attendance : course_id = student_course_registrations : course_id | candidates : candidate_id = people : person_id | candidate_assessments : candidate_id = candidates : candidate_id

Question: which course has most number of registered students?
SQL: SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1

Question: What is the name of the course with the most registered students?
SQL: SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1

Question: what is id of students who registered some courses but the least number of courses in these students?
SQL: SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1

Question: What are the ids of the students who registered for some courses but had the least number of courses for all students?
SQL: SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1

Question: what are the first name and last name of all candidates?
SQL: SELECT T2.first_name ,  T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id

Question: What are the first and last names of all the candidates?
SQL: SELECT T2.first_name ,  T2.last_name FROM candidates AS T1 JOIN people AS T2 ON T1.candidate_id = T2.person_id

Question: List the id of students who never attends courses?
SQL: SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)

Question: What are the  ids of every student who has never attended a course?
SQL: SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)

Question: List the id of students who attended some courses?
SQL: SELECT student_id FROM student_course_attendance

Question: What are the ids of all students who have attended at least one course?
SQL: SELECT student_id FROM student_course_attendance

Question: What are the ids of all students for courses and what are the names of those courses?
SQL: SELECT T1.student_id ,  T2.course_name FROM student_course_registrations AS T1 JOIN courses AS T2 ON T1.course_id = T2.course_id

Question: What is detail of the student who most recently registered course?
SQL: SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1

Question: What details do we have on the students who registered for courses most recently?
SQL: SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1

Question: How many students attend course English?
SQL: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"

Question: How many students are attending English courses?
SQL: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"

Question: How many courses do the student whose id is 171 attend?
SQL: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171

Question: How many courses does the student with id 171 actually attend?
SQL: SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171

Question: Find id of the candidate whose email is stanley.monahan@example.org?
SQL: SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "stanley.monahan@example.org"

Question: What is the id of the candidate whose email is stanley.monahan@example.org?
SQL: SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "stanley.monahan@example.org"

Question: Find id of the candidate who most recently accessed the course?
SQL: SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1

Question: What is the id of the candidate who most recently accessed the course?
SQL: SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1

Question: What is detail of the student who registered the most number of courses?
SQL: SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1

Question: What are the details of the student who registered for the most number of courses?
SQL: SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1

Question: List the id of students who registered some courses and the number of their registered courses?
SQL: SELECT T1.student_id ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id

Question: For every student who is registered for some course, how many courses are they registered for?
SQL: SELECT T1.student_id ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id

Question: How many registed students do each course have? List course name and the number of their registered students?
SQL: SELECT T3.course_name ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id

Question: For each course id, how many students are registered and what are the course names?
SQL: SELECT T3.course_name ,  count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id

Question: Find id of candidates whose assessment code is "Pass"?
SQL: SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"

Question: What are the ids of the candidates that have an outcome code of Pass?
SQL: SELECT candidate_id FROM candidate_assessments WHERE asessment_outcome_code = "Pass"

Question: Find the cell mobile number of the candidates whose assessment code is "Fail"?
SQL: SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"

Question: What are the cell phone numbers of the candidates that received an assessment code of "Fail"?
SQL: SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"

Question: What are the id of students who registered course 301?
SQL: SELECT student_id FROM student_course_attendance WHERE course_id  =  301

Question: What are the ids of the students who registered for course 301?
SQL: SELECT student_id FROM student_course_attendance WHERE course_id  =  301

Question: What is the id of the student who most recently registered course 301?
SQL: SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1

Question: What are the ids of the students who registered for course 301 most recently?
SQL: SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1

Question: Find distinct cities of addresses of people?
SQL: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id

Question: What are the different cities where people live?
SQL: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id

Question: Find distinct cities of address of students?
SQL: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id

Question: What are the different cities where students live?
SQL: SELECT DISTINCT T1.city FROM addresses AS T1 JOIN people_addresses AS T2 ON T1.address_id = T2.address_id JOIN students AS T3 ON T2.person_id = T3.student_id

Question: List the names of courses in alphabetical order?
SQL: SELECT course_name FROM courses ORDER BY course_name

Question: What are the names of the courses in alphabetical order?
SQL: SELECT course_name FROM courses ORDER BY course_name

Question: List the first names of people in alphabetical order?
SQL: SELECT first_name FROM people ORDER BY first_name

Question: What are the first names of the people in alphabetical order?
SQL: SELECT first_name FROM people ORDER BY first_name

Question: What are the id of students who registered courses or attended courses?
SQL: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance

Question: What are the ids of the students who either registered or attended a course?
SQL: SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance

Question: Find the id of courses which are registered or attended by student whose id is 121?
SQL: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121

Question: What are the ids of the courses that are registered or attended by the student whose id is 121?
SQL: SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121

Question: What are all info of students who registered courses but not attended courses?
SQL: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)

Question: What are all details of the students who registered but did not attend any course?
SQL: SELECT * FROM student_course_registrations WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)

Question: List the id of students who registered course statistics in the order of registration date.
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date

Question: What are the ids of the students who registered course statistics by order of registration date?
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.registration_date

Question: List the id of students who attended  statistics courses in the order of attendance date.
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance

Question: What are the ids of the students who attended courses in the statistics department in order of attendance date.
SQL: SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance