Skip to content
Question
Q.

Write the output (i-iii) for the following SQL commands. Table : FASHION

IDProductPriceQty
F01Kajal97010
F02Foundation210015
F03Night Cream170020
F04Day Cream140010
F05Shampoo120025
F06Lipstick85032

(i) SELECT COUNT (Product) FROM FASHION; (ii) SELECT SUM (Price*Qty) FROM FASHION WHERE Product = "Night Cream"; (iii) SELECT LEFT (Product, 4) FROM FASHION WHERE Price > 1500; OR Find the output of the following SQL queries: (i) SELECT SUBSTR ("CLIMATE CHANGE", 4, 4); (ii) SELECT UCASE (RIGHT ("Pollution", 3) ); (iii) SELECT LENGTH ("HAPPY") + 3;

CBSECBSE Class XII Board 2023Subjective· 3mImportance★★★★★
🔒 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 →

Part (a): 6 | 34000 | Foun, Nigh. Part (b): MATE | ION | 8.

Part (a)

The FASHION rows and prices: Kajal 970, Foundation 2100, Night Cream 1700, Day Cream 1400, Shampoo 1200, Lipstick 850.

(i) COUNT(Product) counts non-null product names across all six rows -> 6.

(ii) SUM(Price*Qty) for Product = "Night Cream": only F03 matches, 1700 * 20 = 34000.

(iii) LEFT(Product,4) for rows with Price > 1500. Prices above 1500 are Foundation (2100) and Night Cream (1700); Day Cream is 1400 and does NOT qualify. So the first four characters are "Foun" and "Nigh".

SELECT COUNT(Product) FROM FASHION;
SELECT SUM(Price*Qty) FROM FASHION WHERE Product = "Night Cream";
SELECT LEFT(Product,4) FROM FASHION WHERE Price > 1500;

Expected output:

6
34000
Foun
Nigh …

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.