English

Find sum of Sale Price of the cars purchased by the customer having ID C0001 from table SALE.

Advertisements
Advertisements

Question

Find sum of Sale Price of the cars purchased by the customer having ID C0001 from table SALE.

Code Writing
Advertisements

Solution

SELECT SUM(SalePrice) AS Total_Sale_Price
FROM SALE
WHERE CustId = 'C0001';
  • SUM(SalePrice): Adds up all the values in the Sale Price column.
  • WHERE CustomerID = 'C0001': Filters the table so it only calculates the sum for the customer with ID C0001.
shaalaa.com
  Is there an error in this question or solution?
Chapter 1: Querying and SQL Functions - Intext Questions [Page 14]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 1 Querying and SQL Functions
Intext Questions | Q a) | Page 14
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×