Consider the query: SELECT student_name FROM studentdata WHERE rollno (SELECT…

2008

Consider the query:

SELECT student_name
FROM studentdata
WHERE rollno (SELECT rollno
        FROM studentmarks
        WHERE SEM1_MARK = SEM2_MARK);

Which of the following is true?

  1. A.

    It gives the name of the student whose marks in semester 1 and semester 2 are same.

  2. B.

    It gives all the names and roll nos of those students whose marks in semester 1 and semester 2 are same.

  3. C.

    It gives the names of all the students whose marks in semester 1 and semester 2 are same.

  4. D.

    It gives roll numbers of all students whose marks in semester 1 and semester 2 are same.

Attempted by 71 students.

Show answer & explanation

Correct answer: C

The outer query selects student_name from the student table. The subquery identifies roll numbers where SEM1_MARK equals SEM2_MARK in the student_marks table. Assuming the missing 'IN' keyword is corrected, the outer query filters students whose roll number matches those in the subquery. The result returns student names for students with equal marks in both semesters.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor