Use Query By Example (QBE) to express queries 1,2,4,5,7,8 SP Suppliers SHSNAME S
ID: 3590734 • Letter: U
Question
Use Query By Example (QBE) to express queries 1,2,4,5,7,8 SP Suppliers SHSNAME STATUS CITY SH P# QTY. S P 300 S P2 200 SP3 400 S P4 200 SIP5 100 S P6 100 S2 P 300 S2 P2 400 S3 P 300 S3P2 200 S4P2 200 S4 P3 300 S4P4 400 S4P 500 S4P6 600 S1 Smith20 London S2 Jones 30 Paris S2 Jones S3Blake S4Clark S5 Adams 30 20 London 30 Athens Paris Parts PA PNAME COLOR WEIGHT CITY S2P2 P Nut P2 BoltGreen P3 Screw P4 Screw Red P5 Cam Red 12.0London 17.0 17.0 Paris Blue Oslo 0London Blue 12.0 Paris Red 19.0 LondonExplanation / Answer
1. Select p.PNAME from parts as p, suppliers as s and SP as SP where s.S#=sp.S# and sp.P#=p.P#
2. Select s.SNAME from suppliers as s, SP as sp where (Select S# from SP where P#=P2) = s.S#
4. Select s.SNAME from suppliers as s, SP as sp where (Select S# from SP where qty<300) = s.S#
5. Select s.SNAME from suppliers as s, SP as sp and parts as p where (Select p# from parts where color=blue or color=green) = sp.P# and sp.S#=s.S#
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.