in Databases edited by
1,033 views
0 votes
0 votes

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 ?

  1. the list of names of students with $100$ marks in mathematics

  2. the names of all students of all classes in which at least one student has $100$ marks in mathematics

  3. the names of all students in all classes having $100$ marks in mathematics

  4. the names and class of all students whose marks in mathematics is $100$

in Databases edited by
1.0k views

2 Answers

0 votes
0 votes
A)the list of names of students with 100 marks in mathematics

1 comment

Wrong answer. Answer should be B. It gives names of all students of classes where atleast one student scored 100 in mathematics.
0
0
0 votes
0 votes
answer is B
“class_name=(SELECT class_name FROM students WHERE math_marks=100)”

Selecting classname of students who have scored 100 marks in maths , 
from a relation called student .



 “SELECT student_name FROM students WHERE class_name= “

Selecting student names from the student relation where there’s atleast 
1 student who has scored 100 marks in math..
So basically printing names of all students of a classname in which 
atleast 1 student has scored 100 marks in math .

Related questions