402 - INFORMATION TECHNOLOGY
Worksheet
CLASS - X
1. Consider the following Vendor table and write the queries
VendorID VName DateofRegistration Location
V001 Mother Dairy 20-01-2009 Delhi
V002 Havmor 01-04-2015 Mumbai
V003 Amul 12-05-2012 Kolkata
V004 Kwality Walls 15-10-2013 Mumbai
a) To display the vendor name located in Mumbai
Select VName from vendor where Location = ‘Mumbai’;
b) To display the vendor ID and vendor name which is registered in the year 2013
Select VendorID,VName from vender where DateofRegistration like ‘%2013’;
c) To change the Registered date of Amul to 31-03-2015
Update vendor set DateofRegistration = ’31-03-2015’ where VName = ‘Amul’;
d) To Display Name and location of vendors
Select VName, Location from vendor;
e) Identify the columns and data types of a table
f) Columns Data type
g) VendorID Varchar
h) VName Varchar
i) DateofRegistration Date & Time
j) Location Varchar
k) Identify the primary key of the table
VendorID
2. Consider the following table “ITEM”:
Itemno Iname Price Quantity
11 Soap 40 80
22 Powder 80 30
33 Face cream 250 25
44 Shampoo 120 100
55 Soap box 20 50
a) Display the total amount of each item. The amount must be calculated as the price
multiplied by quantity for each item.
Select Price*Quantity from Item;
b) Display the details of items whose price is less than 50.
Select * from Item where price < 50;
c) Display the Item number and item name in the table whose item name starts with S
Select Itemno,Iname where Iname like ‘S%’;
d) Write query to Increment the price of soap by 2
Update Item Price = Price + 2 where Itemno = 11;
e) Display name and price of item whose id is 11 and 44
Select Iname, Price from Item where Itemno = 11 or Itemno = 44;
f) Display the details of item whose price is greater than 100
Select * from Item where price>100;