单选题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 createdB Each time the REFRESH VIEW v1 statement is executed

题目
单选题
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

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

第1题:

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

第2题:

根据“歌手”表建立视图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函数实现。

第3题:

根据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 单选题

第4题:

有关系模式:学生表(学号,姓名,所在系),建立统计每个系的学生人数的视图的正确语句是()

  • A、CREATE VIEW v1AS SELECT所在系,COUNT(*)FROM学生表GROUP BY所在系
  • B、CREATE VIEW v1AS SELECT所在系,SUM(*)FROM学生表GROUP BY所在系
  • C、CREATE VIEW v1(系名,人数)AS SELECT所在系,SUM(*)FROM学生表GROUP BY所在系
  • D、CREATE VIEW v1(系名,人数)AS ELECT所在系,COUNT(*)FROM学生表GROUP BY所在系

正确答案:D

第5题:

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

第6题:

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

第7题:

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

第8题:

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

第9题:

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

  • 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

第10题:

A DBA has been asked to create a table which will contain a substantial amount of detailed sales information for each calendar month and maintain it to contain only the last 12 months. Which of the following methods will facilitate the online removal of the oldest month’s data?()

  • A、Create an MQT that selects the oldest month of data with the REFRESH IMMEDIATE option.
  • B、Create 12 separate tables, create a view based on all 12, drop the table with the oldest month's data then drop and re- create the view.
  • C、Create a range partitioned table, partitioned by month, and use the ALTER TABLE statement to detach the oldest month and attach storage for new data.
  • D、Create a single table, extract the data to be retained using UNLOAD with a SELECT statement, drop and re-create the table then load only the data to be retained.

正确答案:C

更多相关问题