Q: 137 You need to create a view EMP_VU. The view should allow the users to
manipulate the records of only the employees that are working for departments 10 or 20. Which SQL
statement would you use to create the view EMP_VU?
A. CREATE VIEW emp_vu AS
SELECT *
FROM employees[align=center][/align]
WHERE department_id IN (10,20);
B. CREATE VIEW emp_vu AS
SELECT *
FROM employees
WHERE department_id IN (10,20)
WITH READ ONLY;
C. CREATE VIEW emp_vu AS
SELECT *
FROM employees
WHERE department_id IN (10,20)
WITH CHECK OPTION;
D. CREATE FORCE VIEW emp_vu AS
SELECT *
FROM employees
WHERE department_id IN (10,20);
Answer: C
为什么选择C呢?题目意思不是创建一个视图吗?A不可以吗?
------解决方案--------------------------------------------------------
还有个条件:
to manipulate the records of only the employees that are working for departments 10 or 20
------解决方案--------------------------------------------------------
manipulate 是操作的意思,包括查找,更新,插入等
如果不加with check options 那么在插入视图的时候可以没有限制,加了的话,只能插入department_id IN (10,20) 的记录