Views are derived from tables. Therefore, views are similar to tables in many aspects. You can query views. With some limits, you can perform DML operations on views. Operations performed on a view affect the data in some base tables of the view and are subject to the integrity constraints and triggers of the base tables.
The following example shows how to create the staff_dept_10 view based on the employees table. This view defines the employee information of Department 10. The WITH CHECK OPTION clause is used to create the view so that DML operations performed on the view apply only to the data defined by the view. Therefore, you can insert data rows for employees in Department 10, but you cannot insert data rows for employees in Department 30.
CREATE VIEW staff_dept_10 AS
SELECT employee_id, last_name, job_id, manager_id, department_id
FROM employees
WHERE department_id = 10
WITH CHECK OPTION CONSTRAINT staff_dept_10_cnst;