Question
4. Modify the code to declare two additional variables (assigning a new department name to one of them), by adding the following two lines to
4. Modify the code to declare two additional variables (assigning a new department name to one of them), by adding the following two lines to your Declaration section: v_dept_name new_depts.department_name%TYPE := 'A New Department'; v_dept_id new_depts.department_id%TYPE; 5. Modify the code to add 10 to the current maximum department number and assign the result to v_dept_id. 6. Modify the code to include an INSERT statement to insert a new row into the new_depts table, using v_dept_id and v_dept_name to populate the department_id and department_name columns. Insert NULL into the location_id and manager_id columns. Execute your code and confirm that the new row has been inserted. 7. Now modify the code to use SQL%ROWCOUNT to display the number of rows inserted, and execute the block again. 8. Now modify the block, removing the INSERT statement and adding a statement that will UPDATE all rows with location_id = 1700 to location_id = 1400. Execute the block again to see how many rows were updated.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started