Dbms Lab Programs
Dbms Lab Programs
OUTPUT:
Table Created
QUERY:
Create table dept( deptno number primary key, dname varchar2(20), description varchar2(40));
lOMoARcPSD|273 440 80
OUTPUT:
Table Created
2. Initially only the few columns (essential) are to be added. Add the remaining columns
separately by using appropriate SQL command
QUERY
Alter table emp add (dob date,doj date);
OUTPUT:
Table Altered
5000. QUERY:
OUTPUT:
Table Altered
QUERY:
OUTPUT:
QUERY:
OUTPUT:
lOMoARcPSD|273 440 80
PL/SQL PROGRAM
Declare
Cursor e is select * from emp;
Begin
Update emp set hra= basic * 0.5, da= basic * 0.1, deductions= basic * 0.15, gross= basic + hra +
da, net= gross - deductions;
end;
OUTPUT:
pl/sql procedure successfully completed
QUERY:
alter table emp add dap number(5,2);
OUTPUT:
Table Altered
8. When the da becomes more than 100%, a message has to be generated and with user
permission da has to be merged with basic.
PL/SQL PROGRAM
QUERY:
Create or replace sequence
s1 Increment by 1
Start with 501
lOMoARcPSD|273 440 80
OUTPUT:
Sequence created.
10. Display all the records in both the tables.
QUERY:
OUTPUT:
QUERY:
OUTPUT: