Consider the schema Sailors(sid, sname, rating, age) with the following data:…
ISRO Scientist/Engineer SC · December 2017 · Computer Science
Consider the schema Sailors(sid, sname, rating, age) with the following data:
sid | sname | rating | age |
|---|---|---|---|
22 | Dustin | 7 | 45 |
29 | Borg | 1 | 33 |
31 | Pathy | 8 | 55 |
32 | Robert | 8 | 25 |
58 | Raghu | 10 | 17 |
64 | Herald | 7 | 35 |
71 | Vishnu | 10 | 16 |
74 | King | 9 | 35 |
85 | Archer | 3 | 26 |
84 | Bob | 3 | 64 |
96 | Flinch | 3 | 17 |
For the query
SELECT S.rating, AVG(S.age) AS avgage FROM Sailors S
Where S.age >= 18
GROUP BY S.rating
HAVING 1 < (SELECT COUNT(*) FROM Sailors S2 where S.rating = S2.rating)The number of rows returned is
- A.
6
- B.
5
- C.
4
- D.
3
Attempted by 36 students.
Sign up free to check your answer
Sign up freeLoading lesson…