given tables above, write sql statements AND RESULTING TABLE for following: Get
ID: 3562943 • Letter: G
Question
given tables above, write sql statements AND RESULTING TABLE for following:
Get all supplier-number part-number/project-number triples such that the indicated supplier, part and project are all co-located (i.e., all in the same city). Get all supplier-number,1 part-number/project-number triples such that the indicated supplier, part and project are not all co-located (i.e., one pair co-location allowed). Get all supplier-number part-number project-number triples such that the indicated supplier, part, and project are all located in different cities.Explanation / Answer
a) select s.SNo,p.PNO,j.JNO from supplier s inner join part p ON s.city = p.city inner JOIN project j on p.city = j.jcity;
b) select s.SNo,p.PNO,j.JNO from supplier s inner join part p ON s.city = p.city or s.city != p.city inner JOIN project j on p.city != j.jcity;
c) select s.SNo,p.PNO,j.JNO from supplier s inner join part p ON s.city Q= p.city inner JOIN project j on p.city != j.jcity;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.