Objective: Delete elements from a stored nested table while preserving its parent row, and distinguish a one-sale operation from clearing all sales' collections.
Assume SALE_HEADER has a unique SALE_ID and a nested-table column DETAIL_NEST of SQL type DETAIL_TABLE. Its object elements have a numeric DETAIL_ID, unique within each sale. This identifier is an explicit assumption for this exercise. Sale 34 exists exactly once and its collection is initialized and contains detail 7. The schema permits the operations below.
You can write your answer without a database. To test it, use your assigned account and service in a disposable practice schema with these definitions and sufficient privileges. Disable autocommit, inspect the results, and use ROLLBACK to undo uncommitted practice changes.
Hints: Use TABLE() for piecewise nested-table DML and the empty DETAIL_TABLE() constructor for whole-collection replacement. Treat the variations independently; undo the main deletion before testing the single-detail variation.
Submit your SQL, verification query, and explanations together. The result page displays a model answer; it does not execute SQL or calculate a score.