Given the following statements:CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT);

题目

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题:

YouworkwithadatabasenamedDB1,whichislocatedonaSQLServer2005computer.YoudiscoverthatatablescanonTable1inDB1causesaslowquery.Table1isaverylargetablethatisusedfrequently.Youascertainthatthequerycontainsthefollowingstatement.SELECTcol1,col2FROMtable1WHEREcol3=Youneedtoprovidemaximumqueryperformance.Table1mustremainavailabletousers.Whatshouldyoudo?()

A.UpdateallstatisticsonTable1inDB1.

B.UsetheCREATESTATISTICSstatementinDB1tocreatemissingstatisticsoncol3ofTable1.

C.Setthepriorityboostserveroptionto1.

D.Executethefollowingstatement.USEDB1GOCREATEINDEXindex1ONtable1(col3)INCLUDE(col1,col2)WITH(ONLINE=ON)GO


参考答案:D

第2题:

下列哪组SQL命令全部属于数据定义语句的命令?()

A.CREATE,DROP,ALTER

B.CREATE,DROP,SELECT

C.CREATE,DROP,GRANT

D.CREATE,DROP,UPDATE


CREATE,DROP,ALTER

第3题:

你正在SQLSERVER2005服务器上一个名为DB1的数据库上进行着工作。你发现由于对DB1中Table1表的扫描导致了查询执行缓慢。已知,Table是一个使用频繁而且非常巨大的表,同时你又确定了查询中包含如下的语句:SELECTcol1,col2FROMtable1WHEREcol3=。在表保持对所有用户有效的情况下,为了最大化的提高查询性能,你应该怎么做?()

A.更新DB1数据库中表Table1的所有统计信息

B.在DB1数据库中,使用CREATESTATISTICS语句为表Table1的列col3创建缺少的统计信息

C.设置优先值提升选项的值为1

D.执行如下语句:USEDB1GOCREATEINDEXindex1ONtable1(col3)INCLUDE(col1,col2)WITH(ONLINE=ON)GO

E.执行如下语句USEDB1GOCREATEINDEXindex1ONtable1(col3,col2,col1)


参考答案:D

第4题:

在C++语言中,在某些应用时,经常会碰到需要用到二维数组的情况。现在有如下应用要求,要求分别创建一个int类型二维数组的构造函数,以及一个int类型二维数组的释放函数,其函数的定义如下,请你实现他们。 int ** create2DArray(int d1, int d2); void destory2DArray(int ** array);


B

第5题:

对于表A(col1 int,col2 char(1))更新col1=1的数据col2值为N,下面语句正确的是()

A.update table A set col2=’N’ where col1=1

B.modify table A set col2=N where col1=1

C.update A set col2=’N’ where col1=1

D.modify A set col2=N where col1=1


第6题:

下列四组SQL命令,全部属于数据定义语句的命令是()

A.CREATE,DROP,UPDATE

B.CREATE,DROP,ALTER

C.CREATE,DROP,GRANT

D.CREATE,DROP,SELECT


CREATE , DROP , ALTER

第7题:

对于表A(col1 int,col2 char(1))使用聚合函数sum,下面语句正确的是()

A.select sum(col2) as col2 from A group by col1

B.select sum(col1) as col1 from A group by col2

C.select sum(col1) as col1,col2 from A group by col1

D.select sum(col2) as col1 from A group by col2


逻辑右移

第8题:

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

第9题:

【单选题】对于建立在数据库上的DDL触发器,常用的激活DDL触发器的事件不包括()

A.Create_Table,Alter_Table,Drop_Table

B.Create_View,Alter_View,Drop_View

C.Create_Procedure,Alter_Procedure,Drop_Procedure

D.Rollback


Rollback

第10题:

如果要让某个用户能够在所有模式下建表应该授予此用户哪个权限?

A.create table

B.create any table

C.create all table

D.create * table


create any table