If the view definition includes where age >= 17 with check option what will happen when the following statement is executed?

You have a view person age which contains these rows:

If the view definition includes where age >= 17 with check option what will happen when the following statement is executed?

UPDATE person_age SET age = 16

You have a view person age which contains these rows:

If the view definition includes where age >= 17 with check option what will happen when the following statement is executed?

UPDATE person_age SET age = 16

A.
No rows will be changed because with check option prevents changing rows to values less than 17.

B.
The age in all rows will be changed to 16 and with check option will cause all rows to become invisible within the view because all now have an age less than 17.

C.
The age in all rows will be changed to 16 and with check option will keep all rows visible in the view because they started in it.

Explanation:
The statement will cause an error as the update doesn’t meet the WHERE clause requirement(can’t be true).
— With CHECK OPTION ensures you Can’t update a row in an updatable view, in such a way that the view no longer selects it.



Leave a Reply 0

Your email address will not be published. Required fields are marked *