Advertisements
Advertisements
Question
Consider the table SALES as given below:

Write the following queries:
- To display the total quantity sold for each product whose total quantity sold exceeds 12.
- To display the records of SALES table sorted by Product name in descending order.
- To display the distinct Product names from the SALES table.
- To display the records of customers whose names end with the letter ‘e’.
Code Writing
Advertisements
Solution
SELECT Product, SUM(Quantity_Sold) FROM SALES GROUP BY Product HAVING SUM(Quantity_sold) > 12;SELECT * FROM SALES ORDER BY Product DESC;SELECT DISTINCT Product FROM SALES;SELECT * from SALES where Customer_Name like "%e";
shaalaa.com
Is there an error in this question or solution?
