You are on page 1of 5

DBMS WORKSHEET

VIVA
NAME: Ranjit Raj UID:20BCS9943
SECTION:44-B SUBJECT:LAB- DBMS

Q2.
Consider a relation Employee with following attributes:
Name Null Type
-------------------------------- ----------------------- -------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(3)
AGE NUMBER(3)
ESAL NUMBER(10)

a. List minimum , maximum , average salaries of employee.


b. What is the difference between maximum and minimum salaries of
employees in the organization?
c. Display all employee names and salary whose salary is greater than minimum
salary of the company and job title starts with ‘M’.
SOLUTION:
************************CREATING TABLE************************

************************INSERTING VALUES IN TABLE************************

This is optional that’s why I have typed it.


insert into employee values(101, 'Ram', 'CEO', 7839,to_date('15-11-
2000','dd-mm-yyyy'),3500, null, 10,35,null);

insert into employee values(102, 'Rahul', 'Assistant


Manager',7902,to_date('05-01-2003','dd-mm-yyyy'),1500, null,
20,25,null);

insert into employee values(103, 'Mohit', 'Manager',7566,to_date('08-


10-2002','dd-mm-yyyy'),2500, null, 30,28,null);

insert into employee values(104, 'Vishal', 'Peon',7899,to_date('03-07-


2007','dd-mm-yyyy'),900, null, 40,32,null);

insert into employee values(105, 'Raju', 'Legal


advisor',7789,to_date('07-03-2002','dd-mm-yyyy'),8000, null,
50,22,null);

************************************************************************

Questions:
A. List minimum , maximum , average salaries of employee.
B. What is the difference between maximum and minimum
salaries of employees in the organization?

C. Display all employee names and salary whose salary is greater


than minimum salary of the company and job title starts with
‘M’.

You might also like