Skip to content
Activities · Activity 1.1

Q.Using the table SALE of CARSHOWROOM database, write SQL queries for the following:

(a) Display the InvoiceNo and commission value rounded off to zero decimal places.
(b) Display the details of SALE where payment mode is credit card.
Puducherry TnboardTextbookSubjective· 3mImportance★★★★★
5% · 2/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 →

ROUND(Commission, 0) rounds the commission to a whole number; WHERE PaymentMode = 'Credit Card' filters to only credit-card sales — both on the real SALE table (with Commission already filled in by Example 1.2, 12% of SalePrice).

This is a code/query task on the SALE table:

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) ROUND(Commission, 0) rounds each commission to the nearest whole rupee:

SELECT InvoiceNo, ROUND(Commission, 0) FROM SALE;
InvoiceNoROUND(Commission, 0)
I0000173590
I0000270839
I0000372480
I0000479198
I0000544317
I0000674426

(b) A WHERE clause filters to only the credit-card rows:

SELECT * FROM SALE WHERE PaymentMode = 'Credit Card';
``` …

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.