Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following relational schemas Suppliers(sid: int, sname: VARCHAR(30)

ID: 3749302 • Letter: C

Question

Consider the following relational schemas

Suppliers(sid: int, sname: VARCHAR(30), address: VARCHAR(50))

Parts(pid: int, pname: VARCHAR(30), color: VARCHAR(10))

Catalog(sid: int, pid: int, cost: double)

Write SQL queries to find the information below

a. List sid, sname, and address of all suppliers.

b. List pid, pname for black parts only.

c. Return the number of unique parts.

d. Show all the catalog information indicating which part is supplied by which supplier in ascending order of suppliers.sname. List only the values of these attributes, Parts.pid, Parts.pname, Suppliers.sid, Suppliers.sname, and Catalogs.cost.

e. Find all distinct black parts in the Catalog. Show only the pid and pname of the black parts.

f. Find distinct sids and snames of suppliers who supply a red part or a green part.

g. Find distinct sids and snames of suppliers who supply a red part and a green part.

h. Find the snames of suppliers who supply every blue part.

i. Find the pids, pnames, and the maximum cost for that part among all the suppliers

Explanation / Answer

a

Above query will retrieve the names and the id and their respective addresses of all the suppliers  

b.

This will retrieve the part name and id those are black in colour.

c.

This will retrieve the part id of all the parts.

d.

Above query will retrieve the names of parts along with suppliers in the descending order of suppliers name.

According to the chegg Policy I am only allowed to answer 4 parts of the quest. Kindly under and post the remaining questions again.