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

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


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

    以下选项中能正确把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。

  • 第2题:

    An application needs a table for each connection that tracks the ID and Name of all items previously ordered and committed within the connection. The table also needs to be cleaned up and automatically removed each time a connection is ended. Assuming the ITEMS table was created with the following SQL statement:CREATE TABLE items item_no INT, item_name CHAR(5), item_qty INT)Which of the following SQL statements will provide the table definition that meets the specified requirements?()

    A.DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE

    B.DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS

    C.CREATE TABLE systmp.tracker AS (SELECT item_num, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS

    D.CREATE TABLE tracker AS (SELECT item_num, item_name FROM items) ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE


    参考答案:B

  • 第3题:

    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

  • 第4题:

    建立一个学生信息表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)选项中,创建表没有表明。

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

    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

  • 第7题:

    An application needs a table for each connection that tracks the ID and Name of all items previously ordered and committed within the connection. The table also needs to be cleaned up and automatically removed each time a connection is ended. Assuming the ITEMS table was created with the following SQL statement: CREATE TABLE items item_no INT, item_name CHAR(5), item_qty INT) Which of the following SQL statements will provide the table definition that meets the specified requirements?()

    • A、DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE
    • B、DECLARE GLOBAL TEMPORARY TABLE tracker AS (SELECT item_no, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS
    • C、CREATE TABLE systmp.tracker AS (SELECT item_num, item_name FROM items) WITH NO DATA ON COMMIT PRESERVE ROWS
    • D、CREATE TABLE tracker AS (SELECT item_num, item_name FROM items) ON COMMIT PRESERVE ROWS ON DISCONNECT DROP TABLE

    正确答案:B

  • 第8题:

    Which two operations can be performed on an external table()

    • A、Create a view on the table.
    • B、Create an index on the table.
    • C、Create a synonym on the table.
    • D、Add a virtual column to the table.
    • E、Update the table using the UPDATE statement.
    • F、Delete rows in the table using the DELETE command.

    正确答案:A,C

  • 第9题:

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

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

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

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

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

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

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


    正确答案:D
    解析:A) 选项中,创建sno字段没有唯一性限制;B) 选项中,创建sname字段没有不为空的限制; C) 选项中,创建表没有表明。

  • 第14题:

    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

  • 第15题:

    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

  • 第16题:

    设有表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

  • 第17题:

    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

  • 第18题:

    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

  • 第19题:

    Evaluate the CREATE TABLE statement:   CREATE TABLE products   (product_id NUMBER (6)  CONSTRAINT prod_id_pk PRIMARY KEY,  product_name VARCHAR2 (15));   Which statement is true regarding the PROD_ID_PK constraint?()

    • A、 It would be created only if a unique index is manually created first.
    • B、 It would be created and would use an automatically created unique index.
    • C、 It would be created and would use an automatically created nonunique index.
    • D、 It would be created and remains in a disabled state because no index is specified in the command.

    正确答案:B

  • 第20题:

    Which two operations can be performed on an external table()

    • A、Create a view on the table.
    • B、Create an index on the table.
    • C、Create a synonym on the table.
    • D、Add a virtual column to the table.
    • E、Update the table using the UPDATE statement.
    • F、Delete rows in the table using the DELETE command

    正确答案:A,C

  • 第21题:

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

  • 第22题:

    单选题
    View the Exhibit and examine the structure of the EMP table. You executed the following command to add a primary key to the EMP table:   ALTER TABLE emp   ADD CONSTRAINT emp_id_pk  PRIMARY KEY (emp_id)   USING INDEX emp_id_idx;   Which statement is true regarding the effect of the command?()
    A

     The PRIMARY KEY is created along with a new index.

    B

     The PRIMARY KEY is created and it would use an existing unique index.

    C

     The PRIMARY KEY would be created in a disabled state because it is using an existing index.

    D

     The statement produces an error because the USING clause is permitted only in the CREATE TABLE command.


    正确答案: 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
    解析: 暂无解析