# PL/SQL Package - Mathematical Exercises and Database Manipulation

## PL/SQL Package [ 17 exercises with solution ]

1. Write a PL/SQL code to create a package that includes a procedure to calculate the factorial of a number and a function to check if a number is prime.

Click me to see the solution

2. Write a PL/SQL code to develop a package that includes procedures and functions to perform various string manipulations, such as reversing a string and counting the occurrence of a substring.

Click me to see the solution

3. Write a package that includes a procedure to validate user input for a specific data type and handle any exceptions that may occur.

Click me to see the solution

4. Write a PL/SQL code that implement a package that includes procedures and functions to perform complex mathematical operations, such as finding the nth root of a number and calculating logarithms.

Click me to see the solution

5. Write a PL/SQL code to create a package that includes a procedure to generate a random password and a function to check the password strength based on certain criteria.

Click me to see the solution

6. Write a PL/SQL package that includes procedures and functions to handle date and time operations, such as calculating the difference between two dates and converting between different date formats.

Click me to see the solution

7. Write a PL/SQL package that contains a procedure to calculate the average salary of employees in a specific department.

Click me to see the solution

8. Write a PL/SQL package that contains a function to retrieve the total number of employees in a specific job title.

Click me to see the solution

9. Write a PL/SQL package that contains a procedure to update the salary of an employee based on their performance rating.

Click me to see the solution

10. Write a PL/SQL package that contains a function to calculate the bonus amount for employees based on their salary and years of service.

Click me to see the solution

11. Write a PL/SQL package that contains a function to retrieve the top N employees with the highest salaries.

Click me to see the solution

12. Write a PL/SQL code that create a package that contains a function to calculate the total salary cost for a specific department and its sub-departments.

Click me to see the solution

13. Write a code in PL/SQL that create a package that contains a function to retrieve the average age of employees in a given department..

Click me to see the solution

14. Write a PL/SQL code that create a package that contains a function to retrieve the names of employees who have the same manager.

Click me to see the solution

15. Write a code in PL/SQL that create a package that contains a function to retrieve the highest paid employee in each department.

Click me to see the solution

16. Write a code in PL/SQL that create a package that contains a function to calculate the average tenure of employees in a specific job category.

Click me to see the solution

17. Write a code in PL/SQL which create a package that contains a function to retrieve the names of employees who have the same job title and manager.

Click me to see the solution

﻿