23BCE309_DBMS
23BCE309_DBMS
2 (clientno varchar2(6),
3 name varchar2(20),
4 city varchar2(15),
5 pincode number(8),
6 state varchar2(15),
7 baldue number(10,5));
Table created.
Create table product (used to store client information) having following attributes:
2 (productno varchar2(6),
3 description varchar2(15),
4 profitpercent number(4,2),
5 unitmeasure varchar2(10),
6 qtyonhand number(8),
7 reorderlvl number(8),
8 sellprice number(8,2),
9 costprice number(8,2));
Table created.
Create table salesman (used to store client information) having following attributes:
2 (salesmanno varchar2(6),
3 salesmanname varchar2(20),
4 address1 varchar2(30),
5 address2 varchar2(30),
6 city varchar2(20),
7 pincode number(8),
8 state varchar2(20),
9 salamt number(8,2),
10 tgttoget number(6,2),
11 ytdsales number(6,2),
12 remarks varchar2(60));
Table created.
Create table sales_order(used to store client information) having following attributes:
2 (orderno varchar2(6),
3 clientno varchar2(6),
4 orderdate date,
5 salesmanno varchar2(6),
6 delaytype char(1),
7 billyn char(1),
8 delaydate date,
9 orderstatus varchar2(10));
Table created.
2 (orderno varchar2(6),
3 productno varchar2(6),
4 qtyordered number(8),
5 productrate number(10,2));
Table created.
1 row created.
SQL> /
1 row created.
SQL> /
1 row created.
SQL> /
Enter value for state: KARNATAKA Enter value for baldue: 0 old 1: INSERT INTO client
1 row created.
SQL> /
VALUES('C05','HARSH DESAI','MUMBAI',400060,'MAHARASHTRA',2000)
1 row created.
SQL> /
Enter value for state: KARNATAKA Enter value for baldue: 0 old 1: INSERT INTO client
1 row created.
SQL> /
VALUES('P03453','MONITORS',6,'PIECE',10,3,12000,11200)
1 row created.
SQL> /
FLOPIES',5,'PIECE',100,20,525,500)
1 row created.
SQL> /
1 row created.
SQL> /
1 row created.
SQL> /
Enter value for salesmanno: S03
1 row created.
SQL> /
1 row created.
SQL> INSERT INTO sales_order VALUES('O19001','C01','12-JAN-16','S01','F','N','20-JAN-16','IN
PROCESS');
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
SQL> INSERT INTO sales_order_details VALUES('O19001','P00001',4,525)
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
4. Do as directed:
a) Change the city of Harsh to Bangalore.
b) Change the city of salesman to Pune. What is wrong in doing this type of
query?
c) Delete all the salesmen whose salaries are equal to Rs. 3500.
d) Delete all the clients who live in “Tamil Nadu”.
e) Add a column called “Telephone” of data type “Number” and size “10” to
the client table.
f) Change the size of sell price to 6, 2. Observe the behavior.
g) Change the name of salesman table to sman.
h) Create a new table sales_order_new from sales_order containing data as well
as structure.
i) Create a new table order_details from sales_order_details containing only
the structure (no data).