Q. Consider the following table:


Table: ITEM


 
Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Write queries based on the table ITEM:


(a) Display the information of all the items.

(b) Display item name and price value.

(c) Display soap information.

(d) Display the item information whose name starts with letter 's'.

(e) Display a report with item number, item name and total price (total price = price * quantity).

(f) select distinct price from item;

(g) select count(distinct price) from item;


Answer :-


(a) Select * from Item ;
(b) Select Iname , price from Item ;
(c) Select * from Item where Iname = “Soap” ;
(d) Select * from Item where Iname like “S%” ;
(e) Select Itemno , Iname , ( price * quantity)as “Total price” from Item ;
(f)

distinct price
50
100
150
20

(g)

count(distinct price)
4

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post