0% found this document useful (0 votes)
17 views9 pages

T DBMS

The document contains SQL commands to create a table called Employees1 with columns for employee ID, name, department, position, and level. It then inserts sample data for 11 employees. It performs queries using selection, filtering, ordering, grouping and aggregation on the employee table.

Uploaded by

om khandebharad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views9 pages

T DBMS

The document contains SQL commands to create a table called Employees1 with columns for employee ID, name, department, position, and level. It then inserts sample data for 11 employees. It performs queries using selection, filtering, ordering, grouping and aggregation on the employee table.

Uploaded by

om khandebharad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Program No:-03

Name:-Prathmesh.B.Trikal
Roll No:-60
Create a Base Table.
create table Employees1(Eid number(10),Ename varchar(30),Edepartment
varchar(30),Eposition varchar(30),Elevel number);
desc Employees ;
insert into employees values(101,'David','Manager','IT',1);
insert into employees values(102,'Julia','Manager','HR',1);
insert into employees values(103,'sophie','Manager','Marketing',1);
insert into employees values(104,'Vikey','Sales Rep','Marketing',2);
insert into employees values(105,'Julia','Junior Rep','Marketing',2);
insert into employees values(106,'Wayne','HR Supervisor','HR',2);
insert into employees values(107,'Jack','Office Boy','HR',3);
insert into employees values(108,'John','Techinican','IT',2);
insert into employees values(109,'Suan','QA Expert','IT',2);
select * from employees;

OUTPUT:-
Program No:02
Name:- Prathmesh.B.Trikal
Roll No:-60

Execute the DML commands in RDBMS


Insert Command :-
insert into employees values(110,'Jacob','QA Assistant','IT',3);
select * from employees;

OUTPUT:-

Update Command:-
update Employees set Ename= 'Julia Manson' where Eid=105;
select * from employees;

OUTPUT:-
Delete Command:-
delete from Employees where eid=107;
select * from employees;

OUTPUT:-
Program No:-01
Name:- Prathmesh.B.Trikal
Roll No:-60
Execute the Queries using the select commands.(Order By, Group By and
Having Clause.)
Order ByClause :-
select*from employees order by Ename desc;

OUTPUT:-

Group ByClause :-
select edepartment from employees group by edepartment;

OUTPUT:-
Having Clause:-
select edepartment,count(*) from employees having count(*)>=1 group by edepartment;

OUTPUT:-
Program No:- 04
Name:- Prathmesh.B.Trikal
Roll No:-60
Perform like, Between, in operator on Base Table.
Like Operator:-
select * from employees1 where ename like 'J%';

OUTPUT:-

BetweenOperator :-
select * from employees1 where eidbetween 104 and 107;

INOperator :-
select * from employees1 where eid in (101,103,109);

OUTPUT:-
Program No:- 05
Name:- Prathmesh.B.Trikal
Roll No:-60

Perform logical and Relational operator on Base Table.


Logical operator:-
AND-
select * from employees1 where elevel=1 and edepartment='Manager';

OUTPUT:-

OR :-
select * from employees1 where elevel=1 or edepartment='office boy';

OUTPUT:-

NOT:-
select * from employees1 where not elevel=2;

OUTPUT:-
Relational Operator:-
Equal operator (=) :-
select * from employees1 where elevel=2;

OUTPUT:-

Less than Operator(<):-


select * from employees1 where elevel<2;

OUTPUT:-

Greater than operator(>):-


OUTPUT:-
Less than Equal to Operator:-
select * from employees1 where elevel<=2;

OUTPUT:-

Greater than Equal to operator:-


select * from employees1 where elevel>=2;

OUTPUT:-

You might also like