You are on page 1of 2

ID Name Salary Role_id

1002 Ahmed 3000 1


1003 Maged 3500 2
1004 Nour 5000 1

From The Following Table (Emps) :-


1. Retrieve data of all employees (ID as “Employees ID” and name as
“Employee Name”)

2. Retrieve all employees that their Role_id = 1.

3. Retrieve all employees that their names contains character “e”.

4. Retrieve number of employees for each role.

5. Retrieve the summation of salaries of all employees for each role.


1) Using a select statement , write a query to print your name.
2) write a query to Select department_id for employees from the employees table with no
repetition.
3) Write a query to Select name ,salary for employees in department number 100 or 90 or 80.

4) write a query to return both the maximum and average salary grouped by department from
the employees table.

5) write a query to display the first name and department number for employee number 200.

1) Using DUAL, convert 5432.342 to 5300.


2) Select department_id for employees from employees table with no repeat.
3) Create a report to display the last name and job id of all manager employees.

4) Use the Oracle database employees table and CASE expression to decode the department
id. Display the department id, last name, salary and a column called “New Salary” whose value
is based on the following conditions: If the department id is 10 then 1.25 * salary If the
department id is 90 then 1.5 * salary If the department id is 130 then 1.75 * salary Otherwise,
display the old salary.

5) Write a query that will return both the maximum and minimum average salary grouped by
department from the employees table.

6) List the employees that HAVE changed their jobs at least once.

7) Create a report that displays the last name and department number for employee number
176.

You might also like