We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
PL/SQL Control Statement Exercises
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 « 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,
4, 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 manyvacancies 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,
17. Write @ program in PL/SQL to print the
value of a variable inside and outside a loop
using LOOP WHEN EXIT statement,
18, Write « program in PL/SQL to show the
uses of nested loop.
14, Write @ 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 loopwith 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 « number is prime or not using goto
statement with for loop.