Conditional control: IF and CASE Statements.
- IF statement
- It is a conditional statement in which if the condition is true, the statement is processed.Example
IF sal > 10000 THEN
UPDATE salary SET appraisal = appraisal + bonus WHERE empno = emp_id;
CASE statement- It is again a conditional statement that executes the statement if the condition in CASE is true.
IF salary = '1000' THENIterative Control: LOOP and EXIT Statements.
ELSIF grade = '2000' THEN
:- Loop executes a statement multiple times in loop. EXIT loop forces the LOOP to exit forcibly.Example
IF university_rating < 3 THEN
EXIT; -- exit loop immediately
Sequential Control: GOTO and NULL Statements. Explain with an example for each
GOTO statement takes the control to the labeled statement.Example
INSERT INTO emp VALUES ...
- Simply passes the control to the next statement.Example
IF salary < 9000 THEN