Multiple choice technology databases

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 cannot be used for INSERT, UPDATE, or DELETE operations. Option A is correct. WITH CHECK OPTION ensures that any INSERT or UPDATE through the view must satisfy the view's WHERE clause, but it still allows DML operations. WITH CHECK CONSTRAINT is not valid Oracle syntax.