Consider the query: SELECT student_name FROM students WHERE class_name =…
2007
Consider the query:
SELECT student_name
FROM students
WHERE class_name = (SELECT class_name
FROM students
WHERE math_marks = 100);
What will be the output?
- A.
the list of names of students with 100 marks in mathematics
- B.
the names of all students of all classes in which at least one student has 100 marks in mathematics
- C.
the names of all students in all classes having 100 marks in mathematics
- D.
the names and class of all students whose marks in mathematics is 100
Attempted by 126 students.
Show answer & explanation
Correct answer: B
The subquery identifies class names where math_marks equal 100. The main query retrieves student names from those specific classes. This means all students in those classes are returned, not only those with 100 marks.
A video solution is available for this question — log in and enroll to watch it.