GATE Computer Science (CS) 2020 Solved Papers

© examsiri.com
Question : 19 of 65
 
Marks: +1, -0
Consider a relational database containing the following schemas.
Catalogue
snopnocost
s1p1150
s1p150
s1p3100
s2p4200
s2p5250
s3p1250
s3p2150
s3p5300
s3p4250
Suppliers
snosnamelocation
s1M/s Royal furnitureDelhi
s2M/s Balaji furnitureBangal
s3M/s Premium furnitureChennai
Parts
pnopnamepart_spec
p1TableWood
p2ChairWood
p3TableSteel
p4AlmirahSteel
p5AlmirahWood
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
Go to Question: