Lab Assignment-I: Q 1. Create The Table Describe Below
Lab Assignment-I: Q 1. Create The Table Describe Below
Lab Assignment-I: Q 1. Create The Table Describe Below
0801CA181026
Lab Assignment-I
1
Shivani Alya
0801CA181026
PRODUCTNO Varchar2 6
DESCRIPTION Varchar2 15
PROFITPERCENT Number 4,2
UNITMEASURE Varchar2 10
QTYONHAND Number 8
REORDERLVL Number 8
SELLPRICE Number 8,2
COSTPRICE Number 8,2
2
Shivani Alya
0801CA181026
SALAMT Number 8,2
TGTTOGET Number 6,2
YTDSALES Number 6,2
REMARKS Varchar2 60
3
Shivani Alya
0801CA181026
Q 2. Insert the following data into their respective tables:
4
Shivani Alya
0801CA181026
5
Shivani Alya
0801CA181026
6
Shivani Alya
0801CA181026
`UNITMEASURE`, `QTYONHAND`, `REORDERLVL`, `SELLPRICE`, `COSTPRICE`) values
('P07975', 'Lycra tops',5,"Piece",70,30,300,175);
7
Shivani Alya
0801CA181026
9
Shivani Alya
0801CA181026
c. Retrieve the list of names, city, and the state of all clients.
Query: select NAME,CITY,STATE from CLIENT_MASTER;
10
Shivani Alya
0801CA181026
e. List all the clients who are located in mumbai.
Query: mysql> select * from CLIENT_MASTER where CITY="Mumbai";
f. Find the names of salesman who have a salary equal to Rs. 3000.
Query: mysql> select SALESMANNAME from SALESMAN_MASTER where SALAMT=3000;
11
Shivani Alya
0801CA181026
b. Change the Baldue of ClientNo 'C00001' to Rs. 1000.
Query: mysql> UPDATE CLIENT_MASTER SET BALDUE=1000 WHERE
CLIENTNO="C00001";
12
Shivani Alya
0801CA181026
a. Delete all salesman from the Salesman_Master whoes salary are equal to 3500.
Query: mysql> DELETE FROM SALESMAN_MASTER WHERE SALAMT=3500;
b. Delete all products from Product_Master where the quantity on hand is equal to 100.
Query: mysql> DELETE FROM PRODUCT_MASTER WHERE QTYONHAND=100;
13
Shivani Alya
0801CA181026
c. Delete from Client_Master where the column state holds the value 'Tamilnadu'.
Query: mysql> DELETE FROM CLIENT_MASTER WHERE STATE= 'Tamil Nadu';
a. Add a column called 'Telephone' of datatype 'number' and size = '10' to the Client_Master table.
Query: mysql> ALTER TABLE CLIENT_MASTER ADD TELEPHONE varchar(10);
14
Shivani Alya
0801CA181026
Q 8. Exercise on renaming the table.
15