PLSQL: OUTPUT STATEMENT, DATATYPES, VARIABLES, CONSTANTS

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

1

Write a PL/SQL block to print your name and city in two separate lines.

(Output Statement)

2

Write a PL/SQL block to display numbers from 1 to 5 using DBMS_OUTPUT.PUT_LINE.

(Output Statement)

3

Write a PL/SQL block to print the current system date.

(Output Statement)

4

Write a PL/SQL block to display employee name and salary (use variables).

(Output + Variables)

5

Write a PL/SQL block to declare a variable and assign your age, then display it.

(Variables)

6

Write a PL/SQL block to declare two variables and print their sum.

(Variables)

7

Write a PL/SQL block to store employee name and salary in variables and display them.

(Variables)

8

Write a PL/SQL block to swap two numbers using variables.

(Variables)

9

Write a PL/SQL block to calculate area of a rectangle using variables.

(Variables)

10

Write a PL/SQL block to declare a constant value for PI and calculate area of a circle.

(Constants)

11

Write a PL/SQL block to declare a constant tax rate and calculate total salary after tax.

(Constants)

12

Write a PL/SQL block where constant value cannot be changed (try modifying and observe error).

(Constants)

13

Write a PL/SQL block to calculate simple interest using constant rate of interest.

(Constants)

14

Write a PL/SQL block using different datatypes: NUMBER, VARCHAR2, DATE.

(Datatypes)

15

Write a PL/SQL block to declare a variable using %TYPE from EMP table salary column.

(Datatypes)

16

Write a PL/SQL block to declare a record using %ROWTYPE and display employee details.

(Datatypes)

17

Write a PL/SQL block to store and display current date using DATE datatype.

(Datatypes)

18

Write a PL/SQL block to convert number to string and display it.

(Datatypes + Conversion)

19

Write a PL/SQL block using variables, constants, and output statement together.

(Combined Concepts)

20

Write a PL/SQL block to display employee details using %ROWTYPE, constants, and comments.

(Combined Concepts)

21

Write a PL/SQL block to calculate bonus (10% of salary) and display result using proper comments.

(Variables + Output + Comments)

22

Write a PL/SQL block that uses all concepts: variable, constant, datatype, and output.

(Full Practice)