Q. Write SQL Commands for (i) to (v) and write the outputs for (vi) to (vii) on the basis of the following table:
Table: FURNITURE
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 | Baby Cot | 2002-02-24 | 6500 | 15 |
(i) To list the details of furniture whose price is more than 10000.
(ii) To list the Item name and Price of furniture whose discount is between 10 and 20.
(iii) To delete the record of all items where discount is 30.
(iv) To display the price of 'Baby Cot'.
(v) To list item name, type and price of all items whose names start with 'D'.
(vi) Select Distinct Type from Furniture;
(vii) Select Max(Price) from Furniture where DateofStock >' 2002-02-15';
(viii) Select Count(*) from Furniture where Discount < 25;
Answer =
(i)
Select * from FURNITURE where PRICE > 10000 ;
(ii)
Select ITEM , Price from FURNITURE where DISCONT between 10 and 20 ;
(iii)
Delete from FURNITURE where DISCOUNT = 30 ;
(iv)
Select PRICE from FURNITURE where TYPE = “BabyCot” ;
(v)
Select ITEM , TYPE , PRICE from FURNITURE where ITEM like “D%” ;
(vi)
TYPE |
DoubleBed |
BabyCot |
OfficeTable |
(vii)
Max(Price) |
25000 |
(viii)
Count(*) |
3 |
vii why should it be 2500
ReplyDeleteSorry, it must be 25000
Deleteshouldn't it be 9500?
DeleteKya hua kase hua
ReplyDeletemai samajh nahi pa raha hu.
DeleteI request you sir please recheck your answers most if them are wrong!!!!
ReplyDeletePlease tell me which is wrong answer.
Delete6th one is wrong sir
ReplyDeleteOk, I have corrected it.
DeleteI think (Vii) would be 9500
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )