38. Which two statements are true regarding views? (Choose two.)
A. A simple view in which column aliases have been used cannot be updated.
B. Rows cannot be deleted through a view if the view definition contains the DISTINCT keyword.
C. Rows added through a view are deleted from the table automatically when the view is dropped.
D. The OR REPLACE option is used to change the definition of an existing view without dropping and re-creating it.
E. The WITH CHECK OPTION constraint can be used in a view definition to restrict the columns displayed through the view.
Answer: BD
A:含有别名的简单视图不能被更新 (错误,简单视图可以执行DML操作)
B:如果视图定义的时候使用了Distinct关键字 (正确,使用Distinct关键字建的视图会去除重复值,如果执行删除操作,不能确定要删除的数据时基表的哪个值)
C: 视图被删除时,通过视图添加的行也会被删除(错误,视图删除不影响基表,视图只是一条语句)
D:OR REPLACE选项是不通过删除和重建操作,改变已存在视图的定义(正确)
E:WITH CHECK OPTION 约束能使用在视图的定义,来限制行字段的显示(错误,WITH CHECK OPTION是在insert和update操作时,检查约束条件的,是限制数据的插入和更新的)
A. A simple view in which column aliases have been used cannot be updated.
B. Rows cannot be deleted through a view if the view definition contains the DISTINCT keyword.
C. Rows added through a view are deleted from the table automatically when the view is dropped.
D. The OR REPLACE option is used to change the definition of an existing view without dropping and re-creating it.
E. The WITH CHECK OPTION constraint can be used in a view definition to restrict the columns displayed through the view.
Answer: BD
A:含有别名的简单视图不能被更新 (错误,简单视图可以执行DML操作)
B:如果视图定义的时候使用了Distinct关键字 (正确,使用Distinct关键字建的视图会去除重复值,如果执行删除操作,不能确定要删除的数据时基表的哪个值)
C: 视图被删除时,通过视图添加的行也会被删除(错误,视图删除不影响基表,视图只是一条语句)
D:OR REPLACE选项是不通过删除和重建操作,改变已存在视图的定义(正确)
E:WITH CHECK OPTION 约束能使用在视图的定义,来限制行字段的显示(错误,WITH CHECK OPTION是在insert和update操作时,检查约束条件的,是限制数据的插入和更新的)