网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
存在两个结构相同的数据库表T1(col1,col2,col3)、T2(col1,col2,col3),写出一SQL语句将所有T1数据导入到T2表()
A
select col1,col2,col3 from T1 into T2(col1,col2,col3)
B
insert T1 (col1,col,col3) into T2(col1,col2,col3)
C
insert into T2 (col1,col2,col3) as select col1,col2,col3 from T1
D
insert into T2(col1,col2,col3) select col1,col2,col3 from T1;
参考答案
参考解析
解析:
暂无解析
更多 “单选题存在两个结构相同的数据库表T1(col1,col2,col3)、T2(col1,col2,col3),写出一SQL语句将所有T1数据导入到T2表()A select col1,col2,col3 from T1 into T2(col1,col2,col3)B insert T1 (col1,col,col3) into T2(col1,col2,col3)C insert into T2 (col1,col2,col3) as select col1,col2,col3 from T1D insert into T2(col1,col2,col3) select col1,col2,col3 from T1;” 相关考题
考题
在“住宿管理”数据库中有“学生”表和“宿舍”表。用SQL语句完成查询,结果为学生姓名及所住的宿舍电话号码,并将结果存放于表。result中,将SQL语句保存在result.prg文件中。
考题
你正在SQLSERVER2005服务器上一个名为DB1的数据库上进行着工作。你发现由于对DB1中Table1表的扫描导致了查询执行缓慢。已知,Table是一个使用频繁而且非常巨大的表,同时你又确定了查询中包含如下的语句:SELECTcol1,col2FROMtable1WHEREcol3=。在表保持对所有用户有效的情况下,为了最大化的提高查询性能,你应该怎么做?()
A.更新DB1数据库中表Table1的所有统计信息B.在DB1数据库中,使用CREATESTATISTICS语句为表Table1的列col3创建缺少的统计信息C.设置优先值提升选项的值为1D.执行如下语句:USEDB1GOCREATEINDEXindex1ONtable1(col3)INCLUDE(col1,col2)WITH(ONLINE=ON)GOE.执行如下语句USEDB1GOCREATEINDEXindex1ONtable1(col3,col2,col1)
考题
Giventwocollectionobjectsreferencedbycol1andcol2,whichofthesestatementsaretrue?()
A.Theoperationcol1.retainAll(col2)willnotmodifythecol1object.B.Theoperationcol1.removeAll(col2)willnotmodifythecol2object.C.Theoperationcol1.addAll(col2)willreturnanewcollectionobject,containingelementsfrombothcol1 andcol2.D.Theoperationcol1.containsAll(Col2)willnotmodifythecol1object.
考题
数据库中有Tahie_priceHistory表,结构如下表所示:[*]①写出创建Teachers表的SQL语句,要求语句中包含所有的约束。②现要查询单价最高的前三种商品的商品编号、商品名称和单价(使用TOP语句)。
考题
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.0B.1C.2D.3
考题
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.4B.3C.1D.0
考题
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
考题
客服业务受到SQL语句的影响非常大,以下哪些是执行效率比较低的SQL语句,可以进行优化()A、select*from record where substrb(CardNo,1,4)=’5378’;B、表tab1中的列col1是字符型(char),执行select col1,col2 from tab1 where col1’10’;C、select count(*)from stuff where id_no in(’0’,’1’);D、UPDATE SERVICEINFO SET STATE=0WHERE STATE0。
考题
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.
考题
对于表A(col1 int,col2 char(1)),表B(col1 int,col2char(1)),为确保表A的数据全部被保留,下面正确的联接方式是()A、A inner join BB、A left join BC、A right join BD、Across join B
考题
对于表A(col1 int,col2 char(1))更新col1=1的数据col2值为N,下面语句正确的是()A、update table A setcol2=’N’ where col1=1B、modify table A setcol2=N where col1=1C、update A set col2=’N’ where col1=1D、modify A set col2=N where col1=1
考题
存在两个结构相同的数据库表T1(col1,col2,col3)、T2(col1,col2,col3),写出一SQL语句将所有T1数据导入到T2表()A、select col1,col2,col3 from T1 into T2(col1,col2,col3)B、insert T1 (col1,col,col3) into T2(col1,col2,col3)C、insert into T2 (col1,col2,col3) as select col1,col2,col3 from T1D、insert into T2(col1,col2,col3) select col1,col2,col3 from T1;
考题
Given two collection objects referenced by col1 and col2,which of these statements are true?()A、The operation col1.retainAll(col2) will not modify the col1 object.B、The operation col1.removeAll(col2) will not modify the col2 object.C、The operation col1.addAll(col2) will return a new collection object, containing elements from both col1 and col2.D、The operation col1.containsAll(Col2) will not modify the col1 object.
考题
你正在SQL SERVER 2005 服务器上一个名为DB1的数据库上进行着工作。你发现由于对DB1中Table1表的扫描导致了查询执行缓慢。已知,Table是一个使用频繁而且非常巨大的表,同时你又确定了查询中包含如下的语句:SELECT col1,col2 FROM table1 WHERE col3 = 。在表保持对所有用户有效的情况下,为了最大化的提高查询性能,你应该怎么做?()A、更新DB1数据库中表Table1的所有统计信息B、在DB1数据库中,使用CREATE STATISTICS 语句为表Table1的列col3创建缺少的统计信息C、设置优先值提升选项的值为1D、执行如下语句:USE DB1 GO CREATE INDEX index1 ON table1(col3) INCLUDE(col1, col2) WITH (ONLINE = ON) GOE、执行如下语句 USE DB1GOCREATE INDEX index1 ON table1(col3, col2,col1)
考题
You work with a database named DB1, which is located on a SQL Server 2005 computer. You discover that a table scan on Table1 in DB1 causes a slow query. Table1 is a very large table that is used frequently. You ascertain that the query contains the following statement. SELECT col1, col2 FROM table1 WHERE col3 = You need to provide maximum query performance. Table1 must remain available to users. What should you do?()A、Update all statistics on Table1 in DB1.B、Use the CREATE STATISTICS statement in DB1 to create missing statistics on col3of Table1.C、Set the priority boost server option to 1.D、Execute the following statement.USE DB1GOCREATE INDEX index1 ON table1(col3)INCLUDE(col1, col2) WITH (ONLINE = ON)GO
考题
单选题对于表A(col1 int,col2 char(1)),表B(col1 int,col2char(1)),为确保表A的数据全部被保留,下面正确的联接方式是()A
A inner join BB
A left join BC
A right join BD
Across join B
考题
单选题hive是基于Hadoop的一个()工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能,可以将sql语句转换为MapReduce任务进行运算。A
数据库B
数据仓库C
表格D
文字
考题
单选题你正在SQL SERVER 2005 服务器上一个名为DB1的数据库上进行着工作。你发现由于对DB1中Table1表的扫描导致了查询执行缓慢。已知,Table是一个使用频繁而且非常巨大的表,同时你又确定了查询中包含如下的语句:SELECT col1,col2 FROM table1 WHERE col3 = 。在表保持对所有用户有效的情况下,为了最大化的提高查询性能,你应该怎么做?()A
更新DB1数据库中表Table1的所有统计信息B
在DB1数据库中,使用CREATE STATISTICS 语句为表Table1的列col3创建缺少的统计信息C
设置优先值提升选项的值为1D
执行如下语句:USE DB1 GO CREATE INDEX index1 ON table1(col3) INCLUDE(col1, col2) WITH (ONLINE = ON) GOE
执行如下语句 USE DB1GOCREATE INDEX index1 ON table1(col3, col2,col1)
考题
单选题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
0B
1C
2D
3
考题
多选题Given two collection objects referenced by col1 and col2,which of these statements are true?()AThe operation col1.retainAll(col2) will not modify the col1 object.BThe operation col1.removeAll(col2) will not modify the col2 object.CThe operation col1.addAll(col2) will return a new collection object, containing elements from both col1 and col2.DThe operation col1.containsAll(Col2) will not modify the col1 object.
考题
问答题写出Tansact-SQL语句,授予用户Dick创建数据库和创建表的许可,拒绝用户Tom在company数据库employee表中使用insert,update语句来更改数据库。
考题
填空题使用连接对象的Execute方法可以执行各种SQL语句,以完成创建数据库、创建表、添加新记录、修改记录及删除记录等任务。试完成填空题。 已知变量tid,tname,tpwd,tage分别表示从表单中接收到的数据,假设已完成数据合法检验。试写出在student表中插入一条新记录的SQL语句。要求将变量替换到SQL语句中。 conn.Execute("Insert into student() values (’"tid"’,’"tname"’, ’"tpwd"’,"tage")")
考题
单选题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 executedC
Each time an SQL statement is executed against view V1D
Only the first time an SQL statement is executed against view V1
考题
单选题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.
考题
单选题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
4B
3C
1D
0
热门标签
最新试卷