dbms1 3
dbms1 3
PROGRAM:
create table Team2(tname number, tmembers varchar(10), age number ,dob number);
alter table Team2 add (dept varchar(20));
rename Team2 to Sport1;
drop table Sport1;
desc Sport1;
OUTPUT:
RESULT:
REGNO:311521205305
PROGRAM:
create table Play (tname varchar(20), tmembers varchar(20), age number ,dob number);
insert into Play values('India','Mary Kom',40,24-11-1982);
insert into Play values('India','Sania Mirza',36,15-11-1986);
insert into Play values('India','Virat Kholi',34,05-11-1988);
select tname,tmembers,age from Play where age between 30 and 37;
select tname,tmembers,age from Play where age not between 30 and 37;
select tname,tmembers,age from Play where age in 34;
select tname,tmembers,age from Play where age not in 34;
select * from Play;
select * from Play order by AGE asc;
OUTPUT:
RESULT:
REGNO:311521205305
PROGRAM:
OUTPUT:
REGNO:311521205305
RESULT:
REGNO:311521205305
PROGRAM:
INNER JOIN:
SELECT e.id, e.name, e.salary, e.age, p.location FROM employees e INNER JOIN emp p on e.id=p.id;
RIGHT JOIN:
SELECT e.id, e.name, e.salary, e.age, p.location FROM employees e RIGHT JOIN emp p on e.id=p.id;
LEFT JOIN:
SELECT e.id, e.name, e.salary, e.age, p.location FROM employees e LEFT JOIN emp p on e.id=p.id;
FULL JOIN:
SELECT e.id, e.name, e.salary, e.age, p.location FROM employees e LEFT JOIN emp p on
e.id=p.id UNION ALL
SELECTe.id,e.name,e.salary,e.age,p.locationFROMemployeeseRIGHTJOINemppone.id=p.id;
OUTPUT:
Employees table:
Emp table:
INNER JOIN:
REGNO:311521205305
RIGHT JOIN:
LEFT JOIN:
FULL JOIN:
RESULT:
REGNO:311521205305
PROGRAM:
TABLE 1:
TABLE 2:
OUTPUT:
TABLE 2:
OUTPUT:
RESULT: