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?
