Redirected
edited by
1,078 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$

edited by

2 Answers

0 votes
0 votes
A)the list of names of students with 100 marks in mathematics
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

1 votes
1 votes
1 answer
1
go_editor asked Mar 28, 2020
813 views
A primary key for an entity is :a candidate keyany attributea unique attributea superkey
0 votes
0 votes
1 answer
2
go_editor asked Mar 28, 2020
467 views
Aggregate functions in SQL are :GREATEST, LEAST and ABSSUM, COUNT and AVGUPPER, LOWER and LENGTHSQRT, POWER and MOD
0 votes
0 votes
1 answer
3
go_editor asked Mar 28, 2020
629 views
The end of an SQL command is denoted by :an end-of-line characteran ‘enter-key’ markerentering F4 keya semicolon (;)
2 votes
2 votes
1 answer
4