DMS Microproject
DMS Microproject
M.S.B.T.E.
Evolution sheet for Micro Project
Practical
Outcomes Write PL/SQL programs using if then else,for,while and nested loop.
Unit Outcomes in
Cognitive Domain Write simple PL/SQL code using control structure and handle various
exceptions in given situation.
Outcomes in
Affective Domain Follow proper syntax to create and implement the PL/SQL programs.
Marks out of 4
Marks out of 6 Total
for
for mars
Roll No Name of students performance
performance in out
in oral/
group activity of 10
Presentation
Name and
Signature of
faculty
SVP’s SWAMI VIVEKANAND INSTITUTE OF TECHNOLOGY(POLY), SOLAPUR
CERTIFICATE
is a bonafide work carried out by above students, under the guidance of………………….. and it is
submitted towards the fulfillment of requirement of MSBTE, Mumbai for the award of Diploma in
Computer Engineering at SVP’s COE (Polytechnic), Solapur during the academic year 2023-24.
Guide
HOD Principal
Place: Solapur
Date: / /
INDEX
Sr.No. Title
1. Acknowledgement
2. Introduction
3. Description
4. Type Of Operator
5. Overview of PL/SQL Control Structures
6. Description Of Control Structure
7. Testing Conditions (IF and CASE Statements)
8. Relational Operator
9. IF-THEN-ELSE Statement
10. While loop Statement
11. Conclusion
12. References
Acknowledgement
“Execute PL/SQL Program using different conditional statement (if else,
for /while)” has been developed successfully with a great contribution of two students in a
period of two months. We like to appreciate their guidance, encouragement and willingness
since without their support the project would not have been a success. We would like to give
our heartfelt gratitude to Principal………………… , Guide & HOD ………………… who
is the supervisor of our project for helping and encouraging us in many ways to make our
project a success. We would never been able to finish our work without great support and
enthusiasm from friends and support from our family. We would like to thank the department
of Computer Engineering, for giving us permission to initiate this project and successfully
finish it.
Introduction:-
The project skill will help the student will understand the pl/sql
statement to retrive the needed information about the table as per their
specified condition og that the desion making statement….
Resources Used:-
DESCRPTION
TYPE OF OPREATOR
The CASE statement is a compact way to evaluate a single condition and choose between
many alternative actions. It makes sense to use CASE when there are three or more
alternatives to choose from. For a description of the syntax of the CASE statement, see CASE
Statement.
Relational Operator:-
The following table shows all the relational operators supported by C language. Assume
variable A holds 10 and variable B holds 20 then:-
IF-THEN-ELSE Statement:-
• The IF-THEN-ELSE statement is mainly used to select between
two alternatives based on the condition.
• Below is the syntax representation of IF-THEN-ELSE statement.
• In the above syntax, keyword 'IF' will be followed by a condition which evaluates to
'TRUE'/'FALSE'.
• The control will execute the <action_block1> only if the condition returns <TRUE>.
• In case of condition evaluates to <FALSE> then, SQL will execute <action_block2>.
• In any case, one of the two action blocks will be executed.
Note: Whenever condition evaluates to 'NULL', then SQL will treat 'NULL' as 'FALSE'.In this
example, we are going to print message whether the given number is odd or even.
Code Explanation:
• Code line 2: Declaring the variable 'a' as 'NUMBER' data type and initializing it with value '11'.
• Code line 4: Printing the statement "Program started".
• Code line 5: Checking the condition, whether modulus of variable 'a' by '2' is 0.
• Code line 6: If '0', then "a is even number" will be printed.
• Code line 7: If the modulus value is not equal to '0', then the condition returns <FALSE>, so the message "a
is odd number" will be printed.
• Code line10: Printing the statement "Program completed".
It works like an entry-check loop in which execution block will not even be executed once if
the condition is not satisfied, as the exit condition is checking before execution part. It does
not require keyword 'EXIT' explicitly to exit from the loop since it is validating the condition
implicitly each time of the loop.
Syntax:-
Syntax Explanation:
• In the above syntax, keyword 'WHILE' marks beginning of the loop and 'END LOOP' marks
the end of the loop.
• EXIT condition is evaluated each time before the execution part is starting executing.
• The execution block contains all the code that needs to be executed.
• The execution part can contain any execution statement.
Code Explanation:
• Code line 2: Declaring the variable 'a' as 'NUMBER' data type and initializing it with value
'1'.
• Code line 4: Printing the statement "Program started".
• Code line 5: Keyword 'WHILE' marks the beginning of the loop, and it also checks whether
the value of 'a' is less than or equal to 5.
• Code line 7: Prints the value of 'a'.
• Code line 8: Increments the value of 'a' by +1.
• Code line 9: Keyword 'END LOOP' marks the end of execution block.
• The code from line 7 and line 8 will continue to execute till 'a' reaches the value 6, as the
condition will return TRUE, and the control will EXIT from the loop.
• Code line 10: Printing the statement "Program completed".
Conclusion:-
1. Conditional selection statements, which run different statements for different data values.
2. Loop statements, which run the same statements with a series of different data values.
3. The EXIT statement transfers control to the end of a loop. The CONTINUE statement .
4. exits the current iteration of a loop and transfers control to the next iteration. Both EXIT
and CONTINUE have an optional WHEN clause, where you can specify a condition.
References:-
1. PL/SQL Control Statements (oracle.com) .