CBSE Class 11 Informatics Practices
Question 70 of 87
Structured Query Language (SQL) — Question 31
Back to all questions 31
Question Write SQL commands for (a) to (d) and write the output for (e) on the basis of the following table:
Table: FURNITURE
| S NO | ITEM | TYPE | DATEOFSTOCK | PRICE | DISCOUNT |
|---|---|---|---|---|---|
| 1 | WhiteLotus | DoubleBed | 2002-02-23 | 3000 | 25 |
| 2 | Pinkfeathers | BabyCot | 2002-01-29 | 7000 | 20 |
| 3 | Dolphin | BabyCot | 2002-02-19 | 9500 | 20 |
| 4 | Decent | OfficeTable | 2002-02-01 | 25000 | 30 |
| 5 | Comfortzone | DoubleBed | 2002-02-12 | 25000 | 30 |
| 6 | Donald | BabyCot | 2002-02-24 | 6500 | 15 |
(a) To list the details of furniture whose price is more than 10000.
(b) To list the Item name and Price of furniture whose discount is between 10 and 20.
(c) To delete the record of all items where discount is 30.
(d) To display the price of 'BabyCot'.
(e) Select Distinct Type from Furniture;
(a)
SELECT * FROM FURNITURE
WHERE PRICE > 10000;+----+-------------+-------------+-------------+-------+----------+
| NO | ITEM | TYPE | DATEOFSTOCK | PRICE | DISCOUNT |
+----+-------------+-------------+-------------+-------+----------+
| 4 | Decent | OfficeTable | 2002-02-01 | 25000 | 30 |
| 5 | Comfortzone | DoubleBed | 2002-02-12 | 25000 | 30 |
+----+-------------+-------------+-------------+-------+----------+
(b)
SELECT ITEM, PRICE
FROM FURNITURE
WHERE DISCOUNT BETWEEN 10 AND 20;+--------------+-------+
| ITEM | PRICE |
+--------------+-------+
| Pinkfeathers | 7000 |
| Dolphin | 9500 |
| Donald | 6500 |
+--------------+-------+
(c)
DELETE FROM FURNITURE WHERE DISCOUNT = 30;(d)
SELECT PRICE
FROM FURNITURE
WHERE TYPE = 'BabyCot';+-------+
| PRICE |
+-------+
| 7000 |
| 9500 |
| 6500 |
+-------+
(e)
SELECT DISTINCT Type FROM Furniture;+-------------+
| Type |
+-------------+
| DoubleBed |
| BabyCot |
| OfficeTable |
+-------------+