CHECK OPTION is used for checking integrity for views in SQL. For every INSERT and UPDATE operation, the results of the rows are checked to make sure that the condition in the view definition is met, otherwise INSERT and UPDATE operation fails.
CREATE VIEW EMPLNEW AS SELECT * FROM EMPLOYEES WHERE EMPL_OFFICE IN (15, 16) WITH CHECK OPTION
There are two options which can be used with a CHECK OPTION.
1) WITH CASCADED CHECK OPTION: For a CASCADED option every view which is defined by the view in the CHECK OPTION statement is checked.
2) WITH LOCAL CHECK OPTION: Only the particular view which is defined in the CHECK OPTION statement is checked.
DROP VIEW statement: DROP VIEW statement is used to remove views.
By using CASCADE:
DROP VIEW EMPLNEW CASCADE
By using RESTRICT:
DROP VIEW EMPLNEW RESTRICT
Normal CASCADE and RESTRICT drop rules are applied.