0% found this document useful (0 votes)
4 views3 pages

PLSQL

The document contains multiple PL/SQL code snippets demonstrating the use of variables, conditional statements, and output functions. It includes examples of simple output, if-else conditions for even/odd checks, grading based on marks, and a switch-case structure for days of the week. There are syntax errors present in the code that would prevent successful execution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

PLSQL

The document contains multiple PL/SQL code snippets demonstrating the use of variables, conditional statements, and output functions. It includes examples of simple output, if-else conditions for even/odd checks, grading based on marks, and a switch-case structure for days of the week. There are syntax errors present in the code that would prevent successful execution.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

begin

dbms_output.put_line(‘hellow’);

end;

declare

name varchar2(10)
begin
name:=&name;
dbms_output.put_line(‘hellow’||’ ‘ ||name);

end;

declare

i number;

begin

i:=0;

if i==0 then

dbms_output.put_line(‘simple if condition’);

end if;

end;

declare

i number;

begin

i:=&i

if mod(i,2)=0 then

dbms_output.put_line(‘given number is even);

else

dbms_output.put_line(‘given number is odd);

end if;

end;
declare

marks number;

grade varchar(10);

begin

marks:=& marks

if marks>=90 then

grade:=’A+’;

elsif marks<=89 and marks>=80 then

grade:=’A’;

elsif marks<=89 and marks>=80 then

grade:=’B’;

elsif marks<=69 and marks>=60 then

grade:=’C’;

elsif marks<=59 and marks>=50 then

grade:=’D’;

elsif marks<=49 and marks>=40 then

grade:=’E’;

else

grade:=F

dbms_output.put_line(‘failed’);

dbms_output.put_line(‘grade of the given marks is’|| grade);

end if;

end;

declare

option number;

begin
option:=&option;

chse option

when option then

dbms_output.put_line(‘sunday’);

when option then

dbms_output.put_line(‘monday’);

when option then

dbms_output.put_line(‘wednesday);

when option then

dbms_output.put_line(‘thursday’);

else

dbms_output.put_line(‘thursday’);

You might also like