Question: Create a PL/SQL block that selects the maximum department ID in the departments table and stores it in the v_max_deptno variable. Display the maximum

Create a PL/SQL block that selects the maximum department ID in the departments table and stores it in the

Create a PL/SQL block that selects the maximum department ID in the departments table and stores it in the v_max_deptno variable. Display the maximum department ID. a. Declare a variable, v_max_deptno, of type NUMBER in the declarative section. b. Start the executable section with the BEGIN keyword and include a SELECT statement to retrieve the maximum department_id from the departments table. c. Display v_max_deptno and end the executable block. d. Execute and save your script as lab_04_01_soln.sql. Sample output is as follows: anonymous block completed The maximum department_id is: 270

Step by Step Solution

3.27 Rating (139 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a PLSQL block that accomplishes the task you descr... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!