indexcsprac
indexcsprac
MySQL Programs
1. Create table Employee having EmpID, Name, Gender, DOB with
EmpID as
Primary key.
Write queries for the following:
a. Display the Table Structure
b. Add a Column department varchar(10), Emp_Address(25)
c. Change the data type of the field Emp_Address to varchar(50)
and allow
Null values.
d. Delete the column DOB
e. Display all the records
2. Create table Customer as per following Table Instance Chart.
TABLE SALE
a. Display all the details of those watches whose name end with
“Time”
b. Display the name and price of those watches, which have a
price range in
between 5000 – 15000.
c. Display the total quantity in store of ‘Unisex’ type watches.
d. Display the watch names and the quantity sold in the first
quarter.
e. SELECT MAX(PRICE), MIN(Qty_Store) FROM WATCHES;
f. SELECT MAX(PRICE), MIN(Qty_Store) FROM WATCHES;
g. SELECT WATCH_NAME, Qty_Store,
SUM(Qty_Sold),
QTY_Store-SUM(Qty_Sold) ‘’Stock’’ FROM WATCHES W, SALE S
WHERE W.WATCHID = S.WATCHID
GROUP BY S.WATCHID;
4. Create the following tables for the database Library:
Table : BOOKS
Table : ISSUED
TABLE WORKER