IBM(000-730)

单选题A view is created with the following statement:CREATE VIEW v1 AS SELECT col1, col2, col3, col4 FROM t1 WHERE col4 > 1000 WITH CHECK OPTIONWhat is the effect of the CHECK OPTION clause?()A Any row inserted or updated through view V1 must meet the condit

题目
单选题
A view is created with the following statement:CREATE VIEW v1 AS SELECT col1, col2, col3, col4 FROM t1 WHERE col4 > 1000 WITH CHECK OPTIONWhat is the effect of the CHECK OPTION clause?()
A

Any row inserted or updated through view V1 must meet the condition that col4 > 1000.

B

From now on, any row inserted or updated in table T1 must meet the condition that col4 > 1000, but existing rows in the table are not checked.

C

At view creation, DB2 will check the data in table T1, and if in any row doesn't meet the condition col4 > 1000, the view creation will be rejected.

D

Any row inserted or updated through view V1 must meet the condition that col4 > 1000 and no row in table T1 can be updated such that col4 <= 1000, but new rows in the table can be inserted with col4 <= 1000.

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

根据SQL标准,创建一个视图abc,通过该视图只能对表student中系dept为‘IS’的记录进行更新操作。下面哪条语句适用?()

A create view abc as select * from student where dept=’IS’

B create view abc as select * from student where dept=’IS’ with check option

C create view abc as student where dept=’IS’

D create view abc as select dept=’IS’ from student


参考答案B 单选题

第2题:

A view is created with the following statement:CREATE VIEW v1 AS SELECT col1, col2, col3 FROM t1 WHERE col4 > 1000 ; When will DB2 access the data from table T1 for view V1?()

A.When view V1 is created

B.Each time the REFRESH VIEW v1 statement is executed

C.Each time an SQL statement is executed against view V1

D.Only the first time an SQL statement is executed against view V1


参考答案:C

第3题:

根据“歌手”表建立视图myview,视图中含有包括了“歌手号”左边第一位是“1”的所有记录,正确的SQL语句是 ______。

A.CREATE VIEW myview AS SELECT*FROM歌手WHERE LEFT(歌手号,1)=“1”

B.CREATE VIEW myview AS SELECT*FROM歌手WHERE LIKE(“1”,歌手号)

C.CREATE VIEW myview SELECT*FROM歌手WHERE LEFT(歌手号,1)=“1”

D.CREATE VIEW myview SELECT*FROM歌手WHERE LIKE(“1”,歌手号)


正确答案:A
解析:CREATE VIEW view_name[(column_name[,column_name]...)]
  as select_statement
  其中select_statement可以是任意的SELECT查询语句,它说明和限定了视图中的数据;当没有为视图指定字段名(column_name)时,视图的字段名将与select_statement中指定的字段名或表中的字段名同名。LEFT函数是从字符串的左边(即第一个)开始截取。
  LIKE(〈字符表达式1>字符表达式2〉):比较两个字符串位置上的字符,若所有字符都相匹配,函数返回逻辑真,否则返回逻辑假。〈字符表达式1〉中可以包含通配符*和?。*可以与任何数目的字符相匹配,?可以与任何单字字符相匹配。LIKE('xy?','xyz')的运算结果为逻辑真。

第4题:

Given the following DDL and INSERT statements: CREATE VIEW v1 AS SELECT col1 FROM t1 WHERE col1 > 10; CREATE VIEW v2 AS SELECT col1 FROM v1 WITH CASCADED CHECK OPTION; CREATE VIEW v3 AS SELECT col1 FROM v2 WHERE col1 < 100; INSERT INTO v1 VALUES(5); INSERT INTO v2 VALUES(5); INSERT INTO v3 VALUES(20); INSERT INTO v3 VALUES(100); How many of these INSERT statements will be successful?()

  • A、0
  • B、1
  • C、2
  • D、3

正确答案:C

第5题:

根据“歌手”表建立视图myview,视图中含有“歌手号”左边第一位是"1”的所有记录,正确的SQL语句是( )。

A)CREATE VIEW myview AS SELECT * FROM 歌手 WHERE LEFT(歌手号,1)="1"

B)CREATE VIEW myview AS SELECT * FROM 歌手 WHERE LIKE("1",歌手号)

C)CREATE VIEW myview SELECT * FROM 歌手 WHERE LEFT(歌手号,1)="1"

D)CREATE VIEW myview SELECT * FROM 歌手 WHERE LIKE("1",歌手号)


正确答案:A
建立视图的SQL命令格式是:
CREATE VIEW视图名AS SELECT语句,故可以排除选项C和选项D),而“歌手号’左边第一位是‘1”’应该用LEFT函数实现。

第6题:

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 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 WITH department_id IN (10,20);

E. CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) NO UPDATE;


参考答案:C

第7题:

Given the following DDL and INSERT statements:CREATE VIEW v1 AS SELECT col1 FROM t1 WHERE col1 > 10; CREATE VIEW v2 AS SELECT col1 FROM v1 WITH CASCADED CHECK OPTION; CREATE VIEW v3 AS SELECT col1 FROM v2 WHERE col1 < 100; INSERT INTO v1 VALUES(5); INSERT INTO v2 VALUES(5); INSERT INTO v3 VALUES(20); INSERT INTO v3 VALUES(100);How many of these INSERT statements will be successful?()

A.0

B.1

C.2

D.3


参考答案:C

第8题:

根据 “ 歌手 ” 表建立视图 myview, 视图中含有包括了 “ 歌手号 ” 左边第一位是 “ 1 ” 的所有记录,正确的 SQL 语句是

A)CREATE VIEW myview AS SELECT * FROM 歌手 WHERE LEFT( 歌手号 ,1)="1"

B)CREATE VIEW myview AS SELECT * FROM 歌手 WHERE LIKE("1" , 歌手号 )

C)CREATE VIEW myview SELECT * FROM 歌手 WHERE LEFT( 歌手号 ,1)="1"

D)CREATE VIEW myview SELECT * FROM 歌手 WHERE LIKE("1" , 歌手号 )


正确答案:A

第9题:

A view is created with the following statement:CREATE VIEW v1 AS SELECT col1, col2, col3, col4 FROM t1 WHERE col4 > 1000 WITH CHECK OPTIONWhat is the effect of the CHECK OPTION clause?()

  • A、Any row inserted or updated through view V1 must meet the condition that col4 > 1000.
  • B、From now on, any row inserted or updated in table T1 must meet the condition that col4 > 1000, but existing rows in the table are not checked.
  • C、At view creation, DB2 will check the data in table T1, and if in any row doesn't meet the condition col4 > 1000, the view creation will be rejected.
  • D、Any row inserted or updated through view V1 must meet the condition that col4 > 1000 and no row in table T1 can be updated such that col4 <= 1000, but new rows in the table can be inserted with col4 <= 1000.

正确答案:A

第10题:

设有关系模式商品(商品号,商品名称,单价,数量,类别),建立统计每类商品总数量的视图的正确语句是()

  • A、CREATE VIEW v1AS SELECT类别,SUM(数量)FROM商品GROUP BY类别
  • B、CREATE VIEW v1AS SELECT类别,COUNT(数量)FROM商品GROUP BY类别
  • C、CREATE VIEW v1(类别,总数量)AS SELECT类别,SUM(数量)FROM商品GROUP BY类别
  • D、CREATE VIEW v1(类别,总数量)AS SELECT类别,COUNT(数量)FROM商品GROU PBY类别

正确答案:C

更多相关问题