Question: E 5 . 1 . 2 2 Display the ProductID and ProductName of the product for the products whose total quantity sold in all transactions

E5.1.22 Display the ProductID and ProductName of the product for the products whose total quantity sold in all transactions
is greater than 2. Sort the results by ProductID.
E5.1.24 Rewrite Query 30 using a join statement (no nested queries). Query 30 text: For each product that has more than three items
sold within all
sales transactions, retrieve the product ID, product name, and
product price
Query 30: SELECT productid, productname, productprice
FROM product
WHERE productid IN
(SELECT productid
FROM includes
GROUP BY productid
HAVING SUM(quantity)>3);
E5.1.25 Rewrite Query 31 using a join statement (no nested queries). Query 31 text: For each product whose items were sold in more
than one sales transaction, retrieve the product id, product
name and
product price
Query 31 : SELECT productid, productname, productprice
FROM product
WHERE productid IN
(SELECT productid
FROM includes
GROUP BY productid
HAVING COUNT(*)>1);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!