Hi I have three tables


Suppliers, Supply and Parts. I want two queries.

a) List the name of the part along with the Total Price.

b) List the names of the supplier that list both p1(part1) and p2 (part2)

a. List the name of part and price.

SELECT pname,price
FROM parts

b. List the names of the supplier that list both p1(part1) and p2 (part2).

SELECT s.sname
FROM suppliers s
INNER JOIN supply su
ON s.s = su.s
WHERE su.p IN ('p1','p2')
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.