niusouti.com

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

题目
单选题
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
解析: 暂无解析
更多“单选题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 prov”相关问题
  • 第1题:

    以下选项中不能正确把c1定义成结构体变量的是

    A.typedef struct {int red: int green: int blue; } COLOR; COLOR c1;

    B.struct color c1 {int red int green: int blue; };

    C.struct color {int red , int green : int blue : )cl;

    D.struct {int red; int green; int blue } c1 ;


    正确答案:B
    解析:本题考核的知识点是结构体类型定义。结构体类型的定义格式为:strcut结构体名{成虽说明列表};结构体变量的定义有3种形式:第一种,定义结构体型的同时定义结构体变量,如:strcut结构体名{成员说明列表}变量;选项C属于这种情况,故选项C正确:第二种,先定义一个结构体类型,然后使用该类型来定义结构体变量,如:strcutstudent{成员说明列表}:student变量;选项A属于这种情况,故选项A正确;第三种,定义一个无名称的结构体类型的同时定义结构体变量,如:strcutstudent{成员说明列表}变量;选项D属于这种情况,故选项D正确.所以,4个选项中选项B符合题意。

  • 第2题:

    以下选项中不能正确把c1定义成结构体变量的是

    A.typedef struct { int red; int green;; int blue; }COLOR; COLOR cl;

    B.struct color cl { int red; int green; int blue; };

    C.struet color { int red; int green; int blue; }c1;

    D.struct { int red; int green; int blue; }cl;


    正确答案:B
    解析:结构体类型的定义格式为:
      stract结构体名
      成员说明列表};
      结构体变量的定义有3种形式:第一种,定义结构体类型的同时定义结构体变量,如: street结构体名{成员说明列表}变量;第二种,先定义一个结构体类型,然后使用该类型来定义结构体变量,如:strect student{成员说明列表};student变量;第三种,定义一个无名称的结构体类型的同时定义结构体变量,如:strect student{成员说明列表}变量;。

  • 第3题:

    若有以下程序段: int c1=1,c2=2,c3: c3=c1/c2:

    A.0

    B.1/2

    C.0.5

    D.1


    正确答案:A
    cl和c2都是整数,1/2取整得0,舍弃小数点。因此正确答案为A。

  • 第4题:

    以下选项中能正确把c1定义成结构体变量的是( )。

    A.typedef struct { int red; int red; int green; int blue; }COLOR; COLOR c1;

    B.struct color c1 { int red int red; int green int blue; };

    C.stmctcolor { int red, int green; int blue; }c1;

    D.struct { int red; int green; int blue; }c1;


    正确答案:D
    解析:因为结构体中不能出现同名的成员变量,所以选项A和B都是错误的;又因为结构体中成员的定义应该由分号隔开,所以选项C也是错误的。选项D定义了一个无名结构体,并同时定义该结构体变量c1,是正确的写法。故应该选择D。

  • 第5题:

    TableTAB1wascreatedusingthefollowingstatement:CREATETABLEtab1(c1INT,c2INT,c3INT,c4INT,c5INT);IfcolumnC1isuniqueandqueriestypicallyaccesscolumnsC1andC2together,whichstatement(s)willcreateindex(es)thatwillprovideoptimalqueryperformance?()

    A.CREATEUNIQUEINDEXxtab1ONtab1(c1)include(c2)

    B.CREATEUNIQUEINDEXxtab1ONtab1(c1);CREATEINDEXxtab2ONtab1(c3)INCLUDE(c2)

    C.CREATEUNIQUEINDEXxtab1ONtab1(c2,c1)

    D.CREATEUNIQUEINDEXxtab1ONtab1(c2)INCLUDE(c1)


    参考答案:A

  • 第6题:

    建立一个学生信息表student,要求它由学号sno,姓名sname,性别sex,年龄age,4个属性组成,其学号属性惟一,学号、姓名字段不能为空。下列语句正确的是

    A.CREATE TABLE student (sno char(5)NOT NULL sname char(8)NOT NULL sex char age int);

    B.CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8) sex char age int);

    C.CREATE TABLE (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char age int);

    D.CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char age int);


    正确答案:D
    解析:本题主要考查了SQL语言中,创建基本表的方法。 A)选项中,创建sno字段没有惟一性限制;B)选项中,创建sname字段没有不为空的限制;C)选项中,创建表没有表明。

  • 第7题:

    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

  • 第8题:

    Given the following DDL for the PARTS table:CREATE TABLE parts (part_no INT(9) NOT NULL, part_name VARCHAR(24), part_remain INT(9));All part numbers entered will be different and all rows should be displayed in order of increasing part numbers whenever the table is queried. Which of the following create index statements will meet this criteria and require the least amount of storage for the index object?()

    • A、CREATE UNIQUE INDEX idx_partno ON parts(part_no)
    • B、CREATE UNIQUE INDEX idx_partno ON parts(part_name ASC)
    • C、CREATE UNIQUE INDEX idx_partno ON parts(part_name, part_no ASC)
    • D、CREATE UNIQUE INDEX idx_partno ON parts(part_no, part_name ASC)

    正确答案:A

  • 第9题:

    Given the following two tables: TAB1 C1 C2 A 11 B 12 C 13 TAB2 CX CY A 21 C 22 D 23 The following results are desired: C1 C2 CX CY A 11 A 21 C 13 C 22 -- --D 23 Which of the following queries will yield the desired results?()

    • A、SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
    • B、SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx
    • C、SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
    • D、SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx

    正确答案:D

  • 第10题:

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

  • 第11题:

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

  • 第12题:

    单选题
    设有表T,现要在该表新增加一个列,列名为:c1,类型为int。下列能实现该功能的语句是()。
    A

    ALTER TABLE T ADD COLUMN c1 int

    B

    ALTER TABLE T ADD (c1 int)

    C

    ALTER TABLE T ADD COLUMN c1

    D

    ALTER TABLE T ADD c1


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

  • 第13题:

    若有以下程序段:int c1=1, c2=2,c3;c3=1.0/c2*c1;则执行后,c3中的值是______。

    A.0

    B.0.5

    C.1

    D.2


    正确答案:A

  • 第14题:

    下列程序段执行后,c3中的值是______。int c1=1,c2=2,c3;c3=1.0/c2*c1;

    A.0

    B.0.5

    C.1

    D.2


    正确答案:A

  • 第15题:

    请说出该程序段的功能。

    declare @e numeric(5,2)

    declare @ c1 int, @ c2 int, @ c3 int, @ c4 int

    set @ c1=0; set @ c2 =0; set @ c3=0; set @ c4=0

    declare xxx cursor

    for select 成绩 from score

    open xxx

    fetch xxx into @ c

    while @'@ fetch_status = 0

    begin

    if(@c > =90) set @cl =@ e1 +1;

    else if( @ c > =70) set @ c2 =@ c2 +1;

    else if(@ c> =60) set @ c3 =@ c3 +1;

    else set @ c4 = @ c4 + 1

    fetch from xxx into @ c

    end

    close xxx

    deallocate xxx

    print 优秀生人数:'+sb(@ c1,5);

    print食好生人数:'+str(@ c2,5);

    print及格生人数:'+str(@ c3,5);

    print及格生人数:'+sh(@ c4,5)


    正确答案:该程序段功能:从score表中按成绩统计并显示出优秀、良好、及格、不及格各多少人。
    该程序段功能:从score表中按成绩统计并显示出优秀、良好、及格、不及格各多少人。

  • 第16题:

    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

  • 第17题:

    若有程序段: int c1=1,c2=2,c3; c3=1.0/c2 * cl; 则执行后,c3中的值是 ( )

    A.0

    B.0.5

    C.1

    D.2


    正确答案:A

  • 第18题:

    设有表T,现要在该表新增加一个列,列名为:c1,类型为int。下列能实现该功能的语句是()。

    AALTER TABLE T ADD COLUMN c1 int

    BALTER TABLE T ADD (c1 int)

    CALTER TABLE T ADD COLUMN c1

    DALTER TABLE T ADD c1


    A

  • 第19题:

    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

  • 第20题:

    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

  • 第21题:

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

  • 第22题:

    单选题
    Given the following two tables: TAB1 C1 C2 A 11 B 12 C 13 TAB2 CX CY A 21 C 22 D 23 The following results are desired: C1 C2 CX CY A 11 A 21 C 13 C 22 -- --D 23 Which of the following queries will yield the desired results?()
    A

    SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx

    B

    SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx

    C

    SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx

    D

    SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx


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

  • 第23题:

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

  • 第24题:

    单选题
    Given the following two tables: TAB1 C1 C2 A 11 B 12 C 13 TAB2 CX CY A 21 C 22 D 23 The following results are desired: C1 C2 CX CY A 11 A 21 C 13 C 22 -- --D 23 Which of the following queries will yield the desired results?()
    A

    SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx

    B

    SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx

    C

    SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx

    D

    SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx


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