Table Modification   «Prev  Next»

Deleting Object Table - Exercise

Write DML Statements

Objective: Write INSERT and UPDATE statements.

Exercise Scoring

This exercise is worth a total of 15 points. You will receive up to 10 points for writing the two queries (five points for each query). You will receive up to five points for explaining the techniques that you used and why.

Background

In this exercise, you will write two DML statements. First, update the records within the CUSTOMER_OBJ_TABLE table and set STATE within ADDRESS_TYPE to LA, where STATE is HI. Second, delete the records from the
PRODUCT_OBJ_TABLE table, where CURRENT_INVENTORY_COUNT = 5.

Download files

Developer: There are no additional files that the student needs to download for this exercise other than the database schema & data, which, I believe, will be part of the standard download.

Instructions

For the first SQL statement, use dot notation to traverse to the attribute of the object type. The second SQL statement is a simple DELETE statement.

Now Answer this….

  1. How many records are updated by the first SQL statement?
  2. How many records are deleted by the second SQL statement?

Hints

To write the first SQL statement, use dot notation and table alias.

Submitting your exercise

After you have defined the SQL statements and added you@r explanation for the techniques that you used and why, place them within the text area below and click the Submit button to submit them. Remember that you must submit all your responses to this exercise at once.