Category: PL/SQL Programs

PL/SQL Program to Find Largest from Three Numbers 0

PL/SQL Program to Find Largest from Three Numbers

Follow me PL/SQL Program to Find Largest from Three Numbers: Declare a number; b number; c number; Begin a:=:a; b:=:b; c:=:c; dbms_output.put_line(‘Value of a:’||a); dbms_output.put_line(‘Value of b:’||b); dbms_output.put_line(‘Value of c:’||c); if (a>b) and (a>c)...

PL/SQL Program to Find Area of Triangle 0

PL/SQL Program to Find Area of Triangle

Follow me PL/SQL Program to Find Area of Triangle: declare base integer; height integer; area integer; begin base:=:base; height:=:height; dbms_output.put_line(‘Height = ‘||height); dbms_output.put_line(‘Base = ‘||base); area:=0.5*base*height; dbms_output.put_line(‘The area of triangle is ‘||area); end; OUTPUT:...

PL/SQL Program to Add Two Numbers 0

PL/SQL Program to Add Two Numbers

Follow me PL/SQL Program to Add Two Numbers: declare a number; b number; c number; begin a:=:a; b:=:b; c:=a+b; dbms_output.put_line(a||’ + ‘||b||’ = ‘||c); end; OUTPUT: 5 + 5 = 10

PL/SQL Program to Check Number is Prime or Not 0

PL/SQL Program to Check Number is Prime or Not

Follow me PL/SQL Program to Check Number is Prime or Not: declare no number; i number; flag number; begin i:=2; flag:=1; no:=:no; for i in 2..no/2 loop if mod(no,i)=0 then flag:=0; exit; end if;...

PL/SQL Program to Accept Employee Number & Display Employee Details 0

PL/SQL Program to Accept Employee Number & Display Employee Details

Follow me PL/SQL Program to Accept Employee Number & Display Employee Details: declare no number; name varchar(15); salary number(10); deptname varchar(15); begin no:=:no; dbms_output.put_line(‘Employee Id is: ‘||no); select ename,sal,dname into name,salary,deptname from emp e,dept...

PL/SQL Program to Calculate Sum of Digit 0

PL/SQL Program to Calculate Sum of Digit

Follow me PL/SQL Program to Calculate Sum of Digit: declare sod number; no number; len number; digit number; begin digit:=0; sod:=0; no:=:no; len:=length(no); for i in 1..len loop digit:=substr(no,i,1); sod:=sod+digit; end loop; dbms_output.put_line(‘Entered Number...

PL/SQL Program to Check Number is Armstrong Number or Not 0

PL/SQL Program to Check Number is Armstrong Number or Not

Follow me PL/SQL Program to Check Number is Armstrong Number or Not: declare no number; arm number; len number; c number; begin no:=:no; arm:=0; len:=length(no); for i in 1..len loop c:=substr(no,i,1); arm:=arm + (c*c*c);...

PL/SQL Program to Check Number is Palindrome or Not 0

PL/SQL Program to Check Number is Palindrome or Not

Follow me PL/SQL Program to Check Number is Palindrome or Not: declare no number(15); rev number(15); slen number(10); c char(1); Begin no:=:no; slen:=length(no); for i in reverse 1..slen loop c:=substr(no,i,1); rev:=rev||c; end loop; dbms_output.put_line(‘Orignal...

PL/SQL Program to Check String is Palindrome or Not 0

PL/SQL Program to Check String is Palindrome or Not

Follow me PL/SQL Program to Check String is Palindrome or Not: declare str varchar(15); rev varchar(15); slen number(10); c char(1); Begin str:=:str; slen:=length(str); for i in reverse 1..slen loop c:=substr(str,i,1); rev:=rev||c; end loop; dbms_output.put_line(‘Original...