nerdexam
Oracle

1Z0-909 · Question #33

1Z0-909 Question #33: Real Exam Question with Answer & Explanation

The correct answer is D. It returns an error because the DROP TABLE statement did not drop the view.. Option D is correct because in Oracle SQL, DROP TABLE does not automatically drop dependent views - it only invalidates them. The view emp_vu1 remains in the data dictionary as an INVALID object, so when a subsequent CREATE VIEW emp_vu1 (without OR REPLACE) is attempted, Oracle t

SQL Fundamentals

Question

Examine these commands and output: Which is true?

Exhibit

1Z0-909 question #33 exhibit

Options

  • AExisting emp_vuL is dropped and a new emp_vu1 created with the new definition.
  • BA new view is created because the previous was dropped on execution of the drop table
  • CIt returns an error because the CREATE TABLE statement automatically recreated the view.
  • DIt returns an error because the DROP TABLE statement did not drop the view.

Explanation

Option D is correct because in Oracle SQL, DROP TABLE does not automatically drop dependent views - it only invalidates them. The view emp_vu1 remains in the data dictionary as an INVALID object, so when a subsequent CREATE VIEW emp_vu1 (without OR REPLACE) is attempted, Oracle throws an error because an object with that name already exists.

Why the distractors are wrong:

  • A is wrong because CREATE OR REPLACE VIEW would be needed to redefine an existing view; a plain CREATE VIEW cannot overwrite one.
  • B is wrong because DROP TABLE never drops views - it only invalidates them, so emp_vu1 was never removed from the data dictionary in the first place.
  • C is wrong because CREATE TABLE has no effect on views whatsoever; it simply recreates the base table, leaving the invalid view untouched.

Memory tip: Think of it as Oracle using a "lazy delete" for views - dropping a table marks dependent views as ghosts (INVALID) but never fully removes them. The phrase "DROP TABLE = orphaned view, not deleted view" can help you remember that you must explicitly DROP VIEW or use CREATE OR REPLACE VIEW to manage the view itself.

Topics

#VIEW dependencies#DROP TABLE#Object relationships#DDL constraints

Community Discussion

No community discussion yet for this question.

Full 1Z0-909 Practice