You are on page 1of 4

Question - 1

Name : Branch : CSE

UID : Subject : DBMS

Ques : 1
Create a table called Employee with the following structure.
Name Type
Empno Number
Ename Varchar2(10)
Job Varchar2(10)
Mgr Number
Sal Number

a. Add a column commission with domain to the Employee table.


b. Insert any five records into the table.

c. Update the column details of job


d. Rename the column of Employ table using alter command.

e. Delete the employee whose Empno is 105.


Program code :

create table employee


(
empno number,
emane varchar2(10),
job varchar2(10),
mgr number,
sal number
);

alter table employee


add commission varchar(10);

insert into employee


values(110,'alex','clerk',5402,3000,100);
insert into employee
values(105,'peter','manager',5112,5000,200);
insert into employee
values(169,'harry','salesman',5407,10000,300);
insert into employee
values(180,'margi','designer',5445,8000,150);
insert into employee
values(147,'suzain','analyst',5123,3000,200);

update employee
set job='salesman'

select * from employee;

alter table employee


rename column job to post;

delete from emplyee


where empno=105;

You might also like