edited by
419 views
1 votes
1 votes

Consider $\rm STUDENT$ table with following tuples:

SName   CPI
Deepak  8.7
Dilip   9.7
Kaustav 8.5
Pallab  9.8
Sourav  8.7
Swapnil 8.5
(SELECT *
FROM STUDENT S1
WHERE 3 >= (SELECT COUNT(*)
FROM STUDENT S2
WHERE S1.CPI <= S2.CPI) )
UNION
(SELECT *
FROM STUDENT S1
WHERE S1.CPI > ALL (SELECT CPI
FROM STUDENT S2
WHERE 5 >= (SELECT COUNT(*)
FROM STUDENT S3
WHERE S2.CPI <= S3.CPI)) )

How many number of tuples are there in the output ?


I'm getting $2$ as the answer, while the given answer is $4$.


 

edited by

1 Answer

Related questions

2 votes
2 votes
1 answer
1
1 votes
1 votes
2 answers
3
monty asked Nov 19, 2018
608 views
1 votes
1 votes
0 answers
4