adplus-dvertising

Discussion Forum

Que. Consider the following relational schema:

Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)

Consider the following relational query on the above database:

SELECT S.sname
FROM Suppliers S
WHERE S.sid NOT IN (SELECT C.sid
FROM Catalog C
WHERE C.pid NOT IN (SELECT P.pid
FROM Parts P
WHERE P.color<> 'blue'))

Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the above query?
a. Find the names of all suppliers who have supplied a non-blue part.
b. Find the names of all suppliers who have not supplied a non-blue part.
c. Find the names of all suppliers who have supplied only blue parts.
d. Find the names of all suppliers who have not supplied only blue parts.
Answer:Find the names of all suppliers who have supplied a non-blue part.
Kirti :(October 23, 2020) Given the relational schema:
Suppliers (s_id:integer, s_name:string, s_adress:string)
Parts (p_id:integer, p_name:string, p_color:string)
Catalog (s_id:integer, p_id:integer, p_cost:real)
Write SQL statements for the following:
(i) List all the suppliers who supply the part with p_id=32.
(ii) List the parts whose colour is BLUE.
(iii) List those parts which are RED and whose cost is more than Rs.2000/- .
(iv) List all the suppliers who are from GUJARAT.v) List all the part_ids, colour, cost from the supplier EZPREX.
(vi) List the cost of the part_id=41.
Click Here to Reply
RAVEGA :(November 17, 2020) What are the entity integrity constrants and refrential integrity constarints in this schema?
Click Here to Reply
Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here

Similar Questions: