RelationalDBDesignRelationalDBDesign


PL/SQL   «Prev  Next»

Delete an Entire Array or Nested Table - Exercise

Delete an entire array or nested table


Delete from a nested table


Objective: Write a delete command to remove rows from a nested table.

Exercise scoring



This exercise is worth a total of 10 points. You will receive up to five points for writing the INSERT statement and displaying the results with the correct syntax. You will receive up to five points for adding an explanation.

Background



Write an INSERT statement to insert a row into the nested table within the SALE_HEADER table.

Instructions

  1. With SQL*Plus, connect to the database by using PETSTORE as the username, GREATPETS as the password, and MYDB as the host string.
  2. Build a statement to delete the records from the nested table within the SALE_HEADER table, where id is 34.
  3. After writing the DELETE statement, answer the following questions:
  4. How do you delete a particular (single) record from a nested table?
  5. How do you delete all the nested table records for all the records within the main table?

Hints



Use the TABLE keyword.

Submitting your exercise



After you have defined the DELETE statement, added your explanation, and answered the two questions, place everything in the text area below and click the Submit button to submit it to the tutor.