IBM(000-730)

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

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

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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

第2题:

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

第3题:

Which of the following is not part of contract administration

A contract award

B performance control

C financial control

D contract closeout

E All of the above are parts of contract administration.


正确答案:A

第4题:

The greatest strain,when lifting a load with the jumbo purchase,is on ______.

A.all of the parts,dividing the load equally

B.the hauling part because it must absorb the frictional losses of all the sheaves

C.the parts in the movable block

D.the standing part because it is directly connected to the weight


正确答案:B

第5题:

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

第6题:

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

第7题:

Given the following requirements:Create a table named TESTTAB, which has an identity column named ACTIVITYNO. Define the identity column to generate the values for the column by default. Start the values at 10 and increment by 10. Make the identity column unique. Which of the following CREATE statements will successfully create this table?()

A.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

B.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTNO))

C.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 1), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))

D.CREATE TABLE TESTTAB (ACTIVITYNO SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 10), ACTKWD CHAR(6) NOT NULL, ACTDESC VARCHAR(20) NOT NULL, UNIQUE(ACTIVITYNO))


参考答案:D

第8题:

154 Which of the following is not part of contract administration

A. contract award

B. performance control

C. financial control

D. contract closeout

E. All of the above are parts of contract administration


正确答案:A

第9题:

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

第10题:

Given the following table definition: STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2) If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used to update the STOCK table to indicate that all the items whose description begins with the letter "S" are out of stock?()

  • A、UPDATE stock SET (status = NULL; quantity, price = 0) WHERE item LIKE S%
  • B、UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE item LIKE S%
  • C、UPDATE stock SET status = NULL, SET quantity = 0, SET price = 0 WHERE item LIKE 'S%'
  • D、UPDATE stock SET (status = NULL), (quantity = 0), (price = 0) WHERE item LIKE S%

正确答案:B

更多相关问题