PL/SQL Control Statement Exercises with Solution
PL/SQL Control Statement [ 30 exercises with solution ]
1. Write a PL/SQL program to arrange the number of two variable in such a way that the small number will store in num_small variable and large number will store in num_large variable.
2. Write a PL/SQL procedure to calculate the incentive on a target achieved and display the message either the record updated or not.
3. Write a PL/SQL program to check whether a number is even or odd.
4. Write a PL/SQL procedure to calculate the incentive on a specific target otherwise a general incentive to be paid using IF-THEN-ELSE.
5. Write a PL/SQL program to check whether a date falls on weekend i.e. SATURDAY or SUNDAY.
6. Write a PL/SQL procedure to calculate incentive achieved according to the specific sale limit.
7. Write a PL/SQL program to count number of employees in department 50 and check whether this department have any vacancies or not. There are 45 vacancies in this department.
8. Write a PL/SQL program to display the description against a grade.
9. Write a PL/SQL program to count number of employees in a specific department and check whether this department have any vacancies or not. If any vacancies, how many vacancies are in that department.
10. Write a PL/SQL program to display the description against a grade using CASE statement.
11. Write a PL/SQL program to display the description against a grade using CASE statement with EXCEPTION.
12. Write a PL/SQL program to check whether a given number is positive, negative or zero.
13. Write a PL/SQL program to check whether a given character is letter or digit.
14. Write a PL/SQL program to convert a temperature in scale Fahrenheit to Celsius and vice versa.
15. Write a PL/SQL program to display which day is a specific date.
16. Write a program in PL/SQL to print the value of a variable inside and outside a loop using LOOP EXIT statement.
17. Write a program in PL/SQL to print the value of a variable inside and outside a loop using LOOP WHEN EXIT statement.
18. Write a program in PL/SQL to show the uses of nested loop.
19. Write a program in PL/SQL to update the salary of a specifc employee by 8% if the salary exceeds the mid range of the salary against this job and update up to mid range if the salary is less than the mid range of the salary, and display a suitable message.
20. Write a program in PL/SQL using nested loop with EXIT WHEN statement.
21. Write a program in PL/SQL using loop with CONTINUE statement.
22. Write a program in PL/SQL using loop with CONTINUE WHEN statement.
23. Write a program in PL/SQL to print 1st n numbers.
24. Write a program in PL/SQL to print 1st n numbers with a difference of 3 and starting from 1.
25. Write a program in PL/SQL to show the value of a same variable declared as local and global.
26. Write a program in PL/SQL to explain the uses of nested for loop with label.
27. Write a program in PL/SQL to print the prime numbers between 1 to 50.
28. Write a program in PL/SQL to check whether a number is prime or not using goto statement with for loop.
29. Write a program in PL/SQL to insert records from one table to another.
30. Write a program in PL/SQL to insert a row if the featched value for a component is specified.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/plsql-exercises/control-statement/index.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics