求正确 答案!
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
8)
Given the create statements:
CREATE DISTINCT TYPE kph AS INTEGER WITH COMPARISONS
CREATE DISTINCT TYPE mph AS INTEGER WITH COMPARISONS
CREATE TABLE speed_limits
(route_num SMALLINT,
canada_sl KPH NOT NULL,
us_sl MPH NOT NULL)
Which of the following is a valid query?
a) SELECT route_num FROM speed_limits WHERE canada_sl > 80
b) SELECT route_num FROM speed_limits WHERE canada_sl > kph
c) SELECT route_num FROM speed_limits WHERE canada_sl > us_sl
d) SELECT route_num FROM speed_limits WHERE canada_sl > kph(80)
9)
Given the two table definitions:
ORG
deptnumb INTEGER
deptname CHAR(30)
manager INTEGER
division CHAR(30)
location CHAR(30)
STAFF
id INTEGER
name CHAR(30)
dept INTEGER
job CHAR(30)
years CHAR(30)
salary DECIMAL(10,2)
comm DECIMAL(10,2)
Which of the following statements will display each department, alphabetically by name,
and the name of the manager of the department?
a) SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id
b) SELECT a.deptname, b.name FROM org a, staff b WHERE b.manager=a.id
c) SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id GROUP BY a.deptname, b.name
d) SELECT a.deptname, b.name FROM org a, staff b, WHERE b.manager=a.id GROUP BY a.deptname, b.name
10)
Given the tables:
COUNTRY
ID NAME PERSON CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
STAFF
ID LASTNAME
1 Jones
2 Smith
The statement:
INSERT INTO staff SELECT person, 'Greyson' FROM country WHERE person > 1
will insert how many rows into the STAFF table?
a) 0
b) 1
c) 2
d) 3
11)
The table STOCK has the following column definitions:
type CHAR (1)
status CHAR(1)
quantity INTEGER
price DEC (7,2)
Items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE
to zero. Which of the following statements updates the STOCK table to indicate that all
the items except for those with TYPE of "S" are temporarily out of stock?
a) UPDATE stock SET status='NULL', quantity=0, price=0 WHERE type <> 'S'
b) UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE type <> 'S'
c) UPDATE stock SET (status, quantity, price) = ('NULL', 0, 0) WHERE type <> 'S'
d) UPDATE stock SET status = NULL, SET quantity=0, SET price = 0 WHERE type <> 'S'
12)
Given the following table definition and SQL statements:
CREATE TABLE table1 (col1 INT, col2 CHAR(40), col3 INT)
GRANT INSERT, UPDATE, SELECT, REFERENCES ON TABLE table1 TO USER usera
Which of the following SQL statements will revoke privileges for user USERA on COL1 and COL2?
a) REVOKE UPDATE ON TABLE table1 FROM USER usera
b) REVOKE ALL PRIVILEGES ON TABLE table1 FROM USER usera
c) REVOKE ALL PRIVILEGES ON TABLE table1 COLUMNS (col1, col2) FROM USERA
d) REVOKE REFERENCES ON TABLE table1 COLUMNS (col1, col2) FROM USER usera
13)
Given the table:
STAFF
ID LASTNAME
1 Jones
2 Smith
When issuing the query SELECT * FROM staff, the row return order will be based on which of the following?
a) An ambiguous order
b) The primary key order
c) The order that the rows were inserted into the table
d) The values for the ID column, then the LASTNAME column
14)
Given the tables:
COUNTRY
ID NAME PERSON CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
STAFF
ID LASTNAME
1 Jones
2 Smith
Which of the following statements removes the rows from the COUNTRY table
that have PERSONS in the STAFF table?
a) DELETE FROM country WHERE id IN (SELECT id FROM staff)
b) DELETE FROM country WHERE id IN (SELECT person FROM staff)
c) DELETE FROM country WHERE person IN (SELECT id FROM staff)
d) DELETE FROM country WHERE person IN (SELECT person FROM staff)
15)
If, for a given table, the Control Center does not show the choice Generate DDL, which of the following describes the reason?
a) The table is a system object.
b) The table is a summary table.
c) The table is in LOAD PENDING.
d) The table is a replicated table.
e) The table was created by a different user.
16)
Given the successfully executed embedded SQL:
INSERT INTO staff VALUES (1, 'Colbert','Dorchester', 1)
COMMIT
INSERT INTO staff VALUES (6, 'Anders', 'Cary', 6)
INSERT INTO staff VALUES (3, 'Gaylord', 'Geneva', 8)
ROLLBACK WORK
Which of the following indicates the number of new rows that would be in the STAFF table?
a) 0
b) 1
c) 2
d) 3
17)
Given the table:
STAFF
ID LASTNAME
1 Jones
2 Smith
3 <null>
Which of the following statements removes all rows from the table where there is a NULL value for LASTNAME?
a) DELETE FROM staff WHERE lastname IS NULL
b) DELETE ALL FROM staff WHERE lastname IS NULL
c) DELETE FROM staff WHERE lastname = 'NULL'
d) DELETE ALL FROM staff WHERE lastname = 'NULL'
18)
A declared temporary table is used for which of the following purposes:
a) backup purposes
b) storing intermediate results
c) staging area for the load utility
d) sharing result sets between applications
19)
Which of the following delete rules will not allow a row to be deleted from the parent table if a row with the corresponding key value still exists in the child table?
a) DELETE
b) CASCADE
c) RESTRICT
d) SET NULL
20)
Given the statement:
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a'
WITH CHECK OPTION
Which of the following SQL statements will insert data into the table?
a) INSERT INTO v1 VALUES (a)
b) INSERT INTO v1 VALUES (b)
c) INSERT INTO v1 VALUES ('b')
d) INSERT INTO v1 VALUES ('a')
e) INSERT INTO v1 VALUES ('ab')
21)
Which of the following products can be used to store image data in a DB2 database?
a) Net.Data
b) Net Search
c) DB2 AVI Extenders
d) DB2 XML Extenders
e) DB2 Text Extenders
22)
Which of the following DDL statements creates a table where employee ids are unique?
a) CREATE TABLE t1 (employid INTEGER)
b) CREATE TABLE t1 (employid UNIQUE INTEGER)
c) CREATE TABLE t1 (employid INTEGER NOT NULL)
d) CREATE TABLE t1 (employid INTEGER NOT NULL, primary key (employid))
23)
Which of the following processing can occur for a unit of work using an isolation level of Uncommitted Read and scanning through the table more than once within the unit of work?
a) Access uncommitted changes made by other processes
b) Update uncommitted changes made by other processes
c) Update rows of a return set and have those updates changed by other processes from one scan to the next
d) Update rows of a return set and have those updates committed by other processes from one scan to the next
24)
Which of the following releases a lock by an application using the cursor stability isolation level?
a) If the cursor accessing the row is moved to the next row
b) If the cursor accessing the row is used to update the row
c) If the application's current row is deleted by the application
d) If the application's current row needs to be updated by another application
25)
An update lock gets released by an application using the repeatable read isolation level during which of the following?
a) If the cursor accessing the row is closed.
b) If the transaction issues a ROLLBACK statement.
c) If the cursor accessing the row is moved to the next row.
d) If the transaction changes are made via an UPDATE statement.
以上是 db2-512 考试的题目, 小弟对 db2 很感兴趣, 难得有一次 免费 考试的机会,但怎么 做 都 达不到 75% 希望版主能够 提供正确答案,
不胜 感激,
希望 有更多的人来学习db2