SQL Assignment
Create below two tables
Emp
Dept
Write queries to
find 3rd highest salary (using Analytical function and without analytical function)
find highest paid employee of each department
find the top 3 salaries (using Analytical function and without analytical function)
find the last 3 rows
find 5th,6th,7th row (using Analytical function and without analytical function)
find the 9th row
find employees of those dept in which more than 2 employees are working
find employees who earns more than the avg. salary of their department
find employees who have no subordinates
if sal>1000 then display thousand , if sal is between 1000 and 2000 then display
2thousnand,
if sal is between 3000 and 4000 then display 3thousand else display above
find the difference between employee's salary and average salary in their department
Find the Deptartment with lowest salary (dept_name,salary)
Find department wise max salary and employee earning max salary.
(dept_name,salary,name)
a)Find department wise min salary (dept_name,salary,name) AND
b)If two employee have same lowest salary fetch one with whose name comes first
alphabetically.
Display name of all employees in Deptartment 'ACCOUNTING', and along with their
salary and the minimum salary of that department, and the minimum salaried person. If
two employee have same lowest salary fetch one with whose name comes first
alphabetically.