






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of pl/sql programming exercises and solutions, covering fundamental concepts such as variable declaration, conditional statements, loops, procedures, functions, and cursors. It includes examples of basic arithmetic operations, finding minimum values, checking for odd or even numbers, and displaying numbers using loops. Additionally, it demonstrates how to create tables and insert values using pl/sql, as well as how to use cursors to iterate through data. These exercises are designed to help students understand and apply pl/sql programming techniques in database management. Suitable for high school students learning programming basics.
Typology: Schemes and Mind Maps
1 / 10
This page cannot be seen from the preview
Don't miss anything!







1.Write a PL/SQL program to find the sum of 2 numbers. SQL> set serveroutput on; SQL> declare 2 a number(2); 3 b number(2); 4 c number(2); 5 begin 6 a:=21; 7 b:=28; 8 c:=a+b; 9 dbms_output.put_line('sum='||c); 10 end; 11 / sum= PL/SQL procedure successfully completed.
7 if (a>b) then 8 dbms_output.put_line('a is largest'); 9 else 10 dbms_output.put_line('b is largest'); 11 end if; 12 end; 13 / b is largest PL/SQL procedure successfully completed.
4 c number(2); 5 procedure findmin(x in number,y in number,z out number) is 6 begin 7 if(x<y) then 8 z:=x; 9 else 10 z:=y; 11 end if; 12 end; 13 begin 14 a:=21; 15 b:=28; 16 findmin(a,b,c); 17 dbms_output.put_line('min of two values'||c); 18 end; 19 / min of two values PL/SQL procedure successfully completed.
9 c:=a+b; 10 dbms_output.put_line('sum'||c); 11 end; 12 / sum PL/SQL procedure successfully completed.
SQL> select * from areas; RADIUS AREA
4 50 5 79 6 113 7 154 8 201
13 return z; 14 end; 15 begin 16 a:=21; 17 b:=28; 18 c:=findmin(a,b); 19 dbms_output.put_line('min of two values'||c); 20 end; 21 / min of two values PL/SQL procedure successfully completed.