GATE CS 2020 · Question 23 · Databases · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider a relational database containing the following schemas.
Catalogue
Suppliers
Parts
The primary key of each table is indicated by underlining the constituent fields.
SELECT s.sno, s.sname FROM Suppliers s, Catalogue c WHERE s.sno = c.sno AND cost > (SELECT AVG (cost) FROM Catalogue WHERE pno = 'P4' GROUP BY pno);
The number of rows returned by the above SQL query is

snopnocost
S1P1150
S1P250
S1P3100
S2P4200
S2P5250
S3P1250
S3P2150
S3P5300
S3P4250
snosnamelocation
S1M/s Royal furnitureDelhi
S2M/s Balaji furnitureBangalore
S3M/s Premium furnitureChennai
pnopnamepart_spec
P1TableWood
P2ChairWood
P3TableSteel
P4AlmirahSteel
P5AlmirahWood
  1. (A) 4
  2. (B) 5
  3. (C) 0
  4. (D) 2
Answer

Answer (A)

Answer from the official GATE CS 2020 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes