PLSQL: PACKAGES

32 programming challenges to help you master the fundamentals of DATABASE MANAGEMENT SYSTEM USING ORACLE.

1

Write a package specification and body to display "Hello Oracle".

(Package Basic Structure)

2

Create a package with one procedure to display employee details.

(Package + Procedure)

3

Create a package containing a function to return square of a number.

(Package + Function)

4

Write a package with both procedure and function.

(Package Structure)

5

Create a package to group employee-related operations.

(Package Design)

6

Create a package with a global variable and display its value.

(Package Variable)

7

Write a package to store company name as constant and display it.

(Package Constant)

8

Create a package that uses a variable to count number of procedure calls.

(Package State Management)

9

Write a package with a global variable used in multiple procedures.

(Shared Variable in Package)

10

Create a package procedure to fetch employee details using empno.

(Package Procedure)

11

Create a package procedure to insert employee record.

(Package + INSERT)

12

Create a package procedure to update employee salary.

(Package + UPDATE)

13

Create a package procedure to delete employee record.

(Package + DELETE)

14

Create a package procedure to increase salary of all employees by 10%.

(Package + Business Logic)

15

Create a package function to return employee salary.

(Package Function)

16

Create a package function to return total employees.

(Package + Aggregate Function)

17

Create a package function to return maximum salary.

(Package + Aggregate Function)

18

Create a package function to calculate bonus (10% of salary).

(Package Function + Logic)

19

Create a package that uses cursor to display all employees.

(Package + Cursor)

20

Create a package with parameterized cursor to fetch employees by department.

(Package + Parameterized Cursor)

21

Create a package procedure that loops through employees using cursor FOR LOOP.

(Package + Cursor Loop)

22

Create a package with private procedure (only in body, not in specification).

(Private vs Public in Package)

23

Create a package with overloaded procedures (same name, different parameters).

(Procedure Overloading)

24

Create a package with function overloading.

(Function Overloading)

25

Create a package to maintain employee audit logs.

26

Create a package with initialization block (executed once).

(Package Initialization)

27

Create a package to perform all CRUD operations on EMP table.

(Full Package Design)

28

Create a package that calculates salary, bonus, and tax using multiple functions.

(Business Logic Package)

29

Create a package to validate employee data before insert/update.

(Validation Logic)

30

Create a package that interacts with multiple tables (EMP, DEPT).

(Multi-table Package)

31

Create a package to simulate banking operations (deposit, withdraw, balance check).

32

Create a package that uses exception handling for all operations.

(Exception Handling in Package)