SQL queries on following Tables SUPPLIERS,PARTS, SUPPLIER_PART Please Help me ou
ID: 3819657 • Letter: S
Question
SQL queries on following Tables SUPPLIERS,PARTS, SUPPLIER_PART
Please Help me out in these queries.
3. Get all pairs of supplier numbers who reside in the same city.
s (Supplier) SNAME Smith S2 Jones S3 Blake S4 Clark S5 Adams P Part PNAME PI Nut Bolt P2 P3 Screw P4 Screw P5 Cam P6 Cog SP 300 P2 200 400 P4, 200 PS 100 100 S2 Pu 300 P2 400 P2 200 P2 200 S4 P4 300 400 STATUS 20 30 20 30 COLOR Red Green Blue Red Blue Red CITY London Paris Paris London Athens WEIGHT CITY 12.0 17.00 17.0 14.0 12.0 19.00 London Paris Rome London Paris LondonExplanation / Answer
select sp.S# from Supplier_Part sp, Part p where p.p#=sp.p# and p.color=Red;
select s.Supplier from Supplier_Part sp, Part p, Supplier s where p.P#=sp.P# and sp.S#=s.S# and count(PNAME)<2;
select S# from supplier group by city
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.