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
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
| InvoiceNo | CarId | CustId | SalePrice | Commission |
|---|---|---|---|---|
| I00001 | D001 | C0001 | 613248.00 | 73589.64 |
| I00002 | S001 | C0002 | 590321.00 | 70838.52 |
| I00003 | S002 | C0004 | 604000.00 | 72480.00 |
| I00004 | D002 | C0001 | 659982.00 | 79198.84 |
| I00005 | E001 | C0003 | 369310.00 | 44318.20 |
| I00006 | S002 | C0002 | 620214.00 | 74425.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.