IBM(000-730)

单选题Given the following statements: CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3); W

题目
单选题
Given the following statements: CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3); What is the result of the following query? SELECT count(*) FROM tab2;()
A

3

B

2

C

1

D

0

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

第1题:

Given the following statements:CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3);What is the result of the following query? SELECT count(*) FROM tab2;()

A.3

B.2

C.1

D.0


参考答案:D

第2题:

The following triggers were defined for table TAB1 in the order shown:CREATE TRIGGER trig_a AFTER UPDATE ON tab1 FOR EACH ROW UPDATE sale_tab SET sale_date = CURRENT DATE; CREATE TRIGGER trig_b AFTER UPDATE ON tab1 FOR EACH STATEMENT UPDATE invoice_tab SET invoice_date = CURRENT DATE; CREATE TRIGGER trig_c AFTER UPDATE ON tab1 FOR EACH ROW UPDATE shipping_tab SET ship_date = CURRENT DATE; CREATE TRIGGER trig_d AFTER UPDATE ON tab1 FOR EACH STATEMENT UPDATE billing_tab SETbilling_date = CURRENT DATE;If an event occurs that causes all of them to activate, which trigger will be activated first?()

A.TRIG_A

B.TRIG_B

C.TRIG_C

D.TRIG_D


参考答案:A

第3题:

Which of the following statements is used to grant user TOM and Application team APPGRP the ability to add data to table TAB1?()

A.GRANT ADD DATA ON TABLE tab1 TO GROUP tom appgrp

B.GRANT INSERT TO USER tom, GROUP appgrp ON TABLE tab1

C.GRANT INSERT ON TABLE tab1 TO USER tom, GROUP appgrp

D.GRANT ADD DATA ON TABLE tab1 TO USER appgrp, GROUP tom


参考答案:C

第4题:

If a unique constraint is defined on column COL1 of table TAB1, what are the characteristics of COL1?()

  • A、COL1 will accept NULL values and can be referenced in another table's foreign key specification.
  • B、COL1 will not accept NULL values and cannot be referenced in another tables foreign key specification.
  • C、COL1 will not accept NULL values and can be referenced in another tables foreign key specification.
  • D、COL1 will accept NULL values and cannot be referenced in another tables foreign key specification.

正确答案:C

第5题:

Table TAB1 was created using the following statement: CREATE TABLE tab1 (c1 INT, c2 INT, c3 INT, c4 INT, c5 INT); If column C1 is unique and queries typically access columns C1, C2 and C3 together, which statement(s) will createindex(es) that will provide optimal query performance?()

  • A、CREATE UNIQUE INDEX xtab1 ON tab1 (c1); CREATE INDEX xtab2 ON tab1 (c2) INCLUDE (c3)  
  • B、CREATE UNIQUE INDEX xtab1 ON tab1 (c1) INCLUDE (c2, c3) 
  • C、CREATE UNIQUE INDEX xtab1 ON tab1 (c3, c2, c1)  
  • D、CREATE UNIQUE INDEX xtab1 ON tab1 (c2) INCLUDE (c1, c3)

正确答案:B

第6题:

The following statements:CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, ‘a‘), (1, ‘b‘), (2,‘c‘); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300);How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()

A.4

B.3

C.1

D.0


参考答案:D

第7题:

你定义了一个对象类型myOBJ,要基于该类型来创建表tab1,语句为()。

A.CREATE TABLE tab1 OF myOBJ

B.CREATE TABLE myOBJ OF tab1

C.CREATE TABLE tab1 AS myOBJ

D.CREATE TABLE tab1 TYPE OF myOBJ


参考答案:C

第8题:

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

第9题:

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

第10题:

Which of the following statements is used to grant user TOM and Application team APPGRP the ability to add data to table TAB1?()

  • A、GRANT ADD DATA ON TABLE tab1 TO GROUP tom appgrp
  • B、GRANT INSERT TO USER tom, GROUP appgrp ON TABLE tab1
  • C、GRANT INSERT ON TABLE tab1 TO USER tom, GROUP appgrp
  • D、GRANT ADD DATA ON TABLE tab1 TO USER appgrp, GROUP tom

正确答案:C

更多相关问题