PL/SQL while loop exercises
PL/SQL While Loop [ 21 exercises with solution ]
1. Write a PL/SQL program to display the names of all countries.
2. Write a PL/SQL program to display the job titles of all employees. Return a heading of job title.
3. Write a PL/SQL program to display the location IDs and cities of all locations along with the proper heading.
4. Write a PL/SQL program to display the employee IDs, names, job titles, hire dates, and salaries of all employees.
5. Write a PL/SQL program to display the employee IDs, names, and department names of all employees.
6. Write a PL/SQL program to display the employee IDs, names, and manager names of all employees.
7. Write a PL/SQL program to display the job IDs, titles, and minimum salaries of all jobs.
8. Write a PL/SQL program to display the employee IDs, names, and job titles of all employees.
9. Write a PL/SQL program to display the employee IDs, names, and job history start dates of all employees.
10. Write a PL/SQL program to display the employee IDs, names, and job history end dates of all employees.
11. Write a PL/SQL program to display the department IDs, names, and the name of the city where the department is located of all departments.
12. Write a PL/SQL program to display all the departments along with the names of employees working in each department.
13. Write a PL/SQL program to display the average salary for each job. Return job title and average salary in a row.
14. Write a PL/SQL program to display the total salary expense for each department. Return depart name and salary expenses in tabular form.
15. Write a PL/SQL program to display the number of employees in each department using a nested while loop. Return department name and number of employees.
16. Write a PL/SQL program to display the total number of employees hired each year between 1985 and 2000. Return the result in tabular format.
17. Write a PL/SQL program to display the number of employees in each country. Return country name and number of employees.
18. Write a PL/SQL program to display the average salary for each department.
19. Write a PL/SQL program to display the employees who have the highest salary in each department using a nested while loop.
20. Write a PL/SQL program to display the employees who have the lowest salary in each department.
21. Write a PL/SQL program to display the department name with the maximum number of employees.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics