Multiple choice

Which of the following statements creates a view and does not allow the values to be changed through the view?

  1. CREATE VIEW empl_vu AS SELECT * FROM employee WHERE sal > 10000 WITH READ ONLY;

  2. CREATE VIEW empl_vu AS SELECT * FROM employee WHERE sal > 10000 WITH CHECK OPTION;

  3. CREATE VIEW empl_vu AS SELECT * FROM employee WHERE sal > 10000 WITH CHECK CONSTRAINT;

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The WITH READ ONLY clause creates a view that prohibits INSERT, UPDATE, or DELETE operations through it. This is the standard Oracle syntax for making views read-only. Option B's WITH CHECK OPTION ensures DML operations don't create rows that would be invisible to the view, but doesn't prevent all DML. Option C's WITH CHECK CONSTRAINT is not valid Oracle syntax. Option D is incorrect because WITH READ_ONLY is the correct answer.