English

Consider the table SALES as given below: Write the following queries: I. To display the total quantity sold for each product whose total quantity sold exceeds 12. - Computer Science (Python)

Advertisements
Advertisements

Question

Consider the table SALES as given below:

Write the following queries:

  1. To display the total quantity sold for each product whose total quantity sold exceeds 12.
  2. To display the records of SALES table sorted by Product name in descending order.
  3. To display the distinct Product names from the SALES table.
  4. To display the records of customers whose names end with the letter ‘e’.
Code Writing
Advertisements

Solution

  1. SELECT Product, SUM(Quantity_Sold) FROM SALES GROUP BY Product HAVING SUM(Quantity_sold) > 12;
  2. SELECT * FROM SALES ORDER BY Product DESC;
  3. SELECT DISTINCT Product FROM SALES;
  4. SELECT * from SALES where Customer_Name like "%e";
shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×