ExNo:1
SQL
create table Employee
(eno integer PRIMARY KEY,
ename VARCHAR(20),
deptname VARCHAR(5),
salary NUMBER,
deptno NUMBER);
insert into Employee VALUES(10405,'Karthiga','IT',60000,02);
insert into Employee VALUES(11594,'Ram','MECH',36000,05);
insert into Employee VALUES(37813,'Rajesh','IT',45000,02);
insert into Employee VALUES(42100,'Arthi','CSE',50000,01);
insert into Employee VALUES(47800,'Joseph','ECE',45000,03);
create table Dept
(deptno NUMBER,
deptname VARCHAR(5),
Mname VARCHAR(20));
insert into Dept values(02,'IT','Nithish');
insert into Dept values(05,'MECH','Johnson');
insert into Dept values(02,'IT','Nithish');
insert into Dept values(01,'CSE','Geetha');
insert into Dept values(03,'ECE','Rajesh');
create table Contact
(eno REFERENCES Employee(eno),
door_no VARCHAR(5),
city VARCHAR(30),
Pincode NUMBER,
mob_no NUMBER,
mail_id VARCHAR(50));
insert into Contact values(10405,'A19','Chennai',600045,9370775082,'karthiga02@gmail.com');
insert into Contact values(11594,'21D','Kanchipuram',601103,8148772227,'ram05@gmail.com');
insert into Contact values(37813,'19A','Chennai',600073,7299255605,'rajesh02@gmail.com');
insert into Contact values(42100,'03','Chennai',650018,9444556073,'arthi01@gmail.com');
insert into Contact values(47800,'1C','Chengalpatt',601708,8781100543,'joseph03@gmail.com');
create table Salary
(eno integer REFERENCES Employee(eno),
basic_salary NUMBER,
HRA NUMBER,
DA NUMBER);
insert into Salary values(10405,60000,18000,9000);
insert into Salary values(11594,36000,10000,5000);
insert into Salary values(37813,45000,9000,6500);
insert into Salary values(42100,50000,6000,4000);
insert into Salary values(47800,45000,7100,4600);
select * from Employee;
select * from Dept;
select * from Contact;
select * from Salary;
select ename,deptname from Employee where eno=10405 and deptno=02;
select Mname from Dept where deptname='IT' or deptname='CSE';
select ename from Employee where ename like 'R%';
select * from Employee order by ename;
alter table Salary add gross_salary NUMBER;
update Salary SET gross_salary=basic_salary+HRA+DA;
select * from Salary;
delete from Contact where eno=47800;
select * from Contact;
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.