0% found this document useful (0 votes)
13 views1 page

1 Ans

The document creates an Employee table with columns like Name, EMPNO, ENAME, JOB, etc and inserts values into the table. It then runs various queries on the Employee table like finding MIN, MAX, AVG of SAL, difference between MAX and MIN salary, employees whose salary is more than minimum and job starts with M, sum of salary by job, minimum salary for each manager.

Uploaded by

Ayush Kashyap
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)
13 views1 page

1 Ans

The document creates an Employee table with columns like Name, EMPNO, ENAME, JOB, etc and inserts values into the table. It then runs various queries on the Employee table like finding MIN, MAX, AVG of SAL, difference between MAX and MIN salary, employees whose salary is more than minimum and job starts with M, sum of salary by job, minimum salary for each manager.

Uploaded by

Ayush Kashyap
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/ 1

create table Employee(Name varchar(20),EMPNO number(4) not null,ENAME varchar2(10),JOB

varchar2(9),MGR number(4),HIERDATE date,SAL number(7,2),COMM number(7,2),DEPTNO


number(3),AGE number(3),ESAL number(10));

insert into Employee


values('SRISTI',100,'ASTHA','ENGINNER',10,'21/JUNE/2005',12345.76,7890.88,100,23,7654);

insert into Employee


values('ISHAN',102,'ARPITA','MANAGER',20,'21/JULY/2005',34567.89,8388.86,101,24,8844);

insert into Employee


values('PRIYA',103,'ASHISH','TEACHER',30,'21/AUG/2005',45678.09,7747.88,102,25,84943);

insert into Employee


values('RAM',104,'SHYAM','MANAGER',20,'21/Jun/2005',56789.10,2345.64,101,26,98474);

insert into Employee


values('KAJAL',105,'ASTHA','TECAHER',30,'21/Jul/2005',67890.21,23455.67,102,27,74774);

insert into Employee


values('AKSHITA',106,'DEVIKA','ENGINEER',10,'21/Aug/2005',78901.32,34555.78,100,28,66474);

insert into Employee


values('SAMEER',107,'SHREYA','MANAGER',20,'21/Sep/2005',89012.43,23455.89,101,29,774443);

select MIN(SAL),MAX(SAL),AVG(SAL) from Employee;

select MAX(SAL)-MIN(SAL) AS DIFFERENCE_IN_SALARIES from Employee;

select NAME,SAL from Employee where SAL>(select MIN(SAL) from EMPLOYEE) and JOB like 'M%';

select SUM(SAL),JOB from Employee GROUP BY JOB;

select MIN(SAL),MGR from EMPLOYEE GROUP BY MGR;

You might also like