Friday, 26 February 2016

11th & 12th IP 2012(Ooutside.Delhi) common assign




                                                                                       

5-(c)

































ANS
Consider the Table SHOPPI given below. Write command in MySql for (i) to(iv) and output for (v) to(vii)


Table SHOPPI:
CODE
ITEM
COMPANY
QTY
CITY
PRICE
102
Biscuit
Hide&Seek
100
Delhi
10.00
103
Jam
Kissan
110
Kolkata
25.00
101
Coffee
Nestle
200
Kolkata
55.00
106
Sauce
Maggi
56
Mumbai
55.00
107
Cake
Britannia
72
Delhi
10.00
104
Maggi
Nestle
150
Mumbai
10.00
105
Chocolate
Cadbury
170
Delhi
25.00

i) To display names of the items whose name starts with ‘C’ in ascending order of Price.

ii) To display code, Item name and city of the products whose quantity is less then 100.

iii) To count distinct Company from the table.

iv) To insert a new row in the table Shoppi ‘110’,’Pizza’,’Papa Jones’,’120’,’Kolkata’,50.00.

v)  Select Item from Shoppi where Item IN(“jam”,”Coffee”);

vi) Select count(distinct(City) ) from Shoppi;

vii)  Select MIN(qty) from Shoppi where City=“Mumbai”;


i)


Ii)

iii)

iv)
v)

vi)  3


vIi)


                                                               
7














1


1


1


1


1

1

1








                                                                                                                   


No comments:

Post a Comment