Given tables above, write the sql statement AND RESULTING TABLE for following: a
ID: 3562851 • Letter: G
Question
Given tables above, write the sql statement AND RESULTING TABLE for following:
a. Get supplier numbers for suppliers supplying at least one part supplied by at least one
supplier who supplies at least one red part.
b. Get part numbers for parts supplied to all projects in London.
c. Get all pairs of supplier numbers, say Sx and Sy, such that Sx and Sy supply exactly the
same set of parts each.
Explanation / Answer
a)Select JNO,JNAME from PROJECT where JNO IN (SELECT JNO from SPJ where SNO=S2);
b)Select * from PART where PNO IN(Select PNO from SPJ where SNO=(Select SNO from SUPPLIER where CITY='London'));
c)Select * from SPJ where QTY>=300 AND QTY<=750
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.