一、原题
二、题目翻译
三、题目解析
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.
答案:BD
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.
答案:BD
二、题目翻译
关于视图哪两个句子是正确的?(选择两个)
A. 一个简单的视图中使用别名的列不能被更新。
B. 如果视图定义时包含了DISTINCT关键字,不能通过视图删除行。
C. 当视图被删除时,通过视图添加的行从表中自动删除。
D. OR REPLACE选项用于改变一个已存在的视图的定义,而不需要删除后重建。
E. WITH CHECK OPTION用于限制通过视图显示的列。
A. 一个简单的视图中使用别名的列不能被更新。
B. 如果视图定义时包含了DISTINCT关键字,不能通过视图删除行。
C. 当视图被删除时,通过视图添加的行从表中自动删除。
D. OR REPLACE选项用于改变一个已存在的视图的定义,而不需要删除后重建。
E. WITH CHECK OPTION用于限制通过视图显示的列。
三、题目解析
A选项不正确,只要是简单视图,使用别名的列是可以使用UPDATE命令更新的。
C选项不正确,视图被删除,不影响基表的数据。
E选项不正确,WITH CHECK OPTION用于限制通过视图更改基表的条件,禁止更改不包含在子查询条件里的行。
C选项不正确,视图被删除,不影响基表的数据。
E选项不正确,WITH CHECK OPTION用于限制通过视图更改基表的条件,禁止更改不包含在子查询条件里的行。