Skip to content
Activities · Activity 1.5

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.
Uttar Pradesh UpmspTextbookSubjective· 3mImportance★★★★★
25% · 10/40 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 →

SUM() totals SalePrice for a filtered customer; MAX()/MIN() find the highest and lowest Commission across the whole SALE table — the same real CARSHOWROOM data used throughout this chapter.

This is a code/query task on the SALE table (with the Commission column added and filled in Example 1.2):

InvoiceNoCarIdCustIdSaleDatePaymentModeEmpIDSalePriceCommission
I00001D001C00012019-01-24Credit CardE004613247.0073589.64
I00002S001C00022018-12-12OnlineE001590321.0070838.52
I00003S002C00042019-01-25ChequeE010604000.0072480.00
I00004D002C00012018-10-15Bank FinanceE007659982.0079197.84
I00005E001C00032018-12-20Credit CardE002369310.0044317.20
I00006S002C00022019-01-30Bank FinanceE007620214.0074425.68

(a) Filter to customer C0001, then total the SalePrice column:

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

C0001 appears in two rows — I00001 (613247.00) and I00004 (659982.00). SUM() adds them: 613247.00 + 659982.00 = 1273229.00. …

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.