Multiple choice

Write a query to get the details of all the students who are all enrolled in the same course as the student with STUDENT_ID 123.

  1. SELECT STUDENT_ID FROM STUDENT WHERE COURSE_ID = ( SELECT STUDENT_ID FROM STUDENT WHERE COURSE_ID = 123)

  2. SELECT STUDENT_ID FROM STUDENT WHERE COURSE_ID = ( SELECT COURSE_ID FROM STUDENT WHERE STUDENT_ID = 123)

  3. SELECT STUDENT_ID FROM STUDENT WHERE COURSE_ID = ( SELECT STUDENT_ID FROM STUDENT WHERE STUDENT_ID = 123)

  4. SELECT STUDENT_ID FROM STUDENT WHERE STUDENT_ID = ( SELECT COURSE_ID FROM STUDENT WHERE COURSE_ID = 123)

  5. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Yes, this is the correct syntax to get the details of all the students who are all enrolled in the same course as the student with STUDENT_ID 123.