Está en la página 1de 2

1.

Write a SQL statement to query all of the employee names, jobs, and salaries w
here their salary is more than 10% of the total company paid salary.
2.Write a SQL statement to query the name of all employees who earn the maximum
salary in their department using the multiple columns syntax.
3.Query the customer names which have more than four orders.
4.Query the employees name that work in the "accounting" department. Assuming t
he department number is unknown.
5.Query the department no and their total salaries that have more than 5 employe
es working in their department.
6.Query the employees name and their department name using the DECODE function. I
f the department number is 10 then print "accounting. If the department number is
20 then print "research," or if the department number is 30 then print "sales."
Anything else prints others.
7.Multiple-Row Subqueries - Find the employees who earn the same salary as the m
inimum salary for each department.
8.Display the employees who are not IT programmers and whose salary is less than
that of any IT programmer.
9.Display the employees whose salary is less than the salary of all employees wi
th a job ID of IT_PROG and whose job is not IT_PROG.
10.The HAVING Clause with Subqueries - list down the department id ,min salary f
rom each department where min salary should be greater than the
min salary of department 50
11.Find the employees who earn the same salary as the minimum salary for each de
partment.
12.Display the employees who are not IT programmers and whose salary is less tha
n that of
any IT programmer.
13.Display the employees whose salary is less than the salary of all employees w
ith a job ID
of IT_PROG and whose job is not IT_PROG.
14.Which employees receive more than the average salary of their department
15 What are the employees salary and the MINIMAL salary in their department? - u
se inline view
16. What are the top 5 most well paid employees? - use row num and inline view
17.What are the next 5 most well paid employees? use row num and inline view
18.Display the details of the employees who are managed by the same manager and
work in the same department as the employees with EMPLOYEE_ID 178 or 174.
19.Display the details of the employees who are managed by the same manager as t
he employees with EMPLOYEE_ID 174 or 141 and work in the same department as the

employees with EMPLOYEE_ID 174 or 141.


20. Subquery in the FROM Clause -- employee last names, salaries, department n
umbers, and average salaries for all the employees who earn more than the averag
e salary in their department
21 - Using the DECODE Function
IF job_id = 'IT_PROG'
THEN salary = salary*1.10
IF job_id = 'ST_CLERK'
THEN salary = salary*1.15
IF job_id = 'SA_REP'
THEN salary = salary*1.20
ELSE salary = salary
22 Determine the tax rate for each employee in department 80 based on the monthl
y salary. The tax rates are as per the values mentioned in the following data.
-USE DECODE STMT
Monthly Salary Range
$0.00 - 1999.99
$2,000.00 - 3,999.99
$4,000.00 - 5,999.99
$6,000.00 - 7,999.99
$8,000.00 - 9,999.99
$10,000.00 - 11,999.99
$12,200.00 - 13,999.99
$14,000.00 or greater

Rate
00%
09%
20%
30%
40%
42%
44%
45%

23 -Display details of those employees who have switchedjobs at least twice.

También podría gustarte