最新的IBM DB2 9 Family Fundamentals - C2090-730免費考試真題
問題1
Which two of the following are optional and do not have to be specified when creating a table?
Which two of the following are optional and do not have to be specified when creating a table?
正確答案: C,D
問題2
Given the following two tables:
NAMES NAME NUMBER
Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Mark Messier 11 POINTS NAME POINTS
Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94
Which of the following statements will display the player name, number, and points for all players that have scored points?
Given the following two tables:
NAMES NAME NUMBER
Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Mark Messier 11 POINTS NAME POINTS
Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94
Which of the following statements will display the player name, number, and points for all players that have scored points?
正確答案: C
問題3
Given the following table:
TEMP_DATA
TEMP DATE
45 12/25/2006 51 12/26/2006 67 12/27/2006 72 12/28/2006 34 12/29/2006 42 12/30/2006
And the following SQL statement:
CREATE FUNCTION degf_to_c (temp INTEGER) RETURNS INTEGER LANGUAGE SQL CONTAINS SQL NO EXTERNAL ACTION DETERMINISTIC BEGIN ATOMIC DECLARE newtemp INTEGER; SET newtemp = temp - 32; SET newtemp = newtemp * 5; RETURN newtemp / 9; END
Which two of the following SQL statements illustrate the proper way to invoke the scalar function DEGF_TO_C?
Given the following table:
TEMP_DATA
TEMP DATE
45 12/25/2006 51 12/26/2006 67 12/27/2006 72 12/28/2006 34 12/29/2006 42 12/30/2006
And the following SQL statement:
CREATE FUNCTION degf_to_c (temp INTEGER) RETURNS INTEGER LANGUAGE SQL CONTAINS SQL NO EXTERNAL ACTION DETERMINISTIC BEGIN ATOMIC DECLARE newtemp INTEGER; SET newtemp = temp - 32; SET newtemp = newtemp * 5; RETURN newtemp / 9; END
Which two of the following SQL statements illustrate the proper way to invoke the scalar function DEGF_TO_C?
正確答案: A,D
問題4
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?
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?
正確答案: D
問題5
If DB2 detects a deadlock between application A and application B (each waiting for a lock held by the other one), what action will DB2 take?
If DB2 detects a deadlock between application A and application B (each waiting for a lock held by the other one), what action will DB2 take?
正確答案: C
問題6
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;
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;
正確答案: B
問題7
Given the following two tables:
EMPLOYEE
ID NAME DEPTID
01 Mick Jagger 10 02 Keith Richards 20 03 Ronnie Wood 20 04 Charlie Watts 20 05 Bill Wyman 30 06 Brian Jones
DEPARTMENT
ID DEPTNAME
10 Executive Staff 20 Sales 30 Marketing 40 Engineering 50 Human Resources
Which two of the following queries will display the employee name and department name for all employees that are in Sales?
Given the following two tables:
EMPLOYEE
ID NAME DEPTID
01 Mick Jagger 10 02 Keith Richards 20 03 Ronnie Wood 20 04 Charlie Watts 20 05 Bill Wyman 30 06 Brian Jones
DEPARTMENT
ID DEPTNAME
10 Executive Staff 20 Sales 30 Marketing 40 Engineering 50 Human Resources
Which two of the following queries will display the employee name and department name for all employees that are in Sales?
正確答案: A,D
問題8
What does the following statement do? GRANT REFERENCES (col1, col2) ON TABLE table1 TO user1 WITH GRANT OPTION
What does the following statement do? GRANT REFERENCES (col1, col2) ON TABLE table1 TO user1 WITH GRANT OPTION
正確答案: D
問題9
Given the following query:
SELECT quantity,
CASE WHEN itemcode = '099' THEN 'SILVER'
WHEN itemcode = '788' THEN 'GOLD'
WHEN itemcode = '899' THEN 'PLATINUM'
ELSE 'ERROR'
END
FROM supplier
What will be the result of the query if the following data is evaluated by the CASE expression?
SUPPLIER
QUANTITY ITEMCODE 3 099 4 099 1 788 1 899 5 009 3 788 1 899
Given the following query:
SELECT quantity,
CASE WHEN itemcode = '099' THEN 'SILVER'
WHEN itemcode = '788' THEN 'GOLD'
WHEN itemcode = '899' THEN 'PLATINUM'
ELSE 'ERROR'
END
FROM supplier
What will be the result of the query if the following data is evaluated by the CASE expression?
SUPPLIER
QUANTITY ITEMCODE 3 099 4 099 1 788 1 899 5 009 3 788 1 899
正確答案: D
問題10
A user needs to create a trigger that will update table T2 whenever a row is added to table T1. Assuming the user has all appropriate privileges for table T2, which privilege is required on table T1 to create the trigger?
A user needs to create a trigger that will update table T2 whenever a row is added to table T1. Assuming the user has all appropriate privileges for table T2, which privilege is required on table T1 to create the trigger?
正確答案: A
問題11
Given the following SQL statements:
CREATE TABLE tab1 (col1 INTEGER) INSERT INTO tab1 VALUES (NULL) INSERT INTO tab1 VALUES (1) CREATE TABLE tab2 (col2 INTEGER) INSERT INTO tab2 VALUES (NULL) INSERT INTO tab2 VALUES (1) INSERT INTO tab2 VALUES (2)
What will be the result when the following statement is executed?
SELECT * FROM tab1 WHERE col1 IN (SELECT col2 FROM tab2)
Given the following SQL statements:
CREATE TABLE tab1 (col1 INTEGER) INSERT INTO tab1 VALUES (NULL) INSERT INTO tab1 VALUES (1) CREATE TABLE tab2 (col2 INTEGER) INSERT INTO tab2 VALUES (NULL) INSERT INTO tab2 VALUES (1) INSERT INTO tab2 VALUES (2)
What will be the result when the following statement is executed?
SELECT * FROM tab1 WHERE col1 IN (SELECT col2 FROM tab2)
正確答案: B
問題12
User USER1 wants to utilize an alias to remove rows from a table. Assuming USER1 has no authorities or privileges, which of the following privileges are needed?
User USER1 wants to utilize an alias to remove rows from a table. Assuming USER1 has no authorities or privileges, which of the following privileges are needed?
正確答案: D
問題13
Which of the following DB2 tools allows a user to execute an SQL statement and view a graphical representation of the access plan?
Which of the following DB2 tools allows a user to execute an SQL statement and view a graphical representation of the access plan?
正確答案: C
問題14
Given the following two tables:
TAB1 R1
A A A B B C C D E TAB2 R2
A A B B C C D Which of the following queries returns the following result set?
RETVAL
E
Given the following two tables:
TAB1 R1
A A A B B C C D E TAB2 R2
A A B B C C D Which of the following queries returns the following result set?
RETVAL
E
正確答案: D
問題15
A declared temporary table is used for which of the following purposes?
A declared temporary table is used for which of the following purposes?
正確答案: D