Skip to content
Activities · Activity 9.14

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

b) Find the maximum and minimum commission from the SALE table.
Odisha ChseTextbookSubjective· 4mImportance★★★★★
29% · 28/95 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Use SQL aggregate functions SUM(), MAX(), and MIN() on the real SALE table of the CARSHOWROOM database — the real customer-ID column is CustId. Commission values are as printed for the full SALE table in Section 9.9 of the textbook.

The real SALE table

InvoiceNoCarIdCustIdSalePriceCommission
I00001D001C0001613248.0073589.64
I00002S001C0002590321.0070838.52
I00003S002C0004604000.0072480.00
I00004D002C0001659982.0079198.84
I00005E001C0003369310.0044318.20
I00006S002C0002620214.0074425.68

(a) Sum of Sale Price for Customer C0001

SELECT SUM(SalePrice) AS TotalSalePrice
FROM SALE
WHERE CustId = 'C0001';

Customer C0001 made two purchases: I00001 (613248.00) and I00004 (659982.00).

Total = 613248.00 + 659982.00 = 1273230.00.

Output

TotalSalePrice
1273230.00

(b) Maximum and Minimum Commission

SELECT MAX(Commission) AS MaxCommission,
       MIN(Commission) AS MinCommission
FROM SALE;
``` …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.