PRACTICAL ASSIGNMENT – 10
1. Create the following table and insert some records.
Table Name: Employee
Field Datatype
EmpId Number
Name Varchar2
DOJ Date
JobId Varchar2
Salary Number
Dept Varchar2
EmpId Name DOJ JobId Salary Dept
100 Aman Jain 17-June-2017 AD_PRES 24000.00 Admin
101 Yash Kumar 15-July-2019 AD_VP 17000.00 Admin
102 Ayushi 12-Aug-2017 IT_PROG 9000.00 IT
103 Kamal 15-Sept-2016 IT_PROG 6000.00 IT
105 Madhav Mohan 14-July-2018 IT_PROG 4000.00 IT
106 Astha Sharma 27-June-2017 PU_CLERK 2500.00 Finance
Write the following queries over the said table
1.1 Write a query to display the name for those employees who gets more salary
than the employee whose id is 105.
1.2 Write a query to display the name, salary, department id, job id for those
employees who works in the same designation as the employee works whose
id is 103.
1.3 Write a query to display the name, salary, department id for those employees
who earn such amount of salary which is the smallest salary of any of the
departments.
1.4 Write a query to display the employee details who are having the same date of
birth as of employee having id 106.
1.5 Write a query to display the employee details who are having the date of birth
after the date of birth of employee having ID 102.
1.6 Display Employee Id and Name of those employees who are getting salary
more than the average salary of all the employees.
1.7 Write the query to display the Employee Id and Name of the employee who
gets the 2nd highest salary.