17BCE0505_L27+L28_Exercise_7.pdf - DATABASE MANAGEMENT SYSTEMS LAB ASSESSMENT 6 EXERCISE 7 NAME ANUSHA SINHA REGISTRATION NO 17BCE0505 SLOT NO L27 L28

# 17BCE0505_L27+L28_Exercise_7.pdf - DATABASE MANAGEMENT...

• Lab Report
• 4

This preview shows page 1 - 4 out of 4 pages.

Page | 1 DATABASE MANAGEMENT SYSTEMS LAB - ASSESSMENT 6 - EXERCISE 7 NAME: ANUSHA SINHA REGISTRATION NO.: 17BCE0505 SLOT NO.: L27+L28 FACULTY NAME: RAJESHKANNAN.R NO. OF PAGES: 4 DATE OF SUBMISSION: 26.10.2018
Page | 2 Ques 01 Write a PL/SQL to find the greatest number among three numbers DECLARE a NUMBER := 16; b NUMBER := 54; c NUMBER := 33; BEGIN IF a > b AND a > c THEN dbms_output.Put_line('Greatest number is '||a); ELSIF b > a AND b > c THEN dbms_output.Put_line('Greatest number is '||b); ELSE dbms_output.Put_line('Greatest number is '||c); END IF; END; / OUTPUT Greatest number is 54 PL/SQL procedure successfully completed. Ques 02- Write a PL/SQL using nested block and outer variable update the salary of the employee by 5000 who’s having highest experience. <<Round01>> declare sal emp.salary%type; exp emp.expierience%type; begin select salary,experience into sal,exp from emp where exp = max(experience); <<round02>> begin UPDATE emp set round01.sal = Round01.sal + 5000; end; end; / Output PL/SQL procedure successfully completed.