Given the following table defin

题目

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%
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Consider the following table:Which method should used to add a new g201305 partition to the table?()

A.A

B.B

C.C

D.D

E.E


参考答案:E

第2题:

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

第3题:

Questions 59-60 are based on the following information

A hash table With hash function

H1(k)=k mod 13

Is shown below.

Collision is resolved using the hash function H2(k)=(k mod 11)+1

How many key comparisons occur in searching for key 35 in the given hash table?

A.0

B.1

C.2

D.3


正确答案:D

第4题:

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

第5题:

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

第6题:

Which of the following scenarios will ensure that the value of the NEXT_STEPNO column in a given row of table TABLEX exists as a value of column STEPNO (usually in another row) in the same table?()

A.Define a UNIQUE constraint on the columns NEXT_STEPNO and STEPNO.

B.Define a CHECK constraint on the NEXT_STEPNO column (NEXT_STEPNO = STEPNO).

C.Define column STEPNO as the primary key of TABLEX and column NEXT_STEPNO as a foreign key referencing column STEPNO of the same table.

D.Define column NEXT_STEPNO as the primary key of TABLEX and column STEPNO as a foreign key referencing column NEXT_STEPNO in the same table.


参考答案:C

第7题:

Given the following function:CREATE FUNCTION emplist () RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN (‘A00‘, ‘B00‘); ENDHow can this function be used in an SQL statement?

A.SELECT TABLE(EMPLIST()) FROM EMPLOYEE

B.SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE

C.SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE

D.SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t


参考答案:D

第8题:

If a new key 67 is inserted into the given hash table,what will be its address?

A.3

B.4

C.5

D.6


正确答案:B

第9题:

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

第10题:

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

更多相关问题