DB Assignment1
DB Assignment1
DB Assignment1
Ali Farooq
create database client_product
client_no nvarchar(6),
name nvarchar(20),
address1 nvarchar(30),
address2 nvarchar(30),
city nvarchar(15),
state nvarchar(30),
pincode int,
bal_due float
)
product_no nvarchar(6),
description nvarchar(20),
profit_percent int,
unit_measure nvarchar(30),
qty_on_hand int,
reorder_lvl int,
sale_price float,
cost_price float
)
Q2: Retrieve the list of names and cities of all the clients.
select name,city from client_master
Q3: List the various products available from the product_master table.
select description from product_master
Q6: Find the products with description as ‘1.44 drive’ and ‘1.22 Drive’.
select * from product_master where description in ('1.44 Drive','1.22 Drive');
Q7: Find all the products whose sell price is greater then 5000
select * from product_master where sale_price > 5000
Q8: Find the list of all clients who stay in in city ‘Bombay’ or city ‘Delhi’ or
‘Madras’.
select * from client_master where city in('Bombay','Delhi','Madras');
Q9: Find the product whose selling price is greater than 2000 and less than or
equal to 5000.
select * from product_master where sale_price between 2000 and 5000;
Q10: List the name, city and state of clients not in the state of ‘Maharashtra
select name, city, state from client_master where not state='Maharashtra';