***SQL DML*** Write SQL statements to answer the following questions. Note that
ID: 3775762 • Letter: #
Question
***SQL DML***
Write SQL statements to answer the following questions. Note that you do not need data tuples to answer these questions. Use the following relational schema.
Supplier (sid, name, status, city)
Part (pid, name, color, weight, city)
Job (jid, name, city)
Supplies (/sid/, /pid/, /jid/, quantity)
What are the id and the name of all suppliers for parts supplied to at least two different jobs?
Supplier (sid, name, status, city)
Part (pid, name, color, weight, city)
Job (jid, name, city)
Supplies (/sid/, /pid/, /jid/, quantity)
Explanation / Answer
Select distinct supplier.sid, supplier.name from Supplier, Part , Supplies where Supplier.sid = Supplies.sid and Part.pid = Supplies.pid and city = ‘London’ having count (Part.pid) > 1
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.