Christine Cloma

SQL Problem 2

So, here’s the continuation of the SQL Problem I posted .. 🙂

Q2. Find the value of each product sold.

Code:

SELECT Product.CostPrice
FROM Product INNER JOIN SalesOrderDetail 
ON Product.ProductNo = SalesOrderDetail.ProductNo;

Output:

Q2

Q4. Find out the products which has been sold to Ivan.

Code:

SELECT Product.Description, Product.[Qty_on-hand], Client.ClientName
FROM ((Product INNER JOIN SalesOrderDetail ON Product.ProductNo = SalesOrderDetail.ProductNo) 
INNER JOIN SalesOrder ON SalesOrderDetail.SOrderNo = SalesOrder.SOrderNo) INNER JOIN Client 
ON SalesOrder.ClientNo = Client.ClientNo
WHERE Client.ClientName="Ivan" OR Client.ClientName='Vandana';