niusouti.com

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


相似考题
更多“单选题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”相关问题
  • 第1题:

    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

  • 第2题:

    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

  • 第3题:

    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

  • 第4题:

    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 and C2 together, which statement(s) will create index(es) that will provide optimal query performance? ()

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

    正确答案:A

  • 第5题:

    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

  • 第6题:

    Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()

    • A、INSERT INTO tab1 SELECT cx, cy FROM tab2
    • B、INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)
    • C、INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)
    • D、INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)

    正确答案:A

  • 第7题:

    You are responsible for managing the database schema for an order entry application in a SQL Server 2005 database. After a design review, a member of the development staff asks you to add a new column named CommissionRate to the Product table. Because the actual commission rates for all products are not known at this time, each product has a default commission rate of 12 percent. The rate can be modified as necessary. You add the new column. You need to configure the table to assign the default value as efficiently as possible. What should you do?()

    • A、 Create an INSERT trigger to assign the default value to each item in the table. 
    • B、 Create a CHECK constraint to validate the data and to assign the default value to each item in the table. 
    • C、 Create an UPDATE trigger to update the default value for each new item in the table. 
    • D、 Create a DEFAULT constraint to assign the default value specifying the WITH VALUES argument.

    正确答案:D

  • 第8题:

    单选题
    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
    解析: 暂无解析

  • 第9题:

    单选题
    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
    解析: 暂无解析

  • 第10题:

    单选题
    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
    解析: 暂无解析

  • 第11题:

    单选题
    Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()
    A

    INSERT INTO tab1 SELECT cx, cy FROM tab2

    B

    INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)

    C

    INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)

    D

    INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)


    正确答案: B
    解析: 暂无解析

  • 第12题:

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


    正确答案: B
    解析: 暂无解析

  • 第13题:

    你定义了一个对象类型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

  • 第14题:

    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

  • 第15题:

    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

  • 第16题:

    Which of the following statements is used to prevent user TOM from adding and deleting data in table TAB1?()

    • A、REVOKE ADD, DELETE FROM USER tom ON TABLE tab1
    • B、REVOKE ADD, DELETE ON TABLE tab1 FROM USER tom
    • C、REVOKE INSERT, DELETE FROM USER tom ON TABLE tab1
    • D、REVOKE INSERT, DELETE ON TABLE tab1 FROM USER tom

    正确答案:D

  • 第17题:

    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

  • 第18题:

    你定义了一个对象类型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

  • 第19题:

    单选题
    Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()
    A

    INSERT INTO tab1 SELECT cx, cy FROM tab2

    B

    INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)

    C

    INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)

    D

    INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)


    正确答案: A
    解析: 暂无解析

  • 第20题:

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


    正确答案: A
    解析: 暂无解析

  • 第21题:

    单选题
    Which of the following statements is used to prevent user TOM from adding and deleting data in table TAB1?()
    A

    REVOKE ADD, DELETE FROM USER tom ON TABLE tab1

    B

    REVOKE ADD, DELETE ON TABLE tab1 FROM USER tom

    C

    REVOKE INSERT, DELETE FROM USER tom ON TABLE tab1

    D

    REVOKE INSERT, DELETE ON TABLE tab1 FROM USER tom


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    You are responsible for managing the database schema for an order entry application in a SQL Server 2005 database. After a design review, a member of the development staff asks you to add a new column named CommissionRate to the Product table. Because the actual commission rates for all products are not known at this time, each product has a default commission rate of 12 percent. The rate can be modified as necessary. You add the new column. You need to configure the table to assign the default value as efficiently as possible. What should you do?()
    A

     Create an INSERT trigger to assign the default value to each item in the table. 

    B

     Create a CHECK constraint to validate the data and to assign the default value to each item in the table. 

    C

     Create an UPDATE trigger to update the default value for each new item in the table. 

    D

     Create a DEFAULT constraint to assign the default value specifying the WITH VALUES argument.


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    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
    解析: 暂无解析

  • 第24题:

    单选题
    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 and C2 together, which statement(s) will create index(es) that will provide optimal query performance? ()
    A

     CREATE UNIQUE INDEX xtab1 ON tab1 (c1) include (c2)

    B

     CREATE UNIQUE INDEX xtab1 ON tab1 (c1);  CREATE INDEX xtab2 ON tab1 (c3) INCLUDE (c2) 

    C

     CREATE UNIQUE INDEX xtab1 ON tab1 (c2, c1)

    D

     CREATE UNIQUE INDEX xtab1 ON tab1 (c2) INCLUDE (c1)


    正确答案: C
    解析: 暂无解析