DB2 考试



自测题 1


--------------------------------------------------------------------------------

1) Which of the following products is required to be installed in order to build an
application on AIX, which will access a DB2 UDB for OS/390 database?
a) DB2 Connect Personal Edition
b) DB2 Universal Database Workgroup Edition
c) DB2 Personal Developer's Edition
d) DB2 Universal Developer's Edition OK

2)   Which of the following tools can be used to catalog a database?
a)   Journal
b)   Alert Center
c)   License Center
d)   Configuration Assistant OK

3) Which of the following utilities would you run to order data and reclaim space from
deleted rows in a table:
a) reorg OK
b) db2look
c) db2move
d) runstats

# the detail in file “reorg vs runstats.txt”

4)   The purpose of the USE privilege is to:
a)   query data in a table.
b)   load data into a table.
c)   create tables within a table space. OK
d)   create table spaces within a database.

5)   Which two of the following authorities can create a database?
a)   DBADM
b)   SYSADM
c)   DBCTRL
d) SYSCTRL
e) SYSMAINT

6) Cataloging a remote database is:
a) Performed on a PC or UNIX machine to identify the server the DB2 database manager
is on.
b) Performed on a PC or UNIX machine to identify the DB2 database to users and
applications. OK
c) Never performed in DB2, as only one database per node is allowed, so cataloging a
node automatically catalogs the database at that node.
d) Performed on a PC or UNIX machine to open the catalogs in the DB2 database and
present a user with a list of all accessible tables in that database.

7) 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)




8) 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 .

9) 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) OK


10) 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'


11) 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

12) Which of the following CANNOT have an autocommit setting?
a) Embedded SQL
b) The Command Center
c) The Command Line Processor
d) The DB2 Call Level Interface

13) Which of the following statements eliminates all but one of each set of duplicate
rows in the final result table?
a) SELECT UNIQUE * FROM t1
b) SELECT DISTINCT * FROM t1
c) SELECT * FROM DISTINCT T1
d) SELECT UNIQUE (*) FROM t1
e) SELECT DISTINCT (*) FROM t1

14) 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'

15) Given the following table definitions:
DEPARTMENT
deptno CHAR(3)
deptname CHAR(30)
mgrno INTEGER
admrdept CHAR(3)
EMPLOYEE
empno INTEGER
firstname CHAR(30)
midinit CHAR
lastname CHAR(30)
workdept CHAR(3)
Which of the following statements will list every employee's number and last
name with
the employee number and last name of their manager, including employees witho
ut a
manager?
a) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT I
NNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept =
deptno
b) SELECT e.empno, e.lastname, m.empno, m.lastname, FROM employee e LEFT
OUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept
= deptno
c) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT
OUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept
= deptno
d) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT
INNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept
= deptno

16) Given the following tables:
NAMES
Name Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13




POINTS
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189

PIM
Name PIM
Mats Sundin 14
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, numbers, p
oints and
PIM for all players with an entry in all three tables?
a) SELECT names.name, names.number, points.points, pim.pim FROM names INN
ER JOIN points ON names.name=points.name INNER JOIN pim ON pim.name=names.nam
e
b) SELECT names.name, names.number, points.points, pim.pim FROM names OUT
ER JOIN points ON names.name=points.name OUTER JOIN pim ON pim.name=names.nam
e
c) SELECT names.name, names.number, points.points, pim.pim FROM names LEF
T OUTER JOIN points ON names.name=points.name LEFT OUTER JOIN pim ON pim.name
=names.name
d) SELECT names.name, names.number, points.points, pim.pim FROM names RIG
HT OUTER JOIN points ON names.name=points.name RIGHT OUTER JOIN pim ON pim.na
me=names.name

17) Given the tables:
EMPLOYEE
emp_num emp_name dept
1 Adams 1
2 Jones 1
3 Smith 2
4 Williams 1

DEPT
dept_id dept_name
1 Planning
1 Support
and the statement:
ALTER TABLE employee
ADD FOREIGN KEY (dept) REFERENCES (dept_id)
ON DELETE CASCADE

How many units of work will be needed to process this statement:
DELETE FROM dept WHERE dept_id=1
a) 0
b) 1
c) 2
d) 3
e) 4
f) 6

1 Given the requirements to store names, employee numbers, and when the emp
loyees were hired, which of the following DB2 data types CANNOT be used to co
ntain the day the employee was hired?
a) CLOB
b) TIME
c) VARCHAR
d) TIMESTAMP

19) Given the transaction:
"CREATE TABLE t1 (id INTEGER,CONSTRAINT chkid CHECK (id<100))"
"INSERT INTO t1 VALUES (100)"
"COMMIT"
Which of the following results from the transaction?
a) The row is inserted with a NULL value
b) The row is inserted with a value of 100
c) The row insertion with a value of 100 is rejected
d) The trigger called chkid is fired to validate the data

20) If a table is defined with a check constraint for one or more columns, wh
ich of the following will perform the data validation after the table is load
ed with the load utility.
a) Reorg
b) Check
c) Runstats
d) Image Copy
e) Set Integrity

21) 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')

22) 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.

23) Which of the following isolation levels is most likely to acquire a table
level lock during an index scan?
a) Read Stability
b) Repeatable Read
c) Cursor Stability
d) Uncommitted Read

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 applic
ation

25) Which of the following processes is NOT performed by DB2 Warehouse Manage
r?
a) Query
b) Loading
c) Extraction
d) Transformation

26) Which of the following DB2 components allows reference to Oracle and DB2
databases in a single query?
a) DB2 Query Patroller
b) DB2 Warehouse Manager
c) DB2 Relational Connect
d) DB2 Connect Enterprise Edition

27) Given the table:
STAFF
ID LASTNAME
1 Jones
2 Smith
When issuing the query SELECT * FROM staff, the row return order will be base
d 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

2 How many indexes will be created by the following statement?
Create table mytab
(
Col1 int not null primary key,
Col2 char(64),
Col3 char(32),
Col4 int not null,
constraint c4 unique (Col4,Col1)
)
a) 0
b) 1
c) 2
d) 3
e) 4

29) 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

30) 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 o
n 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

31) Given, CREATE TABLE t1 (c1 CHAR(4) NOT NULL). Which of the following can
be inserted into this table?
a) 4
b) NULL
c) ‘abc’
d) ‘abcde’

32) 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

33) Which of the following delete rules will not allow a row to be deleted fr
om 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

34) Which of the following processing can occur for a unit of work using an i
solation level of Uncommitted Read and scanning through the table more than o
nce 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 proces
ses from one scan to the next
d) Update rows of a return set and have those updates committed by other proc
esses from one scan to the next
35) Which of the following database authorities is required to add a new pack
age?
a) BINDADD
b) CREATETAB
c) CREATEPKG
d) PACKAGEADD

36) 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',
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

37) 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, alphabeticall
y 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 GR
OUP BY a.deptname, b.name
d) SELECT a.deptname, b.name FROM org a, staff   b, WHERE b.manager=a.id G
ROUP BY a.deptname, b.name

3 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))

39) A client application on OS/390 must access a DB2 server on Unix, Windows
or OS/2. At a minimum, which of the following is required to be the DB2 serve
r machine?
a) DB2 Connect Enterprise Edition
b) DB2 Universal Database Enterprise Edition
c) DB2 Connect and DB2 Universal Database Workgroup Edition
d) DB2 Connect and DB2 Universal Database Enterprise Edition

40) Given the statements and operations:
"CREATE TABLE t1 (c1 CHAR(1))"
Six rows are inserted with values of: a, b, c, d, e and f
"SET CONSTRAINTS FOR t1 OFF"
"ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')"
"SET CONSTRAINTS FOR t1 IMMEDIATE CHECKED FOR EXCEPTION IN t1 USE t1exp"

Which of the following describes what happens to the rows with values of b, c
, d, e and f?
a) deleted from T1 only
b) deleted from T1 and written into the t1exp file
c) deleted from T1 and inserted into the table t1exp
d) deleted from T1 and written into the db2diag.log file
e) deleted from T1 and inserted into the table syscat.checks

41) Given the requirement of providing a read-only database, applications acc
essing the database should be run with which of the following isolation level
s to allow for the most read concurrency?
a) Read stability
b) Repeatable read
c) Cursor stability
d) Uncommitted read
******************************************************



自测题 2


--------------------------------------------------------------------------------

(1/55) Which of the following products must be installed to provide a single
point of control for
local and remote DB2 databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Administration Client
C. DB2 Connect Enterprise Edition
D. DB2 Enterprise-Extended Edition

(2/55) Which of the following tools maintains a history of all executed state
ments/commands for the current session within the tool?
(Select the correct response)
A. Journal
B. SQL Assist
C. DB2 Alert Center
D. DB2 Command Center

(3/55) Which of the following DB2 CLP options specify the file that contains
the statements to be executed?
(Select the correct response)
A. -f
B. -b
C. -o
D. -w

(4/55) Which of the following will rebuild a package in the database from the
existing catalog
information?
(Select the correct response)
A.   bind
B.   rebind
C.   update
D.   rebuild

(5/55) Which two of the following types of storage management method is suppo
rted by DB2
OLAP Server ?
(Select all that apply)
A. Object
B. Network
C. Relational
D. Hierarchical
E. Multi-dimensional

(6/55) Which of the following DB2 components can limit the resource consumpti
on of queries?
(Select the correct response)
A. DB2 Connect
B. DB2 Query Patroller
C. DB2 Performance Monitor
D. DB2 Net Search Extender

(7/55)How many DB2 Administration Server (DAS) Instances can be set up per ph
ysical machine? (Select the correct response)
A. 0
B. 1
C. One for each instance on the physical machine
D. One for each database on the physical machine

(8/55) Which of the following must be set up to allow the Control Center to v
iew database objects? (Select the correct response)
A. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant

(9/55) Which of the following privileges is necessary to populate the table w
ith large amounts of
data?
(Select the correct response)
A. LOAD
B. ALTER
C. UPDATE
D. IMPORT

(10/55) A table called EMPLOYEE has columns: name, department, and phone_numb
er. Which
of the following can limit access to the phone_number column?
(Select the correct response)
A. Using a view to access the table
B. Using an index on the column
C. Using a referential constraint on the table
D. Using a table check constraint on the table
E. Revoking access from the phone_number column

(11/55) Which of the following is the best way to restrict user access to a s
ubset of columns in a
table?
(Select the correct response)
A. Only grant access to the columns within a table that a user is allowe
d to see.
B. Create a view that only includes the columns a user is allowed to see
. Grant the user access
to the view, not the base table.
C. Create two tables: one with the columns that a user is allowed to see
, and one that has the
confidential columns, and use a join when all data must be presented.
D. Create two tables: one with the columns that a user is allowed to see
, and one that has the
confidential columns, and use a union when all data must be presented.

(12/55) Which of the following is the most appropriate reason to consider rev
oking the SELECT
privilege on the catalog tables from PUBLIC after creating a database?
(Select the correct response)
A. To prevent users from creating tables without proper authority.
B. Some system catalogs record user data in some columns, and this data
may be confidential.
C. To prevent users from viewing passwords for other DB2 userids that DB
2 stores in the
catalog tables.
D. Some catalog tables are large, so preventing users from viewing them
is a good way to keep users from submitting long-running queries against the
catalogs.

(13/55) When manually establishing communications from a Windows NT client th
rough a DB2
Connect gateway to DB2 UDB for OS/390, which of the following is NOT required
to catalog?
(Select the correct response)
A. The client.
B. The database on the DRDA server.
C. The Database Connection Service database.
D. The node where the DB2 Connect Gateway is.

(14/55) Which of the following can be used to determine the views that are af
fected by a DROP
TABLE statement?
(Select the correct response)
A. DB2 Script Center
B. DB2 Performance Monitor
C. DB2 Control Center, Show Related
D. DB2 Control Center, Sample Contents

(15/55) Using the Control Center Create Table dialog box, which of the follow
ing dialogs allows
the table creation DDL to be viewed?
(Select the correct response)
A. Copy
B. Show SQL
C. Show Related
D. Sample Contents

(16/55) Given the table definition:
CREATE TABLE student (name CHAR(30), age INTEGER)
To list the names of the 10 youngest students, which of the following index d
efinition statements
on the student table may improve the query performance?
(Select the correct response)
A. CREATE INDEX youngest ON student (age, name)
B. CREATE INDEX youngest ON student (name, age)
C. CREATE INDEX youngest ON student (name, age DESC)
D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age)

(17/55) Which one of the following SQL statements sets the default qualifier
to "user1"?
(Select the correct response)
A. SET CURRENT ID = 'user1'
B. SET CURRENT USER = 'user1'
C. SET CURRENT SQLID = 'user1'
D. SET CURRENT QUALIFIER = 'user1'

(18/55) Which of the following is the implicit qualifier for a declared tempo
rary table?
(Select the correct response)
A. The schema name SYSCAT.
B. The schema name SESSION.
C. The schema name TEMPUSER.
D. The userid specified with the BIND command.
E. The userid who established the connection to the database and declare
d the temporary table.

(19/55) Given the following transaction:
CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
INSERT INTO dwaine.mytab VALUES (1,2)
INSERT INTO dwaine.mytab VALUES (4,3)
ROLLBACK
Which of the following would be returned from the statement:
SELECT * FROM dwaine.mytab?
(Select the correct response)
A. COL1 COL2
----------- -----------
0 record(s)selected.
B. COL1 COL2
----------- -----------
1 2
1 record(s) selected.
C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.
D. COL1 COL2
----------- -----------
1 2
4 3
2 record(s) selected.

(20/55) Which of the following does NOT end a unit of work?
(Select the correct response)
A. COMMIT
B. ROLLBACK
C. TERMINATE
D. SAVEPOINT
E. CONNECT RESET

(21/55) Which of the following is the result of the following SQL statement:
CREATE UNIQUE INDEX empno_ind ON employee (empno)
(Select the correct response)
A. Every value for EMPNO must be unique.
B. UPDATE statements on EMPNO will be rolled back.
C. Insert statements on EMPNO will always be faster.
D. Insert statements on the EMPNO table will result in clustered data.

(22/55) Given the following DDL statements,
CREATE TABLE t1 (a INT, b INT, c INT)
CREATE VIEW v1 AS SELECT a, b, c FROM t1
WHERE a > 250
WITH CHECK OPTION
Which of the following INSERT statements will fail?
(Select the correct response)
A. INSERT INTO t1 VALUES (200, 2, 3)
B. INSERT INTO v1 VALUES (200, 2, 3)
C. INSERT INTO t1 VALUES (300, 2, 3)
D. INSERT INTO v1 VALUES (300, 2, 3)

(23/55) Which of the following statements will create an index and prevent ta
ble T1 from
containing two or more rows with the same values for column C1?
(Select the correct response)
A. CREATE UNIQUE INDEX ix4 ON t1 (c1)
B. CREATE DISTINCT INDEX ix1 ON t1 (c1)
C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)
D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)

(24/55) Given the table T1, created by:
CREATE TABLE t1
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
c1 CHAR(3)
)
The following SQL statements are issued:
INSERT INTO t1 VALUES (1, 'ABC')
INSERT INTO t1 VALUES (5, 'DEF')
Which of the following values are inserted into the ID column by the followin
g statement?
INSERT INTO t1(c1) VALUES ('XYZ')
(Select the correct response)
A. 0
B. 1
C. 2
D. 5
E. 6

(25/55) Given the following:TAB1 TAB2
C1 C2 CX CY
--- --- --- ---
A 11 A 21
B 12 C 22
C 13 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 joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER 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

(26/55) Given the following UPDATE statement:
UPDATE address2 SET housenumber_buildingname=(SELECT buildingname FROM addres
s1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which of the following describes the result of the statement?
(Select the correct response)
A. The statement will succeed.
B. The statement will fail because a subquery cannot exist in an UPDATE
statement.
C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are de
fined as
primary keys.
D. The statement will succeed if the data retrieved from the subquery do
es not have duplicate
values for ADDRESS1.ID.

(27/55) Which of the following   is possible once a user has been given mainten
ance authority?
(Select the correct response)
A. DB2 userids can be created.
B. Views can be created on the   catalogs.
C. Statistics can be collected   for database objects.
D. A table can be populated by   using the LOAD command.


(28/55) Given table   T1 with 100 rows, which of the following queries will ret
rieve 10 rows from
table T1?
(Select the correct   response)
A. SELECT * FROM t1   MAXIMUM 10 ROWS
B. SELECT * FROM t1   READ 10 ROWS ONLY
C. SELECT * FROM t1   OPTIMIZE FOR 10 ROWS
D. SELECT * FROM t1   FETCH FIRST 10 ROWS ONLY

(29/55) Given the two following tables:
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189

PIM
Name PIM
Mats Sundin 14
Jaromir Jagr 18
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, points and
PIM for all players?
(Select the correct response)
A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNE
R JOIN pim
ON points.name=pim.name
B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL
OUTER
JOIN pim ON points.name=pim.name
C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT
OUTER
JOIN pim ON points.name=pim.name
D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGH
T OUTER
JOIN pim ON points.name=pim.name

(30/55) Given the following table definitions:
DEPARTMENT
deptno CHAR(3)
deptname CHAR(30)
mgrno INTEGER
admrdept CHAR(3)

EMPLOYEE
empno INTEGER
firstname CHAR(30)
midinit CHAR
lastname CHAR(30)
workdept CHAR(3)

Which of the following statements will list the employee's employee number, l
ast name, and
department name ONLY for those employees who have a department?
(Select the correct response)
A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d
WHERE
e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOI
N
department d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOI
N
department d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JO
IN
department d WHERE e.workdept = d.deptno

(31/55) Given the table:
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

Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?

(Select the   correct response)
A. ORDER BY   2,1
B. GROUP BY   2, 1
C. ORDER BY   cities, name
D. GROUP BY   cities, name

(32/55) Given the following table definition:
STAFF
id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary DECIMAL(10,2)
comm DECIMAL(10,2)

Which of the following statements will return all of the records ordered by j
ob
with the salaries in descending order?
(Select the correct response)
A. SELECT * FROM staff ORDER BY salary DESC, job
B. SELECT * FROM staff GROUP BY salary DESC, job
C. SELECT * FROM staff ORDER BY job, salary DESC
D. SELECT * FROM staff GROUP BY job, salary DESC

(33/55) Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with

columns ID and TITLE, what is the effect of the statement:
UPDATE employee SET salary = salary * 1.15
WHERE salary < 15000 OR
EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr'
)
(Select the correct response)
A. Only managers that make less than 15,000 are given salary increases.
B. Only non-managers that make less than 15,000 are given salaray increa
ses.
C. Employees that make less than 15,000 but no managers are given salary
increases.
D. Employees that make less than 15,000 and all managers are given salar
y increases.

(34/55) Given the table definition:
DEFIN1:
id SMALLINT NOT NULL
name VARCHAR(30)
hired DATE

DEFIN2:
deptid SMALLINT NOT NULL
name VARCHAR(30)
started DATE

Which of the following statements will insert successfully into table DEFIN1?
(Select the correct response)
A. INSERT INTO defin1 (id) VALUES (1)
B. INSERT INTO defin1 (name) VALUES ('Florence')
C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE
FROM defin2
D. INSERT INTO defin1 (name, hired) SELECT DISTINCT 'Florence', CURRENT
DATE FROM defin2

(35/55) With tables defined as:
Table1
col1 INT
col2 CHAR(30)

Table2
col1 INT
col2 CHAR(30)

Which of the following statements will insert all the rows in TABLE2 into TAB
LE1?
(Select the correct response)
A. INSERT INTO table1 SELECT col1, col2 FROM table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. INSERT INTO table1 VALUES (table2.col1, table2.col2)
D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)
E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)

(36/55) Which of the following is the result of a successful ROLLBACK stateme
nt?
(Select the correct response)
A. Held locks are released
B. Release-pending conditions are undone
C. Tables in LOAD PENDING are released
D. Constraint checking conditions are undone
E. Existing database connections are released
(37/55) Given the following embedded SQL programs:
Program 1:
CREATE TABLE mytab (col1 INT, col2 CHAR(24))
COMMIT
Program 2:
INSERT INTO mytab VALUES ( 20989,'Joe Smith')
INSERT INTO mytab VALUES ( 21334,'Amy Johnson')
COMMIT
DELETE FROM mytab
ROLLBACK
INSERT INTO mytab VALUES ( 23430,'Jason French')
ROLLBACK
INSERT INTO mytab VALUES ( 20993,'Samantha Jones')
COMMIT
DELETE FROM mytab WHERE col1=20993
ROLLBACK
Which of the following indicates the number of records that will be returned
by the statement:
SELECT * FROM mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
E. 4

(38/55) Given an embedded SQL program with a single connection, two threads a
nd the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(39/55) Given two embedded SQL programs and the following actions:
Pgm1 Pgm2
INSERT INTO mytab VALUES (...) DELETE FROM mytab
COMMIT ROLLBACK
DELETE FROM mytab INSERT INTO mytab VALUES (...)
ROLLBACK COMMIT
If there exists one (1) row in table mytab before the programs are executed c
oncurrently,
how many records will be in the table once the programs complete?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
E. 4

(40/55) A user has a numeric data column with a maximum value of 100,000. Whi
ch of the
following data types will use the minimum amount of storage for the column?
(Select the correct response)
A. IDENTITY
B. BIGINT
C. INTEGER
D. SMALLINT

(41/55) Which of the following DB2 data types is used to store 50 MB of binar
y data as a single
value?
(Select the correct response)
A. BLOB
B. CLOB
C. DBCLOB
D. FOR BIT DATA
E. VARCHAR FOR BIT DATA

(42/55) Given the following column requirements:
Col1 Numeric Identifier - From 1 to 1000000
Col2 Job Code - Variable, 1 to 2 characters long
Col3 Job Description - Variable, 1 to 100 characters long
Col4 Job Length - Length of Job in seconds
Which of the following will minimize the disk space allocated to store the re
cords if Job
Description has an average length of 45?
(Select the correct response)
A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT)
B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 IN
T)
C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 IN
T)
D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4
INT)

(43/55) Which of the following DELETE RULES on CREATE TABLE will delete a dep
endent
table row if the parent table row is deleted?
(Select the correct response)
A. ON DELETE REMOVE
B. ON DELETE CASCADE
C. ON DELETE RESTRICT
D. ON DELETE SET NULL
E. ON DELETE PROPAGATE

(44/55) Given the following table structure:
table1
emp_num INT NOT NULL PRIMARY KEY
emp_fname CHAR(30) NOT NULL
emp_lname CHAR(30) NOT NULL
emp_addr CHAR(60) NOT NULL
emp_pin CHAR(10) NOT NULL
Which of the following columns can be referenced by a foreign key clause from
another table?
(Select the correct response)
A. emp_num
B. emp_pin
C. emp_addr
D. emp_fname
E. emp_lname

(45/55) Why is a unique index not sufficient for creation of a primary key?
(Select the correct response)
A. It is sufficient - a primary key is the same thing as a unique index.

B. Unique indexes can be defined in ascending or descending order. Prima
ry keys must be
ascending.
C. A unique index can be defined over a column or columns that allow nul
ls. Primary keys cannot contain nulls.
D. A unique index can be defined over a column or columns that allow nul
ls. This is not
allowed for primary keys because foreign keys cannot contain nulls.

(46/55) Given the statement:
CREATE TABLE t1 (c1 CHAR(1))
Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol
lowing command
is issued:
ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')
Which of the following occurs?
(Select the correct response)
A. Rows with c1 values of b,c,d,e,f are deleted
B. Rows with c1 values of b,c,d,e,f have c1 set to NULL
C. The ALTER command will fail as rows violate the constraint
D. The ALTER command will move the violating rows to the exception table
(47/55) With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(48/55) A view is used instead of a table for users to do which of the follow
ing?
(Select the correct response)
A. Avoid allocating more disk space per database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
D. Avoid allocating frequently used query result tables

(49/55) Which of the following products can be used to perform a dictionary-b
ased search?
(Select the correct response)
A. Net.Data
B. XML Extender
C. AVI Extender
D. Text Extender

(50/55) Which two of the following modes can be used on the lock table statem
ent?
(Select all that apply)
A. SHARE MODE
B. EXCLUSIVE MODE
C. REPEATABLE READ MODE
D. UNCOMMITTED READ MODE
E. INTENT EXCLUSIVE MODE

(51/55) For which of the following can locks be obtained?
(Select the correct response)
A. A trigger
B. A table view
C. A table column
D. A database buffer
E. A row referenced by an index key

(52/55) Given the following table with a primary key on empid:
Emp:
Empid Name
11 Joe Smith
23 Melanie Jones
30 Robert Bruce
49 Janice Baker
66 Mario Diaz
68 Maria Diaton

Give the following statement in an embedded SQL program bound with Repeatable
Read:
Select * from Emp where empid < 55
How many rows in the table will be locked after the statement is run?
(Select the correct response)
A. 0
B. 1
C. 4
D. 5
E. 6


(53/55) Which of the following isolation levels will lock only the rows retur
ned in the result set?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Cursor Stability
D. Uncommitted Read

(54/55) Which of the following processing can occur for a unit of work using
an isolation level of Cursor Stability and allows scanning through the table
more than once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Have updated result set rows changed by other processes from one scan
to the next
D. Have accessed result set rows changed by other processes from one sca
n to the next

(55/55) Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether
or not it is assigned. An airline agent lists all the unassigned seats on the
plane. When the agent
refreshes the list from the table, it should only change if another agent una
ssigns a currently
assigned seat.

Which of the following isolation levels should be used for this application?
(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

*************************************************



自测题 3


--------------------------------------------------------------------------------

(1/55) Given two embedded SQL programs and the following actions:
Pgm1 Pgm2
INSERT INTO mytab VALUES DELETE FROM mytab
(...)
COMMIT ROLLBACK
DELETE FROM mytab (...)
ROLLBACK COMMIT
If there exists one (1) row in table mytab before the programs are executed c
oncurrently, how many records will be in the table once the programs complete
?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
E. 4

(2/55)Which of the following DB2 CLP options specify the file that contains
the statements to be executed?
(Select the correct response)
A. –F
B. –B
C. –O
D. –W

(3/55)A view is used instead of a table for users to do which of the follow
ing?
(Select the correct response)
A. Avoid allocating more disk space per database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
D. Avoid allocating frequently used query result tables

(4/55) Given the table definition:
CREATE TABLE student (name CHAR(30), age INTEGER)
To list the names of the 10 youngest students, which of the following index d
efinition statements on the student table may improve the query performance?

(Select the correct response)
A. CREATE INDEX youngest ON student   (age, name)
B. CREATE INDEX youngest ON student   (name, age)
C. CREATE INDEX youngest ON student   (name, age DESC)
D. CREATE INDEX youngest ON student   (name DESC) INCLUDE (age)

(5/55) Given the following UPDATE statement:
UPDATE address2 SET housenumber_buildingname=
(SELECT buildingname FROM address1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which of the following describes the result of the statement?
(Select the correct response)
A. The statement will succeed.
B. The statement will fail because a subquery cannot exist in an UPDATE state
ment.
C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined
as primary keys.
D. The statement will succeed if the data retrieved from the subquery does no
t have duplicate values for ADDRESS1.ID.

(6/55) Given the following column requirements:
Col1 Numeric Identifier - From 1 to 1000000
Col2 Job Code - Variable, 1 to 2 characters long
Col3 Job Description - Variable, 1 to 100 characters long
Col4 Job Length - Length of Job in seconds
Which of the following will minimize the disk space allocated to store the re
cords if Job Description has an average length of 45?
(Select the correct response)
A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT)
B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT)
C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT)
D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT)

(7/55) Which of the following will rebuild a package in the database from t
he existing catalog information?
(Select the correct response)
A. bind
B. rebind
C. update
D. rebuild
(8/55)With tables defined as:
Table1
col1 INT
col2 CHAR(30)

Table2
col1 INT
col2 CHAR(30)
Which of the following statements will insert all the rows in TABLE2 into TAB
LE1?
(Select the correct response)
A. INSERT INTO table1 SELECT col1, col2 FROM table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. INSERT INTO table1 VALUES (table2.col1, table2.col2)
D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)
E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)

(9/55) Given an embedded SQL program with a single connection, two threads
and the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(10/55)Which of the following can be used to determine the views that are a
ffected by a DROP TABLE statement?
(Select the correct response)
A. DB2 Script Center
B. DB2 Performance Monitor
C. DB2 Control Center, Show Related
D. DB2 Control Center, Sample Contents

(11/55) Which of the following is the implicit qualifier for a declared tem
porary table?
(Select the correct response)
A. The schema name SYSCAT.
B. The schema name SESSION.
C. The schema name TEMPUSER.
D. The userid specified with the BIND command.
E. The userid who established the connection to the database and declared the
temporary table.
(12/55) Given table EMPLOYEE with columns EMPNO and SALARY and table JOB wi
th columns ID and TITLE, what is the effect of the statement:
UPDATE employee SET salary = salary * 1.15
WHERE salary < 15000 OR
EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr'
)
(Select the correct response)
A. Only managers that make less than 15,000 are given salary increases.
B. Only non-managers that make less than 15,000 are given salaray increases.
C. Employees that make less than 15,000 but no managers are given salary incr
eases.
D. Employees that make less than 15,000 and all managers are given salary inc
reases.

(13/55) Given the following table structure:
table1
emp_num INT NOT NULL PRIMARY KEY
emp_fname CHAR(30) NOT NULL
emp_lname CHAR(30) NOT NULL
emp_addr CHAR(60) NOT NULL
emp_pin CHAR(10) NOT NULL
Which of the following columns can be referenced by a foreign key clause from
another table?
(Select the correct response)
A. emp_num
B. emp_pin
C. emp_addr
D. emp_fname
E. emp_lname

(14/55)Which of the following DELETE RULES on CREATE TABLE will delete a de
pendent table row if the parent table row is deleted?
(Select the correct response)
A. ON DELETE REMOVE
B. ON DELETE CASCADE
C. ON DELETE RESTRICT
D. ON DELETE SET NULL
E. ON DELETE PROPAGATE

(15/55) Why is a unique index not sufficient for creation of a primary key?

(Select the correct response)
A. It is sufficient - a primary key is the same thing as a unique index.
B. Unique indexes can be defined in ascending or descending order. Primary ke
ys must be ascending.
C. A unique index can be defined over a column or columns that allow nulls. P
rimary keys cannot contain nulls.
D. A unique index can be defined over a column or columns that allow nulls. T
his is not allowed for primary keys because foreign keys cannot contain nulls
.

(16/55) When manually establishing communications from a Windows NT client
through a DB2 Connect gateway to DB2 UDB for OS/390, which of the following i
s NOT required to catalog?
(Select the correct response)
A. The client.
B. The database on the DRDA server.
C. The Database Connection Service database.
D. The node where the DB2 Connect Gateway is.

(17/55)Which two of the following types of storage management method is sup
ported by DB2 OLAP Server ?
(Select all that apply)
A. Object
B. Network
C. Relational
D. Hierachical
E. Multi-dimensional

(18/55) Which of the following is the result of a successful ROLLBACK state
ment?
(Select the correct response)
A. Held locks are released
B. Release-pending conditions are undone
C. Tables in LOAD PENDING are released
D. Constraint checking conditions are undone
E. Existing database connections are released

(19/55) Which of the following isolation levels will lock only the rows ret
urned in the result set?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Cursor Stability
D. Uncommitted Read

(20/55)A user has a numeric data column with a maximum value of 100,000. Wh
ich of the following data types will use the minimum amount of storage for th
e column?
(Select the correct response)
A. IDENTITY
B. BIGINT
C. INTEGER
D. SMALLINT

(21/55) Which of the following is the most appropriate reason to consider r
evoking the SELECT privilege on the catalog tables from PUBLIC after creating
a database?
(Select the correct response)
A. To prevent users from creating tables without proper authority.
B. Some system catalogs record user data in some columns, and this data may b
e confidential.
C. To prevent users from viewing passwords for other DB2 userids that DB2 sto
res in the catalog tables.
D. Some catalog tables are large, so preventing users from viewing them is a
good way to keep users from submitting long-running queries against the catal
ogs.

(22/55) Given the table definition:
DEFIN1
Id SMALLINT NOT NULL
Name VARCHAR(30)
Hired DATE
DEFIN2:
Deptid SMALLINT NOT NULL
Name VARCHAR(30)
Started DATE
Which of the following statements will insert successfully into table DEFIN1?

(Select the correct response)
A. INSERT INTO defin1 (id) VALUES (1)
B. INSERT INTO defin1 (name) VALUES ('Florence')
C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE FROM def
in2
D. INSERT INTO defin1 (name, hired) SELECT DISTINCT 'Florence', CURRENT DATE
FROM defin2

(23/55) Which of the following statements will create an index and prevent
table T1 from containing two or more rows with the same values for column C1?

(Select the correct response)
A. CREATE UNIQUE INDEX ix4 ON t1 (c1)
B. CREATE DISTINCT INDEX ix1 ON t1 (c1)
C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)
D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)

(24/55) A table called EMPLOYEE has columns: name, department, and phone_nu
mber. Which of the following can limit access to the phone_number column?
(Select the correct response)
A. Using a view to access the table
B. Using an index on the column
C. Using a referential constraint on the table
D. Using a table check constraint on the table
E. Revoking access from the phone_number column

(25/55) Which of the following is the result of the following SQL statement
:
CREATE UNIQUE INDEX empno_ind ON employee (empno)
(Select the correct response)
A. Every value for EMPNO must be unique.
B. UPDATE statements on EMPNO will be rolled back.
C. Insert statements on EMPNO will always be faster.
D. Insert statements on the EMPNO table will result in clustered data.

(26/55)Which of the following DB2 components can limit the resource consump
tion of queries?
(Select the correct response)
A. DB2 Connect
B. DB2 Query Patroller
C. DB2 Performance Monitor
D. DB2 Net Search Extender

(27/55) Given the following table with a primary key on empid:
Emp:
Empid Name
11 Joe Smith
23 Melanie Jones
30 Robert Bruce
49 Janice Baker
66 Mario Diaz
68 Maria Diaton
Give the following statement in an embedded SQL program bound with Repeatable
Read:
Select * from Emp where empid < 55
How many rows in the table will be locked after the statement is run?
(Select the correct response)
A. 0
B. 1
C. 4
D. 5
E. 6

(28/55)Which of the following products can be used to perform a dictionary-
based search?
(Select the correct response)
A. Net.Data
B. XML Extender
C. AVI Extender
D. Text Extender

(29/55)Which two of the following modes can be used on the lock table state
ment?
(Select all that apply)
A. SHARE MODE
B. EXCLUSIVE MODE
C. REPEATABLE READ MODE
D. UNCOMMITTED READ MODE
E. INTENT EXCLUSIVE MODE

(30/55)Which of the following does NOT end a unit of work?
(Select the correct response)
A. COMMIT
B. ROLLBACK
C. TERMINATE
D. SAVEPOINT
E. CONNECT RESET

(31/55) Which of the following must be set up to allow the Control Center t
o view database objects?
(Select the correct response)
A. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant

(32/55)Which of the following is the best way to restrict user access to a
subset of columns in a table?
(Select the correct response)
A. Only grant access to the columns within a table that a user is allowed to
see.
B. Create a view that only includes the columns a user is allowed to see. Gra
nt the user access to the view, not the base table.
C. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a join when all data must be
presented.
D. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a union when all data must be
presented.

(33/55)How many DB2 Administration Server (DAS) Instances can be set up per
physical machine?
(Select the correct response)
A. 0
B. 1
C. One for each instance on the physical machine
D. One for each database on the physical machine

(34/55) Given the table T1, created by:
CREATE TABLE t1
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
c1 CHAR(3)
)
The following SQL statements are issued:
INSERT INTO t1 VALUES (1, 'ABC')
INSERT INTO t1 VALUES (5, 'DEF')
Which of the following values are inserted into the ID column by the followin
g statement?
INSERT INTO t1(c1) VALUES ('XYZ')
(Select the correct response)
A. 0
B. 1
C. 2
D. 5
E. 6

(35/55)Given the following transaction:
CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
INSERT INTO dwaine.mytab VALUES (1,2)
INSERT INTO dwaine.mytab VALUES (4,3)
ROLLBACK
Which of the following would be returned from the statement:
SELECT * FROM dwaine.mytab?

(Select the correct response)
A. COL1 COL2
--------------- --------------
0 record(s)selected.
B. COL1 COL2
--------- --------
1 2
1 record(s) selected.
C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.
D. COL1 COL2
-------- -------
1 2
4 3
2 record(s) selected.

(36/55)Given the following:
TAB1 TAB2
C1 C2 CX CY
------ ------ ----- -----
A 11 A 21
B 12 B 22
C 13 C 23
The following results are desired:
C1 C2 CX CY
----- ----- ----- ------
A 11 A 21
C 13 C 22
--- ---- D 23
Which of the following joins will yield the desired results?
(Select the   correct response)
A. SELECT *   FROM tab1, tab2 WHERE c1=cx
B. SELECT *   FROM tab1 INNER 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

(37/55) Given the following embedded SQL programs:
Program 1:
CREATE TABLE mytab (col1 INT, col2 CHAR(24))
COMMIT
Program 2:
INSERT INTO mytab VALUES ( 20989,'Joe Smith')
INSERT INTO mytab VALUES ( 21334,'Amy Johnson')
COMMIT
DELETE FROM mytab
ROLLBACK
INSERT INTO mytab VALUES ( 23430,'Jason French')
ROLLBACK
INSERT INTO mytab VALUES ( 20993,'Samantha Jones')
COMMIT
DELETE FROM mytab WHERE col1=20993
ROLLBACK
Which of the following indicates the number of records that will be returned
by the statement:
SELECT * FROM mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
E. 4

(38/55)Given the statement:
CREATE TABLE t1 (c1 CHAR(1))
Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol
lowing command is issued:
ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')
Which of the following occurs?
(Select the correct response)
A. Rows with c1 values of b,c,d,e,f are deleted
B. Rows with c1 values of b,c,d,e,f have c1 set to NULL
C. The ALTER command will fail as rows violate the constraint
D. The ALTER command will move the violating rows to the exception table

(39/55)Given the two following tables:
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby   Orr 129
Bobby   Hull 93
Brett   Hull 121
Mario   Lemieux 189

PIM
Name PIM
Mats Sundin 14
Jaromir Jagr 18
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, points and
PIM for all players?
(Select the correct response)
A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI
N pim ON points.name=pim.name
B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE
R JOIN pim ON points.name=pim.name
C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTE
R JOIN pim ON points.name=pim.name
D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT
ER JOIN pim ON points.name=pim.name

(40/55) Which of the following products must be installed to provide a sing
le point of control for local and remote DB2 databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Administration Client
C. DB2 Connect Enterprise Edition
D. DB2 Enterprise-Extended Edition

(41/55)Which of the following tools maintains a history of all executed sta
tements/commands for the current session within the tool?
(Select the correct response)
A. Journal
B. SQL Assist
C. DB2 Alert Center
D. DB2 Command Center

(42/55) Using the Control Center Create Table dialog box, which of the foll
owing dialogs allows the table creation DDL to be viewed?
(Select the correct response)
A. Copy
B. Show SQL
C. Show Related
D. Sample Contents
(43/55)Which of the following processing can occur for a unit of work using
an isolation level of Cursor Stability and allows scanning through the table
more than once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Have updated result set rows changed by other processes from one scan to t
he next
D. Have accessed result set rows changed by other processes from one scan to
the next

(44/55)Given the table:
COUNTRY
ID NAME PERSON CITY
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?

(Select the   correct response)
A. ORDER BY   2,1
B. GROUP BY   2, 1
C. ORDER BY   cities, name
D. GROUP BY   cities, name

(45/55) Which of the following DB2 data types is used to store 50 MB of bin
ary data as a single value?
(Select the correct response)
A. BLOB
B. CLOB
C. DBCLOB
D. FOR BIT DATA
E. VARCHAR FOR BIT DATA

(46/55)Which one of the following SQL statements sets the default qualifier
to "user1"?
(Select the correct response)
A. SET CURRENT ID = 'user1'
B. SET CURRENT USER = 'user1'
C. SET CURRENT SQLID = 'user1'
D. SET CURRENT QUALIFIER = 'user1'

(47/55)Which of the following privileges is necessary to populate the table
with large amounts of data?
(Select the correct response)
A. LOAD
B. ALTER
C. UPDATE
D. IMPORT

(48/55)For which of the following can locks be obtained?
(Select the correct response)
A. A trigger
B. A table view
C. A table column
D. A database buffer
E. A row referenced by an index key

(49/55)Which of the following is possible once a user has been given mainte
nance authority?
(Select the correct response)
A. DB2 userids can be created.
B. Views can be created on the catalogs.
C. Statistics can be collected for database objects.
D. A table can be populated by using the LOAD command.

(50/55)With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(51/55) Given the following DDL statements,
CREATE TABLE t1 (a INT, b INT, c INT)
CREATE VIEW v1 AS SELECT a, b, c FROM t1
WHERE a > 250
WITH CHECK OPTION
Which of the following INSERT statements will fail?
(Select the correct response)
A. INSERT INTO t1 VALUES (200, 2, 3)
B. INSERT INTO v1 VALUES (200, 2, 3)
C. INSERT INTO t1 VALUES (300, 2, 3)
D. INSERT INTO v1 VALUES (300, 2, 3)

(52/55)Given table T1 with 100 rows, which of the following queries will re
trieve 10 rows from table T1?
(Select the   correct   response)
A. SELECT *   FROM t1   MAXIMUM 10 ROWS
B. SELECT *   FROM t1   READ 10 ROWS ONLY
C. SELECT *   FROM t1   OPTIMIZE FOR 10 ROWS
D. SELECT *   FROM t1   FETCH FIRST 10 ROWS ONLY

(53/55)Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, it should only change if another agent unassigns a currently assigned sea
t.

Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

(54/55)With tables defined as:
Table1
col1 INT
col2 CHAR(30)

Table2
col1 INT
col2 CHAR(30)
Which of the following statements will insert all the rows in TABLE2 into TAB
LE1?
(Select the correct response)
A. INSERT INTO table1 SELECT col1, col2 FROM table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. INSERT INTO table1 VALUES (table2.col1, table2.col2)
D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)
E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)

(55/55)Given the following table definitions:
DEPARTMENT
Deptno CHAR(30)
Deptname CHAR(30)
Mgrno INTEGER
Admrdept CHAR(3)

EMPLOYEE
Empno INTEGER
Firstname CHAR(30)
Midinit CHAR
Lastname CHAR(30)
Workdept CHAR(3)

Which of the following statements will list the employee's employee number, l
ast name, and department name ONLY for those employees who have a department?

(Select the correct response)
A. SELECT e.empno, e.lastname, d.deptname   FROM employee e, department d WHERE
e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname   FROM employee e LEFT OUTER JOIN dep
artment d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname   FROM employee e FULL OUTER JOIN dep
artment d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname   FROM employee e RIGHT OUTER JOIN de
partment d WHERE e.workdept = d.deptno

**********************************************************



自测题 4


--------------------------------------------------------------------------------

(1/55). Which of the following tasks can be performed using the ALTER TABLES
PACE statement?
(Select the correct response)
A. Assign a bufferpool.
B. Change the table space name.
C. Change the type of the table space.
D. Change the page size of the table space.

(2/55). 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. Smiths
The statement:
SELECT * FROM staff,country
will return how many rows?
(Select the correct response)
A.2
B.4
C.5
D.7
E.10

(3/55). Which of the following products can be used to generate Extensible Ma
rkup Language documents from DB2 tables?
(Select the correct response)
A. Net Search
B. XML Extender
C. AVI Extender
D. TXT Extender

(4/55). Which of the following SQL statements can remove all rows from a tabl
e named COUNTRY?
(Select the correct response)
A.DELETE country
B.DELETE FROM country
C.DELETE * FROM country
D.DELETE ALL FROM country


(5/55). Which of the following tools can be used to identify inefficient SQL
statements without executing the query?
(Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. Performance Monitor




(6/55) Given the statement:
CREATE TABLE t1
(
c1 INTEGER NOT NULL,
c2 INTEGER,
PRIMARY KEY(c1),
FOREIGN KEY(c2) REFERENCES t2
)
How many non-unique indexes are defined for table t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
(7/55) Given two embedded SQL program executions with the following actions:

Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK

Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)

A. 1
B. 2
C. 3
D. 4
(8/55) Given the following DDL statement:
CREATE TABLE newtab1 LIKE tab1
Which of the following would occur as a result of the statement execution?
(Select the correct response)
A NEWTAB1 has same triggers as TAB1
B NEWTAB1 is populated with TAB1 data
C NEWTAB1 has the same primary key as TAB1
D NEWTAB1 columns have same attributes as TAB1

(9/55) Which of the following describes when indexes can be explicitly refer
enced by name within an SQL statement?
(Select the correct response)
A. When dropping the index
B. When updating the index
C. When selecting on the index
D. When inserting using the index


(10/55) Which of the following can be accomplished with a single UPDATE stat
ement?
(Select the correct response)
A. Updating multiple tables
B. Updating a view consisting of joined tables
C. Updating multiple tables based on a WHERE clause
D. Updating a table based on a sub-select using joined tables
(11/55) Which of the following is NOT a valid data type on CREATE TABLE?
(Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
D. DATETIME


(12/55) Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (c1 IN ('A01','B01','C01'))
)
DB2 verifies that the table check constraint is met during which of the follo
wing actions?

(Select the correct response)
A. Adding data using load
B. The reorg of the table
C. The insert of each row in t1
D. The creation of the index for the table


(13/55) If a DB2 Warehouse Manager toolkit is selected during the installati
on of DB2 UDB Version 7.1, which of the following databases must be defined?

(Select the correct response)
A. None
B. Target Database
C. Source Database
D. Control Database


(14/55) With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a'
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?

(Select the correct response)
A. 0
B. 1
C. 2
D. 3
(15/55) Which of the following occurs if an application ends abnormally duri
ng an active unit of work?
(Select the correct response)
A. Current unit of work is committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. Current unit of work moves to pending state


(16/55) Which of the following Control Center features can be used to update
information for the optimizer to choose the best path to data?
(Select the correct response)
A. Show Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table


(17/55) Given the following:
TAB1 TAB2
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 B 22
C 13 C 23
The following results are desired:
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 -- --
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx


(18/55) Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm DECIMAL(10,2)
The job column contains these job types: manager, clerk, and salesperson. Whi
ch of the following statements will return the data with all managers togethe
r, all clerks together and all salespeople together in the output?
(Select the correct response)
A. SELECT * FROM staff ORDER BY job
B. SELECT job, name FROM staff GROUP BY name, job
C. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm.
D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm.]

(19/55) Which of the following types of DB2 locks allows for the most concur
rency within a table?
(Select the correct response)
A. A row lock
B. A page lock
C. A field lock
D. A column lock


(20/55) Which of the following CANNOT be used to restrict specific values fr
om being inserted into a column in a particular table?
(Select the correct response)
A. view
B. index
C. check constraint
D. referential constraint


(21/55) Which of the following describes why savepoints are NOT allowed insi
de an atomic unit of work?
(Select the correct response)
A. Atomic units of work span multiple databases, but savepoints are limited t
o units of work which operate on a single database.
B. A savepoint implies that a subset of the work may be allowed to succeed, w
hile atomic operations must succeed or fail as a unit.
C. A savepoint requires an explicit commit to be released, and commit stateme
nts are not allowed in atomic operations such as compound SQL.
D. A savepoint cannot be created without an active connection to a database,
but atomic operations can contain a CONNECT as a sub-statement.


(22/55) Given the tables:

TABLEA TABLEB
Empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 2000.00
TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
CONSTRAINT const1 FOREIGN KEY (empid)
REFERENCES tablea (empid) ON DELETE SET NULL)
How many rows would be deleted from tableb if the following command is issued
:
DELETE FROM tablea WHERE empid = '2'?

(Select the correct response)
A. 0
B. 1
C. 2
D. 3


(23/55) Which two of the following DB2 authorization groups are authorized t
o create a table within database sample?
(Select all that apply)
A. DBADM
B. DBCTRL
C. SYSADM
D. DBMAINT
E. ALTERIN
F. SYSMAINT

(24/55) Given the table T1 created by:
CREATE TABLE t1
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
c1 CHAR(10) NOT NULL,
c2 CHAR(10)
)
Which of the following INSERT statements will succeed?
(Select the correct response)
A. INSERT INTO t1 VALUES (1, 'abc', NULL)
B. INSERT INTO t1 VALUES (1, NULL, 'def')
C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL)
D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def')


(25/55) Given the two following tables:
Names
Name Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13

Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
Joe Sakic 94
Which of the following statements will display the player's Names, numbers an
d points for all players with an entry in both tables?
(Select the correct response)
A. SELECT names.names, names.number, points.points FROM names INNER JOIN poin
ts ON names.name=points.name
B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN
points ON names.name=points.name
C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN
points ON names.name=points.name
D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN
points ON names.name=points.name


(26/55) For which of the following database objects can locks be obtained?
(Select the correct response)
A. View
B. Table
C. Trigger
D. Buffer Pool

(27/55) When granted to user1, which of the following will allow user1 to ONL
Y access table data?
(Select the correct response)
A. DBADM authority
B. SYSADM authority
C. SELECT privilege on the table
D. SELECT privilege WITH GRANT OPTION on the table

(28/55) Given the following SQL statements:
CREATE TABLE tab1 (col1 INT)
CREATE TABLE tab2 (col1 INT)
INSERT INTO tab1 VALUES (NULL),(1)
INSERT INTO tab2 VALUES (NULL),(1)
SELECT COUNT(*) FROM tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
E. 0

(29/55) User2 has DBADM authority on database DB1. This allows the user to d
o which of the following?
(Select the correct response)
A. Drop database DB1
B. Backup database DB1
C. Create tables in any database
D. Create tables in database DB1

(30/55) When establishing client-server communication, passwords CANNOT be v
erified by:
(Select the correct response)
A. The DRDA DB2 server.
B. The client operating system.
C. The gateway operating system.
D. Looking in the catalog tables for the password.

(31/55) Given an application bound with cursor stability which will be updat
ing rows in a table and obtaining row locks, which of the following table loc
ks will DB2 acquire for the application first?
(Select the correct response)
A. U – update
B. X – exclusive
C. IU - intent update
D. IX - intent exclusive

(32/55) The user USER1 is executing the statement
CREATE TABLE app1.table1 (col1 INT, col2 INT)
Which of the following privileges is required by USER1 for the statement to b
e successful?
(Select the correct response)
A. CREATEIN for the database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. CREATEIN for the table table1

(33/55) Which of the following can occur once connected to a database or DRD
A server with an explicit authorization name?
(Select the correct response)
A. Omit a user's password.
B. Change a user's password if the server supports this function.
C. Omit the name of the database or DRDA server if it is local.
D. Use the commit option on the connect statement to commit in-doubt units of
work from a previous connection that was terminated.

(34/55) Given the two following 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(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following statements will display each department, by name, and
the total salary of all employees in the department?
(Select the correct response)
A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt ORDER BY a.deptname
B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt ORDER BY a.deptname
C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt GROUP BY a.deptname
D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt GROUP BY a.deptname

(35/55) Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, the list should not change.

Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

(36/55) The DB2 Administration Server (DAS) is required for which of the fol
lowing?
(Select the correct response)
A. For the administrator user id to install or remove DB2
B. For the remote clients to use the Control Center against the instance
C. For checking authorities in the database manager configuration for SYSADM
D. For maintaining authorities added and removed by the SQL GRANT and REVOKE
commands respectively

(37/55) Given the following scenario: An application uses a 15 digit value t
o uniquely identify customer transactions. This number is also used for arith
metic operations. Which of the following is the most efficient DB2 data type
for the column definition for this purpose?
(Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. NUMERIC(15,2)
E. DECIMAL(15,0)

(38/55) Given a table T1, with a column C1 char(3), that contains strings in
upper and lower case letters, which of the following queries will find all r
ows where C1 is the string 'ABC' in any case?
(Select the correct response)
A. SELECT * FROM t1 WHERE c1 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC')
D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE

(39/55) Which two of the following SQL data types should be used to store bi
nary data?
(Select all that apply)
A. CLOB
B. BLOB
C. VARCHAR
D. GRAPHIC
E. VARCHAR FOR BIT DATA

(40/55) In which of the following locations are the referential constraints
stored?
(Select the correct response)
A. The user tables.
B. The explain tables.
C. SYSIBM.SYSTRIGGERS.
D. The system catalog tables.


(41/55) Which of the following is the result of the following SQL statement:

ALTER TABLE table1 ADD col2 INT WITH DEFAULT
(Select the correct response)
A. The statement fails with a negative SQL code.
B. The statement fails because no default value is specified.
C. A new column called COL2 is added to TABLE1 and populated with zeros.
D. A new column called COL2 is added to TABLE1 and populated with nulls.

(42/55) A user creates the table TABLE1. Which of the following statements w
ould explicitly give USER1 the ability to read rows from the table?
(Select the correct response)
A. GRANT VIEW TO user1 ON TABLE table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. GRANT ACCESS ON TABLE table1 TO user1

(43/55) Which of the following tools allows the DBA to set limits, and be al
erted if these limits are exceeded?
(Select the correct response)
A. DB2 Index Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor

(44/55) Given the following embedded SQL programs:
Program 1:
Create table mytab (col1 int, col2 char(24))
Commit
Program 2:
Insert into mytab values ( 20989,'Joe Smith')
Commit
Insert into mytab values ( 21334,'Amy Johnson')
Delete from mytab
Commit
Insert into mytab values ( 23430,'Jason French')
Rollback
Insert into mytab values ( 20993,'Samantha Jones')
Commit
Delete from mytab where col1=20993
Rollback
Which of the following records will be returned by the statement
SELECT * FROM mytab?
(Select the correct response)
A. 20989, Joe Smith
B. 21334, Amy Johnson
C. 23430, Jason French
D. 20993, Samantha Jones
E. No records are returned

(45/55) Which of the following DB2 components allows the analysis of multidi
mensional databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Control Center
C. DB2 OLAP Starter Kit
D. DB2 Spatial Extender
E. DB2 Performance Monitor

(46/55) Which of the following DB2 UDB isolation levels will NOT lock any r
ows during read processing?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability

(47/55) Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm DECIMAL(10,2)
Which of the following SQL statements will return the total number of employe
es in each department and the corresponding department id under the following
conditions:
Only return departments with at least one employee receiving a commission gre
ater than 5000. The result should be sorted by the department count from most
to least.
(Select the correct response)
A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER BY
2 DESC
B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER BY
2 DESC
C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORD
ER BY 2 DESC
D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, c
omm ORDER BY 3 DESC

(48/55) Which of the following utilities can examine a table and its indexes
and update the system catalogs with the table's statistical information?
(Select the correct response)
A. runstats
B. getstats
C. check index
D. chkstats

(49/55)   Which of the following Control Center options shows the dependencies
between   a specific view and its tables?
(Select   the correct response)
A. Show   SQL
B. Show   Related
C. Sample Contents
D. Customize Columns

(50/55) Given the table COUNTRY and the statements below
COUNTRY
ID NAME PERSON_ID CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10]
4 Germany 1 0
5 France 7 5
DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam
e
OPEN c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
Which of the following is the last name obtained from the table?
(Select the correct response)
A. Cuba
B. France
C. Canada
D. Germany
E. Argentina

(51/55) To set up a client that can access DB2 UDB through DB2 Connect Ente
rprise Edition, which of the following is the minimum software client that mu
st be installed?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client

(52/55) Which of the following authorities should be given to the DB2 Admini
stration Server (DAS) Instance owner at the administered instance?
(Select the correct response)
A. DBADM
B. SYSADM
C. SYSCTRL
D. SYSMAINT

(53/55) For a clustering index to be effective in keeping the data in order,
which of the following parameters must be set correctly for the index?
(Select the correct response)
A. FREE ROWS
B. PERCENT FREE
C. CLUSTERRATIO
D. CLUSTER FACTOR

(54/55) Which of the following processing can occur for a unit of work using
an isolation level of Read Stability and scanning through the table more tha
n once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. Rows changed in a result set by other processes from one scan to the next

(55/55) Given a table T1, with a column C1 char(3), that contains strings in
upper and lower case letters, which of the following queries will find all r
ows where C1 is the string 'ABC' in any case?
(Select the correct response)
A. SELECT * FROM t1 WHERE c1 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC')
D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE

*********************************************************



自测题 5


--------------------------------------------------------------------------------

(1/55) When granted   to user1, which of the following will allow user1 to ONLY
access table data?
(Select the correct   response)
A. DBADM authority
B. SYSADM authority
C. SELECT privilege   on the table
D. SELECT privilege   WITH GRANT OPTION on the table

(2/55) Given the statement:
CREATE TABLE t1
(
c1 INTEGER NOT NULL,
c2 INTEGER,
PRIMARY KEY(c1),
FOREIGN KEY(c2) REFERENCES t2
)
How many non-unique indexes are defined for table t1?
(Select the correct response)
A.   0
B.   1
C.   2
D.   3

(3/55) Which two of the following DB2 authorization groups are authorized to
create a table within database sample?
(Select all that apply)

A.   DBADM
B.   DBCTRL
C.   SYSADM
D.   DBMAINT
E.   ALTERIN
F.   SYSMAINT

(4/55) Given the following table definition:
STAFF
id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary DECIMAL(10,2)
comm DECIMAL(10,2)

The job column contains these job types: manager, clerk, and salesperson. Whi
ch of the following statements will return the data with all managers togethe
r, all clerks together and all salespeople together in the output?
(Select the correct response)
A. SELECT * FROM staff ORDER BY job
B. SELECT job, name FROM staff GROUP BY name, job
C. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm

D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm


(5/55) Which of the following describes why savepoints are NOT allowed insid
e an atomic unit of work?
(Select the correct response)
A. Atomic units of work span multiple databases, but savepoints are limi
ted to units of work which operate on a single database.
B. A savepoint implies that a subset of the work may be allowed to succe
ed, while atomic operations must succeed or fail as a unit.
C. A savepoint requires an explicit commit to be released, and commit st
atements are not allowed in atomic operations such as compound SQL.
D. A savepoint cannot be created without an active connection to a datab
ase, but atomic operations can contain a CONNECT as a sub-statement.
(6/55) Given the two following tables:
Names
Name Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13

Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
Joe Sakic 94

Which of the following statements will display the player's Names, numbers an
d points for all players with an entry in both tables?
(Select the correct response)
A. SELECT names.names, names.number, points.points FROM names INNER JOIN
points ON names.name=points.name
B. SELECT names.name, names.number, points.points FROM names FULL OUTER
JOIN points ON names.name=points.name
C. SELECT names.name, names.number, points.points FROM names LEFT OUTER
JOIN points ON names.name=points.name
D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER
JOIN points ON names.name=points.name

(7/55) Given the following scenario: An application uses a 15 digit value to
uniquely identify customer transactions. This number is also used for arithm
etic operations. Which of the following is the most efficient DB2 data type f
or the column definition for this purpose?
(Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. NUMERIC(15,2)
E. DECIMAL(15,0)

(8/55) Which of the following can be accomplished with a single UPDATE state
ment?
(Select the   correct response)
A. Updating   multiple tables
B. Updating   a view consisting of joined tables
C. Updating   multiple tables based on a WHERE clause
D. Updating   a table based on a sub-select using joined tables

(9/55) 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:
SELECT * FROM staff, country
will return how many rows?
(Select the correct response)
A. 2
B. 4
C. 5
D. 7
E. 10

(10/55) A user creates the table TABLE1. Which of the following statements w
ould explicitly give USER1 the ability to read rows from the table?
(Select the correct response)
A. GRANT VIEW TO user1 ON TABLE table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. GRANT ACCESS ON TABLE table1 TO user1

(11/55) Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, the list should not change.

Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

(12/55) Which of the following Control Center options shows the dependencies
between a specific view and its tables?
(Select the correct response)
A. Show SQL
B. Show Related
C. Sample Contents
D. Customize Columns

(13/55) Given the following:TAB1 TAB2
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 C 22
C 13 D 23

The following results are desired:C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 - -
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx

(14/55) To set up a client that can access DB2 UDB through DB2 Connect Enter
prise Edition, which of the following is the minimum software client that mus
t be installed?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client

(15/55) The user USER1 is executing the statement
CREATE TABLE app1.table1 (col1 INT, col2 INT)
Which of the following privileges is required by USER1 for the statement to b
e successful?
(Select the correct response)
A. CREATEIN for the database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. CREATEIN for the table table1

(16/55) Which of the following DB2 components allows the analysis of multidi
mensional databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Control Center
C. DB2 OLAP Starter Kit
D. DB2 Spatial Extender
E. DB2 Performance Monitor

(17/55) Which of the following tools can be used to identify inefficient SQL
statements without executing the query?
(Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. Performance Monitor

(18/55) When establishing client-server communication, passwords CANNOT be v
erified by:
(Select the correct response)
A. The DRDA DB2 server.
B. The client operating system.
C. The gateway operating system.
D. Looking in the catalog tables for the password.

(19/55) Which two of the following SQL data types should be used to store bi
nary data?
(Select all that apply)
A. CLOB
B. BLOB
C. VARCHAR
D. GRAPHIC
E. VARCHAR FOR BIT DATA

(20/55) Which of the following occurs if an application ends abnormally duri
ng an active unit of work?
(Select the correct response)
A. Current unit of work is committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. Current unit of work moves to pending state

(21/55) Which of the following products can be used to generate Extensible M
arkup Language documents from DB2 tables?
(Select the correct response)
A. Net Search
B. XML Extender
C. AVI Extender
D. Text Extender
(22/55) Which of the following SQL statements can remove all rows from a tab
le named COUNTRY?
(Select the correct response)
A. DELETE country
B. DELETE FROM country
C. DELETE * FROM country
D. DELETE ALL FROM country

(23/55) Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (c1 IN ('A01','B01','C01'))
)
DB2 verifies that the table check constraint is met during which of the follo
wing actions?
(Select the correct response)
A. Adding data using load
B. The reorg of the table
C. The insert of each row in t1
D. The creation of the index for the table

(24/55) Given the following DDL statement:
CREATE TABLE newtab1 LIKE tab1
Which of the following would occur as a result of the statement execution?
(Select the correct response)
A. NEWTAB1 has same triggers as TAB1
B. NEWTAB1 is populated with TAB1 data
C. NEWTAB1 has the same primary key as TAB1
D. NEWTAB1 columns have same attributes as TAB1

(25/55) Which of the following authorities should be given to the DB2 Admini
stration Server (DAS) Instance owner at the administered instance?
(Select the correct response)
A. DBADM
B. SYSADM
C. SYSCTRL
D. SYSMAINT

(26/55) Which of the following is the result of the following SQL statement:
ALTER TABLE table1 ADD col2 INT WITH DEFAULT
(Select the correct response)
A. The statement fails with a negative SQL code.
B. The statement fails because no default value is specified.
C. A new column called COL2 is added to TABLE1 and populated with zeros.

D. A new column called COL2 is added to TABLE1 and populated with nulls.
E. A new column called COL2, which cannot contain nulls, is added to TAB
LE1.

(27/55) Given the following table definition:
STAFF
id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary DECIMAL(10,2)
comm DECIMAL(10,2)

Which of the following SQL statements will return the total number of employe
es in each department and the corresponding department id under the following
conditions:
Only return departments with at least one employee receiving a commission gre
ater than 5000. The result should be sorted by the department count from most
to least.
(Select the correct response)
A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORD
ER BY 2 DESC
B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORD
ER BY 2 DESC
C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, com
m ORDER BY 2 DESC
D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY de
pt, comm ORDER BY 3 DESC

(28/55) Which of the following Control Center features can be used to update
information for the optimizer to choose the best path to data?
(Select the correct response)
A. Show Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table

(29/55) Which of the following can occur once connected to a database or DRD
A server with an explicit authorization name?
(Select the correct response)
A. Omit a user's password.
B. Change a user's password if the server supports this function.
C. Omit the name of the database or DRDA server if it is local.
D. Use the commit option on the connect statement to commit in-doubt uni
ts of work from a previous connection that was terminated.

(30/55) If a DB2 Warehouse Manager toolkit is selected during the installati
on of DB2 UDB Version 7.1, which of the following databases must be defined?
(Select the correct response)
A. None
B. Target Database
C. Source Database
D. Control Database

(31/55) Which of the following CANNOT be used to restrict specific values fr
om being inserted into a column in a particular table?
(Select the correct response)
A. view
B. index
C. check constraint
D. referential constraint

(32/55) For which of the following database objects can locks be obtained?
(Select the correct response)
A. View
B. Table
C. Trigger
D. Buffer Pool

(33/55) Which of the following types of DB2 locks allows for the most concur
rency within a table?
(Select the correct response)
A. A row lock
B. A page lock
C. A field lock
D. A column lock

(34/55) Given the following embedded SQL programs:
Program 1:
Create table mytab (col1 int, col2 char(24))
Commit
Program 2:
Insert into mytab values ( 20989,'Joe Smith')
Commit
Insert into mytab values ( 21334,'Amy Johnson')
Delete from mytab
Commit
Insert into mytab values ( 23430,'Jason French')
Rollback
Insert into mytab values ( 20993,'Samantha Jones')
Commit
Delete from mytab where col1=20993
Rollback
Which of the following records will be returned by the statement
SELECT * FROM mytab?
(Select the correct response)
A. 20989, Joe Smith
B.   21334, Amy Johnson
C.   23430, Jason French
D.   20993, Samantha Jones
E.   No records are returned

(35/55) Given a table T1, with a column C1 char(3), that contains strings in
upper and lower case letters, which of the following queries will find all r
ows where C1 is the string 'ABC' in any case?
(Select the correct response)
A. SELECT * FROM t1 WHERE c1 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC')
D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE

(36/55) In which of the following locations are the referential constraints
stored?
(Select the correct response)
A. The user tables.
B. The explain tables.
C. SYSIBM.SYSTRIGGERS.
D. The system catalog tables.

(37/55) Given the table T1 created by:
CREATE TABLE t1
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
c1 CHAR(10) NOT NULL,
c2 CHAR(10)
)
Which of the following INSERT statements will succeed?
(Select the correct response)
A. INSERT INTO t1 VALUES (1, 'abc', NULL)
B. INSERT INTO t1 VALUES (1, NULL, 'def')
C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL)
D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def')

(38/55) For a clustering index to be effective in keeping the data in order,
which of the following parameters must be set correctly for the index?
(Select the correct response)
A. FREE ROWS
B. PERCENT FREE
C. CLUSTERRATIO
D. CLUSTER FACTOR

(39/55) Which of the following is NOT a valid data type on CREATE TABLE?
(Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
D. DATETIME

(40/55) User2 has DBADM authority on database DB1. This allows the user to d
o which of the following?
(Select the correct response)
A. Drop database DB1
B. Backup database DB1
C. Create tables in any database
D. Create tables in database DB1

(41/55) Which of the following describes when indexes can be explicitly refe
renced by name within an SQL statement?
(Select the correct response)
A. When dropping the index
B. When updating the index
C. When selecting on the index
D. When inserting using the index

(42/55) The DB2 Administration Server (DAS) is required for which of the fol
lowing?
(Select the correct response)
A. For the administrator user id to install or remove DB2
B. For the remote clients to use the Control Center against the instance

C. For checking authorities in the database manager configuration for SY
SADM
D. For maintaining authorities added and removed by the SQL GRANT and RE
VOKE commands respectively

(43/55) Which of the following tasks can be performed using the ALTER TABLES
PACE statement?
(Select the correct response)
A. Assign a bufferpool.
B. Change the table space name.
C. Change the type of the table space.
D. Change the page size of the table space.

(44/55) Given the tables:

TABLEA TABLEB
empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 2000.00

TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
CONSTRAINT const1 FOREIGN KEY (empid)
REFERENCES tablea (empid) ON DELETE SET NULL)
How many rows would be deleted from tableb if the following command is issued
:
DELETE FROM tablea WHERE empid = '2'?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(45/55) Given an embedded SQL program with a single connection, two threads
and the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
How many records will be successfully inserted into the table mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(46/55) Given the two following 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(20)
years INTEGER
salary DECIMAL(10,2)
comm DECIMAL(10,2)

Which of the following statements will display each department, by name, and
the total salary of all employees in the department?
(Select the correct response)
A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb
=b.dept ORDER BY a.deptname
B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb
=b.dept ORDER BY a.deptname
C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb
=b.dept GROUP BY a.deptname
D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb
=b.dept GROUP BY a.deptname

(47/55) Which of the following processing can occur for a unit of work using
an isolation level of Read Stability and scanning through the table more tha
n once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the ne
xt
D. Rows changed in a result set by other processes from one scan to the
next

(48/55) Which of the following DB2 UDB isolation levels will NOT lock any ro
ws during read processing?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability

(49/55) With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a'
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(50/55) Which of the following tools allows the DBA to set limits, and be al
erted if these limits are exceeded?
(Select the correct response)
A. DB2 Index Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor

(51/55) Which of the following utilities can examine a table and its indexes
and update the system catalogs with the table's statistical information?
(Select the correct response)
A. runstats
B. getstats
C. check index
D. chkstats

(52/55) Given the following SQL statements:
CREATE TABLE tab1 (col1 INT)
CREATE TABLE tab2 (col1 INT)
INSERT INTO tab1 VALUES (NULL),(1)
INSERT INTO tab2 VALUES (NULL),(1)
SELECT COUNT(*) FROM tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
E. 0

(53/55) Given an application bound with cursor stability which will be updat
ing rows in a table and obtaining row locks, which of the following table loc
ks will DB2 acquire for the application first?
(Select the correct response)
A. U - update
B. X - exclusive
C. IU - intent update
D. IX - intent exclusive

(54/55) Given the table COUNTRY and the statements below:
COUNTRY
ID NAME PERSON_ID CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5

DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam
e
OPEN c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
Which of the following is the last name obtained from the table?
(Select the correct response)
A. Cuba
B. France
C. Canada
D. Germany
E. Argentina

(55/55) Given two embedded SQL program executions with the following actions
:
Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK

Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4

***********************************************************



自测题 6


--------------------------------------------------------------------------------

1. With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A.0
B.1
C.2
D.3

2. Which of the following Control Center features can be used to update infor
mation for the optimizer to choose the best path to data?
(Select the correct response)
A Show Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table

3. Given the tables:
TABLEA TABLEB
Empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 1000.00
TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
CONSTRAINT const1 FOREIGN KEY (empid)
REFERENCES tablea (empid) ON DELETE SET NULL)
How many rows would be deleted from tableb if the following command is issued
:
DELETE FROM tablea WHERE empid = '2'?
(Select the correct response)
A.0
B.1
C.2
D.3

4. Which of the following DB2 UDB isolation levels will NOT lock any rows dur
ing read processing?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability

5. Which of the following processing can occur for a unit of work using an is
olation level of Read Stability and scanning through the table more than once
within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. Rows changed in a result set by other processes from one scan to the next

6. Which of the following describes when indexes can be explicitly referenced
by name within an SQL statement?
(Select the correct response)
A. When dropping the index
B. When updating the index
C. When selecting on the index
D. When inserting using the index

7. Given an embedded SQL program with a single connection, two threads and th
e following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A.0
B.1
C.2
D.3

8. A user creates the table TABLE1. Which of the following statements would e
xplicitly give USER1 the ability to read rows from the table?
(Select the correct response)
A. GRANT VIEW TO user1 ON TABLE table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. GRANT ACCESS ON TABLE table1 TO user1
9. Given the following:
TAB1 TAB2
C1 C2 CX CY
--- --- --- ---
A 11 A 21
B 12 C 22
C 13 D 23
The following results are desired:
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 -- --
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx]
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx

10. Given the following scenario: An application uses a 15 digit value to uni
quely identify customer transactions. This number is also used for arithmetic
operations. Which of the following is the most efficient DB2 data type for t
he column definition for this purpose?
(Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. NUMERIC(15,2)
E. DECIMAL(15,0)

11. Given the table T1 created by:
CREATE TABLE t1
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
c1 CHAR(10) NOT NULL,
c2 CHAR(10)
)
Which of the following INSERT statements will succeed?
(Select the correct response)
A. INSERT INTO t1 VALUES (1, 'abc', NULL)
B. INSERT INTO t1 VALUES (1, NULL, 'def')
C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL)
D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def')

12. Which of the following tools allows the DBA to set limits, and be alerted
if these limits are exceeded?
(Select the correct response)
A. DB2 Index Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor

13. To set up a client that can access DB2 UDB through DB2 Connect Enterprise
Edition, which of the following is the minimum software client that must be
installed?
(Select the correct response)
A DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client

14. Which of the following describes why savepoints are NOT allowed inside an
atomic unit of work?
(Select the correct response)
A. Atomic units of work span multiple databases, but savepoints are limited t
o units of work which operate on a single database.
B. A savepoint implies that a subset of the work may be allowed to succeed, w
hile atomic operations must succeed or fail as a unit.
C. A savepoint requires an explicit commit to be released, and commit stateme
nts are not allowed in atomic operations such as compound SQL.
D. A savepoint cannot be created without an active connection to a database,
but atomic operations can contain a CONNECT as a sub-statement.
15. Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
The job column contains these job types: manager, clerk, and salesperson. Whi
ch of the following statements will return the data with all managers togethe
r, all clerks together and all salespeople together in the output?
(Select the correct response)
A. SELECT * FROM staff ORDER BY job
B. SELECT job, name FROM staff GROUP BY name, job
C. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm.
D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm.

16. The user USER1 is executing the statement
CREATE TABLE app1.table1 (col1 INT, col2 INT)
Which of the following privileges is required by USER1 for the statement to b
e successful?
(Select the correct response)
A. CREATEIN for the database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. CREATEIN for the table table1

17. Which of the following DB2 components allows the analysis of multidimensi
onal databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Control Center
C. DB2 OLAP Starter Kit
D. DB2 Spatial Extender
E. DB2 Performance Monitor

18. Which of the following utilities can examine a table and its indexes and
update the system catalogs with the table's statistical information?
(Select the correct response
A. runstats
B. getstats
C. check index
D.Chkstats

19. In which of the following locations are the referential constraints store
d?
(Select the correct response)
A.   The user tables.
B.   The explain tables.
C.   SYSIBM.SYSTRIGGERS.
D.   The system catalog tables.

20. Which two of the following SQL data types should be used to store binary
data?
(Select all that apply
A. CLOB
B. BLOB
C. VARCHAR
D. GRAPHIC
E. VARCHAR FOR BIT DATA

21. Given the two following tables:
names
name number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13

Points
Name points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
Joe Sakic 94
Which of the following statements will display the player's Names, numbers an
d points for all players with an entry in both tables?
(Select the correct response)
A. SELECT names.names, names.number, points.points FROM names INNER JOIN poin
ts ON names.name=points.name
B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN
points ON names.name=points.name
C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN
points ON names.name=points.name
D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN
points ON names.name=points.name
22. Which two of the following DB2 authorization groups are authorized to cre
ate a table within database sample?
(Select all that apply)
A DBADM
B. DBCTRL
C. SYSADM
D. DBMAINT
E. ALTERIN
F. SYSMAINT

23. Which of the following is the result of the following SQL statement:
ALTER TABLE table1 ADD col2 INT WITH DEFAULT
(Select the correct response)
A The statement fails with a negative SQL code
B. The statement fails because no default value is specified..
C A new column called COL2 is added to TABLE1 and populated with zeros.
D. A new column called COL2 is added to TABLE1 and populated with nulls.
E. A new column called COL2, which cannot contain nulls, is added to TABLE1.

24. Which of the following authorities should be given to the DB2 Administrat
ion Server (DAS) Instance owner at the administered instance?
(Select the correct response)
A. DBADM
B. SYSADM
C. SYSCTRL
D. SYSMAINT

25. Which of the following products can be used to generate Extensible Markup
Language documents from DB2 tables?
(Select the correct response)
A. Net Search
B. XML Extender
C. AVI Extender
D. Text Extender.

26. Which of the following can be accomplished with a single UPDATE statement
?
(Select the correct response)
A. Updating multiple tables
B. Updating a view consisting of joined tables
C. Updating multiple tables based on a WHERE clause
D. Updating a table based on a sub-select using joined tables

27. Given two embedded SQL program executions with the following actions:
Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK
Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A.1
B.2
C.3
D.4

28. Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, the list should not change.
Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

29. Which of the following Control Center options shows the dependencies betw
een a specific view and its tables?
(Select the correct response
A. Show SQL
B. Show Related
C. Sample Contents
D. Customize Columns

30. Given the following SQL statements:
CREATE TABLE tab1 (col1 INT)
CREATE TABLE tab2 (col1 INT)
INSERT INTO tab1 VALUES (NULL),(1)
INSERT INTO tab2 VALUES (NULL),(1)
SELECT COUNT(*) FROM tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A.1
B.2
C.3
D.4
E.0

31. Given the table:
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
DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam
e
OPEN c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
Which of the following is the last name obtained from the table?
(Select the correct response)
A. Cuba
B. France
C. Canada
D. Germany
E. Argentina

32. Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following SQL statements will return the total number of employe
es in each department and the corresponding department id under the following
conditions:
Only return departments with at least one employee receiving a commission gre
ater than 5000. The result should be sorted by the department count from most
to least.
(Select the correct response)
A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER BY
2 DESC
B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER BY
2 DESC
C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORD
ER BY 2 DESC
D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, c
omm ORDER BY 3 DESC
33. Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (c1 IN ('A01','B01','C01'))
)
DB2 verifies that the table check constraint is met during which of the follo
wing actions?
(Select the correct response)
A. Adding data using load
B. The reorg of the table
C. The insert of each row in t1
D. The creation of the index for the table

34. Which of the following can occur once connected to a database or DRDA ser
ver with an explicit authorization name?
(Select the correct response)
A. Omit a user's password.
B. Change a user's password if the server supports this function.
C. Omit the name of the database or DRDA server if it is local.
D. Use the commit option on the connect statement to commit in-doubt units of
work from a previous connection that was terminated.

35. User2 has DBADM authority on database DB1. This allows the user to do whi
ch of the following?
(Select the correct response)
A. Drop database DB1
B. Backup database DB1
C. Create tables in any database
D. Create tables in database DB1

36. When establishing client-server communication, passwords CANNOT be verifi
ed by:
(Select the correct response)
A. The DRDA DB2 server.
B. The client operating system.
C. The gateway operating system.
D. Looking in the catalog tables for the password.

37. Given the table:
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:
SELECT * FROM staff, country
will return how many rows?
(Select the correct response)
A.2
B.4
C.5
D.7
E10

38.For a clustering index to be effective in keeping the data in order, whic
h of the following parameters must be set correctly for the index?
(Select the correct response)
A. FREE ROWS
B. PERCENT FREE
C. CLUSTERRATIO
D. CLUSTER FACTOR

39. Given the two following 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(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following statements will display each department, by name, and
the total salary of all employees in the department?
(Select the correct response)
A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt ORDER BY a.deptname
B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt ORDER BY a.deptname
C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt GROUP BY a.deptname
D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt GROUP BY a.deptname

40. Which of the following occurs if an application ends abnormally during an
active unit of work?
(Select the correct response)
A. Current unit of work is committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. Current unit of work moves to pending state

41. For which of the following database objects can locks be obtained?
(Select the correct response)
A. View
B. Table
C. Trigger
D. Buffer Pool

42. Given the following DDL statement:
CREATE TABLE newtab1 LIKE tab1
Which of the following would occur as a result of the statement execution?
(Select the correct response)
A. NEWTAB1 has same triggers as TAB1
B. NEWTAB1 is populated with TAB1 data
C. NEWTAB1 has the same primary key as TAB1
D. NEWTAB1 columns have same attributes as TAB1

43. When granted to   user1, which of the following will allow user1 to ONLY ac
cess table data?
(Select the correct   response)
A. DBADM authority
B. SYSADM authority
C. SELECT privilege   on the table
D. SELECT privilege   WITH GRANT OPTION on the table

44. Which of the following tools can be used to identify inefficient SQL stat
ements without executing the query?
(Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. Performance Monitor

45. Which of the following CANNOT be used to restrict specific values from be
ing inserted into a column in a particular table?
(Select the correct response)
A. view
B. index
C. check constraint
D. referential constraint
46. Which of the following types of DB2 locks allows for the most concurrency
within a table?
(Select the correct response
A. A row lock
B. A page lock
C. A field lock
D. A column lock

47. The DB2 Administration Server (DAS) is required for which of the followin
g?
(Select the correct response)]
A. For the administrator user id to install or remove DB2
B. For the remote clients to use the Control Center against the instance
C. For checking authorities in the database manager configuration for SYSADM
D. For maintaining authorities added and removed by the SQL GRANT and REVOKE
commands respectively

48. Given the statement:
CREATE TABLE t1
(
c1 INTEGER NOT NULL,
c2 INTEGER,
PRIMARY KEY(c1),
FOREIGN KEY(c2) REFERENCES t2
)
How many non-unique indexes are defined for table t1?
(Select the correct response)
A.0
B.1
C.2
D.3

49. Given the following embedded SQL programs:
Program 1:
Create table mytab (col1 int, col2 char(24))
Commit
Program 2:
Insert into mytab values ( 20989,'Joe Smith')
Commit
Insert into mytab values ( 21334,'Amy Johnson')
Delete from mytab
Commit
Insert into mytab values ( 23430,'Jason French')
Rollback
Insert into mytab values ( 20993,'Samantha Jones')
Commit
Delete from mytab where col1=20993
Rollback
Which of the following records will be returned by the statement
SELECT * FROM mytab?
(Select the correct response)
A. 20989, Joe Smith
B. 21334, Amy Johnson
C. 21334, Amy Johnson
D. 20993, Samantha Jones
E. No records are returned

50. Given an application bound with cursor stability which will be updating r
ows in a table and obtaining row locks, which of the following table locks wi
ll DB2 acquire for the application first?
(Select the correct response)
A. U – update
B. X – exclusive
C. IU - intent update
D. IX - intent exclusive

51 . Which of the following is NOT a valid data type on CREATE TABLE?
(Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
D. DATETIME

52. If a DB2 Warehouse Manager toolkit is selected during the installation of
DB2 UDB Version 7.1, which of the following databases must be defined?
(Select the correct response)
A. None
B. Target Database
C. Source Database
D. Control Database

53. Which of the following SQL statements can remove all rows from a table na
med COUNTRY?
(Select the correct response)
A. DELETE country
B. DELETE FROM country
C. DELETE * FROM country
D. DELETE ALL FROM country

54. Which of the following tasks can be performed using the ALTER TABLESPACE
statement?
(Select the correct response)
A. Assign a bufferpool.
B. Change the table space name.
C. Change the type of the table space.
D. Change the page size of the table space.
55.To set up a client that can access DB2 UDB through DB2 Connect Enterprise
Edition, which of the following is the minimum software client that must be
installed?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client

**************************************************************



自测题 7


--------------------------------------------------------------------------------

1. Given the following table with a primary key on empid:
Emp:
Empid Name
11 Joe Smith
23 Melanie Jones
30 Robert Bruce
49 Janice Baker
66 Mario Diaz
68 Maria Diaton
Give the following statement in an embedded SQL program bound with Repeatable
Read:
Select * from Emp where empid < 55
How many rows in the table will be locked after the statement is run?
A.0
B.1
C.4
D.5
E.6

2. Given an embedded SQL program with a single connection, two threads and th
e following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A.0
B.1
C.2
D.3

3. With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A.0
B.1
C.2
D.3

4. Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following statements will return all of the records ordered by j
ob with the salaries in descending order?
(Select the correct response
A. SELECT * FROM staff ORDER BY salary DESC, job
B. SELECT * FROM staff GROUP BY salary DESC, job
C. SELECT * FROM staff ORDER BY job, salary DESC
D. SELECT * FROM staff GROUP BY job, salary DESC

5. Which of the following is the result of a successful ROLLBACK statement?
(Select the correct response)
A.Held locks are released
B. Release-pending conditions are undone
C. Tables in LOAD PENDING are released
D. Constraint checking conditions are undone
E. Existing database connections are released

6. Which of the following processing can occur for a unit of work using an is
olation level of Cursor Stability and allows scanning through the table more
than once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Have updated result set rows changed by other processes from one scan to t
he next
D. Have accessed result set rows changed by other processes from one scan to
the next

7. Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, it should only change if another agent unassigns a currently assigned sea
t.
Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

8. Given the following column requirements:
Col1 Numeric Identifier - From 1 to 1000000
Col2 Job Code - Variable, 1 to 2 characters long
Col3 Job Description - Variable, 1 to 100 characters long
Col4 Job Length - Length of Job in seconds
Which of the following will minimize the disk space allocated to store the re
cords if Job Description has an average length of 45?
(Select the correct response)
A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT)
B. B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT)
C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT)
D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT)

9. Which of the following DB2 components can limit the resource consumption o
f queries?
(Select the correct response)
A. DB2 Connect
B. DB2 Query Patroller
C. DB2 Performance Monitor
D. DB2 Net Search Extender

10. Given the table definition:
DEFIN1:
Id SMALLINT NOT NULL
Name VARCHAR(30)
Hired DATE
DEFIN2:
Deptid SMALLINT NOT NULL
Name VARCHAR(30)
Started DATE
Which of the following statements will insert successfully into table DEFIN1?
(Select the correct response)
A. INSERT INTO defin1 (id) VALUES (1)
B. INSERT INTO defin1 (name) VALUES ('Florence')
C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE FROM def
in2
D. INSERT INTO defin1 (name, hired) SELECT DISTINCT 'Florence', CURRENT DATE
FROM defin2

11. Which of the following isolation levels will lock only the rows returned
in the result set?
A. Read Stability
B. Repeatable Read
C. Cursor Stability
D. Uncommitted Read

12. Given the following table definitions
DEPARTMENT
Deptno CHAR(3)
Deptname CHAR(30)
Mgrno INTEGER
Admrdept CHAR(3)

EMPLOYEE
Empno INTEGER
Firstname CHAR(30)
Midinit CHAR
Lastname CHAR(30)
Workdept CHAR(3)
Which of the following statements will list the employee's employee number, l
ast name, and department name ONLY for those employees who have a department?
A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE
e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep
artment d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep
artment d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de
partment d WHERE e.workdept = d.deptno

13. A view is used instead of a table for users to do which of the following?

(Select the correct response)
A. Avoid allocating more disk space per database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
D. Avoid allocating frequently used query result tables

14. Given the table:
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
Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?

(Select the   correct response)
A. ORDER BY   2,1
B. GROUP BY   2, 1
C. ORDER BY   cities, name
D. GROUP BY   cities, name

15. Which of the following tools maintains a history of all executed statemen
ts/commands for the current session within the tool?
(Select the correct response
A. Journal
B. SQL Assist
C. DB2 Alert Center
D. DB2 Command Center

16. Given table T1 with 100 rows, which of the following queries will retriev
e 10 rows from table T1?
(Select the correct response)
A. SELECT * FROM t1 MAXIMUM 10 ROWS
B. SELECT * FROM t1 READ 10 ROWS ONLY
C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS
D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY

17. Given the table T1, created by:
CREATE TABLE t1
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
c1 CHAR(3)
)
The following SQL statements are issued:
INSERT INTO t1 VALUES (1, 'ABC')
INSERT INTO t1 VALUES (5, 'DEF')
Which of the following values are inserted into the ID column by the followin
g statement?
INSERT INTO t1(c1) VALUES ('XYZ')
(Select the correct response)
A.0
B.1
C.2
D.5
E.6

18. Which of the following products can be used to perform a dictionary-based
search?
(Select the correct response)
A. Net.Data
B. XML Extender
C. AVI Extender
D. Text Extender

19. Which of the following statements will create an index and prevent table
T1 from containing two or more rows with the same values for column C1?
(Select the correct response)
A. CREATE UNIQUE INDEX ix4 ON t1 (c1)
B. CREATE DISTINCT INDEX ix1 ON t1 (c1)
C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)
D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)

20. How many DB2 Administration Server (DAS) Instances can be set up per phys
ical machine?
(Select the correct response)
A.0
B.1
C. One for each instance on the physical machine
D. One for each database on the physical machine

21. Why is a unique index not sufficient for creation of a primary key?
(Select the correct response)
A. It is sufficient - a primary key is the same thing as a unique index.
B. Unique indexes can be defined in ascending or descending order. Primary ke
ys must be ascending.
C. A unique index can be defined over a column or columns that allow nulls. P
rimary keys cannot contain nulls.
D. A unique index can be defined over a column or columns that allow nulls. T
his is not allowed for primary keys because foreign keys cannot contain nulls
.

22. Which of the following will rebuild a package in the database from the ex
isting catalog information?
(Select the correct response)
A. bind
B. rebind
C. update
D. rebuild

23. Which of the following DELETE RULES on CREATE TABLE will delete a depende
nt table row if the parent table row is deleted?
(Select the correct response
A.   ON   DELETE   REMOVE
B.   ON   DELETE   CASCADE
C.   ON   DELETE   RESTRICT
D.   ON   DELETE   SET NULL
E.   ON   DELETE   PROPAGATE

24. Which of the following is the best way to restrict user access to a subse
t of columns in a table?
(Select the correct response)
A. Only grant access to the columns within a table that a user is allowed to
see.
B. Create a view that only includes the columns a user is allowed to see. Gra
nt the user access to the view, not the base table.
C. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a join when all data must be
presented.
D. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a union when all data must be
presented.

25. Given the following DDL statements,
CREATE TABLE t1 (a INT, b INT, c INT)
CREATE VIEW v1 AS SELECT a, b, c FROM t1
WHERE a > 250
WITH CHECK OPTION
Which of the following INSERT statements will fail?
(Select the correct response)
A. INSERT INTO t1 VALUES (200, 2, 3)
B. INSERT INTO v1 VALUES (200, 2, 3)
C. INSERT INTO t1 VALUES (300, 2, 3)
D. INSERT INTO v1 VALUES (300, 2, 3)

26. Which two of the following types of storage management method is supporte
d by DB2 OLAP Server ?
(Select all that apply)
A. Object
B. Network
C. Relational
D. Hierachical
E. Multi-dimensional

27. For which of the following can locks be obtained?
(Select the correct response)
A. A trigger
B. A table view
C. A table column
D. A database buffer
E. A row referenced by an index key
28. Which of the following privileges is necessary to populate the table with
large amounts of data?
(Select the correct response)
A. LOAD
B. ALTER
C. UPDATE
D. IMPORT

29. When manually establishing communications from a Windows NT client throug
h a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT
required to catalog?
(Select the correct response
A. The client.
B. The database on the DRDA server.
C. The Database Connection Service database.
D. The node where the DB2 Connect Gateway is.

30. Given the statement:
CREATE TABLE t1 (c1 CHAR(1))
Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol
lowing command is issued:
ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')
Which of the following occurs?
(Select the correct response)
A. Rows with c1 values of b,c,d,e,f are deleted
B. Rows with c1 values of b,c,d,e,f have c1 set to NULL
C. The ALTER command will fail as rows violate the constraint
D. The ALTER command will move the violating rows to the exception table

31. Using the Control Center Create Table dialog box, which of the following
dialogs allows the table creation DDL to be viewed?
(Select the correct response
A. Copy
B. Show SQL
C. Show Related
D. Sample Contents

32. Which of the following DB2 CLP options specify the file that contains the
statements to be executed?
(Select the correct response)
A. –f
B.-b
C.-o
D.-w

33. A user has a numeric data column with a maximum value of 100,000. Which o
f the following data types will use the minimum amount of storage for the col
umn?
(Select the correct response)
A.   IDENTITY
B.   BIGINT
C.   INTEGER
D.   SMALLINT

34. Which two of the following modes can be used on the lock table statement?

(Select all that apply)
A. SHARE MODE
B. EXCLUSIVE MODE
C. REPEATABLE READ MODE
D. UNCOMMITTED READ MODE
E. INTENT EXCLUSIVE MODE

35. Which of the following must be set up to allow the Control Center to view
database objects?
(Select the correct response)
A. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant

36. Which of the following is possible once a user has been given maintenance
authority?
A. DB2 userids can be created.
B. Views can be created on the catalogs.
C. Statistics can be collected for database objects
D. A table can be populated by using the LOAD command.

37. Given the two following tables:
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189

PIM
Name PIM
Mats Sundin 14
Jaromir Jagr 18
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, points and
PIM for all players?
(Select the correct response)
A. SELECT points.name, points.points,   pim.name, pim.pim FROM points INNER JOI
N pim ON points.name=pim.name
B. SELECT points.name, points.points,   pim.name, pim.pim FROM points FULL OUTE
R JOIN pim ON points.name=pim.name
C. SELECT points.name, points.points,   pim.name, pim.pim FROM points LEFT OUTE
R JOIN pim ON points.name=pim.name
D. SELECT points.name, points.points,   pim.name, pim.pim FROM points RIGHT OUT
ER JOIN pim ON points.name=pim.name

38. Given the following table structure:
table1
emp_num INT NOT NULL PRIMARY KEY
emp_fname CHAR(30) NOT NULL
emp_lname CHAR(30) NOT NULL
emp_addr CHAR(60) NOT NULL
emp_pin CHAR(10) NOT NULL
Which of the following columns can be referenced by a foreign key clause from
another table?
(Select the correct response)
A. emp_num
B. emp_pin
C. emp_addr
D. emp_fname
E. emp_lname

39. Which of the following is the result of the following SQL statement:
CREATE UNIQUE INDEX empno_ind ON employee (empno)
(Select the correct response)
A. Every value for EMPNO must be unique.
B. UPDATE statements on EMPNO will be rolled back.
C. Insert statements on EMPNO will always be faster.
D. Insert statements on the EMPNO table will result in clustered data.

40. Given the table definition:
CREATE TABLE student (name CHAR(30), age INTEGER)
To list the names of the 10 youngest students, which of the following index d
efinition statements on the student table may improve the query performance?

(Select the correct response)
A. CREATE INDEX youngest ON student   (age, name)
B. CREATE INDEX youngest ON student   (name, age)
C. CREATE INDEX youngest ON student   (name, age DESC)
D. CREATE INDEX youngest ON student   (name DESC) INCLUDE (age)

41. Which of the following DB2 data types is used to store 50 MB of binary da
ta as a single value?
(Select the correct response)
A.   BLOB
B.   CLOB
C.   DBCLOB
D.   FOR BIT DATA
E.   VARCHAR FOR BIT DATA

42. With tables defined as:
Table1
col1 INT
col2 CHAR(30)

Table2
col1 INT
col2 CHAR(30)
Which of the following statements will insert all the rows in TABLE2 into TAB
LE1?
(Select the correct response)
A. INSERT INTO table1 SELECT col1, col2 FROM table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. INSERT INTO table1 VALUES (table2.col1, table2.col2)
D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)
E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)

43. Given the following UPDATE statement:
UPDATE address2 SET housenumber_buildingname=
(SELECT buildingname FROM address1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which of the following describes the result of the statement?
(Select the correct response)
A. The statement will succeed.
B. The statement will fail because a subquery cannot exist in an UPDATE state
ment.
C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined
as primary keys.
D. The statement will succeed if the data retrieved from the subquery does no
t have duplicate values for ADDRESS1.ID.

44. Given the following embedded SQL programs:
Program 1:
CREATE TABLE mytab (col1 INT, col2 CHAR(24))
COMMIT
Program 2:
INSERT INTO mytab VALUES ( 20989,'Joe Smith')
INSERT INTO mytab VALUES ( 21334,'Amy Johnson')
COMMIT
DELETE FROM mytab
ROLLBACK
INSERT INTO mytab VALUES ( 23430,'Jason French')
ROLLBACK
INSERT INTO mytab VALUES ( 20993,'Samantha Jones')
COMMIT
DELETE FROM mytab WHERE col1=20993
ROLLBACK
Which of the following indicates the number of records that will be returned
by the statement:
SELECT * FROM mytab?
(Select the correct response)
A.0
B.1
C.2
D.3
E.4

45. Which of the following is the most appropriate reason to consider revokin
g the SELECT privilege on the catalog tables from PUBLIC after creating a dat
abase?
(Select the correct response
A. To prevent users from creating tables without proper authority.
B. Some system catalogs record user data in some columns, and this data may b
e confidential.
C. To prevent users from viewing passwords for other DB2 userids that DB2 sto
res in the catalog tables.
D. Some catalog tables are large, so preventing users from viewing them is a
good way to keep users from submitting long-running queries against the catal
ogs.

46. Which of the following is the implicit qualifier for a declared temporary
table?
(Select the correct response)
A. The schema name SYSCAT.
B. The schema name SESSION.
C. The schema name TEMPUSER.
D. The userid specified with the BIND command.
E. The userid who established the connection to the database and declared the
temporary table.

47. Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with col
umns ID and TITLE, what is the effect of the statement:
UPDATE employee SET salary = salary * 1.15
WHERE salary < 15000 OR
EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr'
)
(Select the correct response)
A. Only managers that make less than 15,000 are given salary increases.
B. Only non-managers that make less than 15,000 are given salaray increases.
C. Employees that make less than 15,000 but no managers are given salary incr
eases.
D. Employees that make less than 15,000 and all managers are given salary inc
reases.

48. Which one of the following SQL statements sets the default qualifier to "
user1"?
(Select the correct response)
A. SET CURRENT ID = 'user1'
B. SET CURRENT USER = 'user1'
C. SET CURRENT SQLID = 'user1'
D. SET CURRENT QUALIFIER = 'user1'

49. A table called EMPLOYEE has columns: name, department, and phone_number.
Which of the following can limit access to the phone_number column?
(Select the correct response)
A. Using a view to access the table
B. Using an index on the column
C. Using a referential constraint on the table
D. Using a table check constraint on the table
E. Revoking access from the phone_number column

50. Which of the following can be used to determine the views that are affect
ed by a DROP TABLE statement?
(Select the correct response)
A. DB2 Script Center
B. DB2 Performance Monitor
C DB2 Control Center, Show Related
D. DB2 Control Center, Sample Contents

51. Given two embedded SQL programs and the following actions:
Pgm1 Pgm2
INSERT INTO mytab VALUES (...) DELETE FROM mytab
COMMIT ROLLBACK
DELETE FROM mytab INSERT INTO mytab VALUES (...)
ROLLBACK COMMIT
If there exists one (1) row in table mytab before the programs are executed c
oncurrently, how many records will be in the table once the programs complete
?
(Select the correct response)
A.0
B.1
C.2
D.3
E.4

52. Given the following transaction:
CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
INSERT INTO dwaine.mytab VALUES (1,2)
INSERT INTO dwaine.mytab VALUES (4,3)
ROLLBACK
Which of the following would be returned from the statement:
SELECT * FROM dwaine.mytab?
(Select the correct response)
A. COL1 COL2
----------- -----------
0 record(s) selected.
B. COL1 COL2
----------- -----------
1 2
1 record(s) selected.

C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.
D. COL1 COL2
----------- -----------
1 2
4 3
2 record(s) selected.

53. Which of the following does NOT end a unit of work?
(Select the correct response)
A. COMMIT
B. ROLLBACK
C. TERMINATE
D. SAVEPOINT
E. CONNECT RESET

54. Given the following:
TAB1 TAB2
C1 C2 CX CY
--- --- --- ---
A 11 A 21
B 12 C 22
C 13 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 joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=c0078
B. SELECT * FROM tab1 INNER 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

55. Which of the following products must be installed to provide a single poi
nt of control for local and remote DB2 databases?
(Select the correct response
A.   DB2   Runtime Client
B.   DB2   Administration Client
C.   DB2   Connect Enterprise Edition
D.   DB2   Enterprise-Extended Edition

********************************************************



自测题 8


--------------------------------------------------------------------------------

(1/55)Which two of the following types of storage management method is supp
orted by DB2 OLAP Server ?
(Select all that apply)
A. Object
B. Network
C. Relational
D. Hierachical
E. Multi-dimensional

(2/55)Which of the following DB2 data types is used to store 50 MB of binar
y data as a single value?
(Select the correct response)
A. BLOB
B. CLOB
C. DBCLOB
D. FOR BIT DATA
E. VARCHAR FOR BIT DATA

(3/55)Which of the following must be set up to allow the Control Center to
view database objects?
(Select the correct response)
A. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant

(4/55)Which of the following DB2 CLP options specify the file that contains
the statements to be executed?
(Select the correct response)
A. –f
B. –b
C. -0
D. –w
(5/55)Which of the following DELETE RULES on CREATE TABLE will delete a dep
endent table row if the parent table row is deleted?
(Select the correct response)
A. ON DELETE REMOVE
B. ON DELETE CASCADE
C. ON DELETE RESTRICT
D. ON DELETE SET NULL
E. ON DELETE PROPAGATE

(6/55)With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(7/55)For which of the following can locks be obtained?
(Select the correct response)
A. A trigger
B. A table view
C. A table column
D. A database buffer
E. A row referenced by an index key

(8/55)Given the statement:
CREATE TABLE t1 (c1 CHAR(1))
Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol
lowing command is issued:
ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')
Which of the following occurs?
(Select the correct response)
A. Rows with c1 values of b,c,d,e,f are deleted
B. Rows with c1 values of b,c,d,e,f have c1 set to NULL
C. The ALTER command will fail as rows violate the constraint
D. The ALTER command will move the violating rows to the exception table

(9/55)How many DB2 Administration Server (DAS) Instances can be set up per
physical machine?
(Select the correct response)
A. 0
B. 1
C. One for each instance on the physical machine
D. One for each database on the physical machine

(10/55)Which of the following is the result of a successful ROLLBACK statem
ent?
(Select the correct response)
A. Held locks are released
B. Release-pending conditions are undone
C. Tables in LOAD PENDING are released
D. Constraint checking conditions are undone
E. Existing database connections are released

(11/55)Which of the following is the most appropriate reason to consider re
voking the SELECT privilege on the catalog tables from PUBLIC after creating
a database?
(Select the correct response)
A. To prevent users from creating tables without proper authority.
B. Some system catalogs record user data in some columns, and this data may b
e confidential.
C. To prevent users from viewing passwords for other DB2 userids that DB2 sto
res in the catalog tables.
D. Some catalog tables are large, so preventing users from viewing them is a
good way to keep users from submitting long-running queries against the catal
ogs.

(12/55)When manually establishing communications from a Windows NT client t
hrough a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is
NOT required to catalog?
(Select the correct response)
A. The client.
B. The database on the DRDA server.
C. The Database Connection Service database.
D. The node where the DB2 Connect Gateway is.

(13/55)Which of the following will rebuild a package in the database from t
he existing catalog information?
(Select the correct response)
A. bind
B. rebind
C. update
D. rebuild

(14/55)A user has a numeric data column with a maximum value of 100,000. Wh
ich of the following data types will use the minimum amount of storage for th
e column?
(Select the correct response)
A. IDENTITY
B. BIGINT
C. INTEGER
D. SMALLINT
(15/55)Which of the following products can be used to perform a dictionary-
based search?
(Select the correct response)
A. Net.Data
B. XML Extender
C. AVI Extender
D. Text Extender

(16/55)Given the following transaction:
CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
INSERT INTO dwaine.mytab VALUES (1,2)
INSERT INTO dwaine.mytab VALUES (4,3)
ROLLBACK
Which of the following would be returned from the statement:
SELECT * FROM dwaine.mytab?

(Select the correct response)
A. COL1 COL2
-------------- -------------
0 Records selected
B. COL1 COL2
------ -------
1 2
1 records selected
C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.
D. COL1 COL2
------- --------
1 2
4 3
2 records selected

(17/55)Which of the following privileges is necessary to populate the table
with large amounts of data?
(Select the correct response)
A. LOAD
B. ALTER
C. UPDATE
D. IMPORT

(18/55)Given the following table with a primary key on empid:
Emp:
Empid Name
11 Joe Smith
23 Melanie Jones
30 Robert Bruce
49 Janice Baker
66 Mario Diaz
68 Maria Diaton
Give the following statement in an embedded SQL program bound with Repeatable
Read:
Select * from Emp where empid < 55
How many rows in the table will be locked after the statement is run?
(Select the correct response)
A. 0
B. 1
C. 4
D. 5
E. 6

(19/55)Given the following UPDATE statement:
UPDATE address2 SET housenumber_buildingname=
(SELECT buildingname FROM address1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which of the following describes the result of the statement?

(Select the correct response)
A. The statement will succeed.
B. The statement will fail because a subquery cannot exist in an UPDATE state
ment.
C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined
as primary keys.
D. The statement will succeed if the data retrieved from the subquery does no
t have duplicate values for ADDRESS1.ID.


(20/55)Given two embedded SQL programs and the following actions:
Pgm1 Pgm2
INSERT INTO mytab VALUES (...) DELETE FROM mytab
COMMIT ROLLBACK
DELETE FROM mytab INSERT INTO mytab VALUES (...)
ROLLBACK COMMIT
If there exists one (1) row in table mytab before the programs are executed c
oncurrently, how many records will be in the table once the programs complete
?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
E. 4

(21/55)Given the following embedded SQL programs:
Program 1:
CREATE TABLE mytab (col1 INT, col2 CHAR(24))
COMMIT
Program 2:
INSERT INTO mytab VALUES ( 20989,'Joe Smith')
INSERT INTO mytab VALUES ( 21334,'Amy Johnson')
COMMIT
DELETE FROM mytab
ROLLBACK
INSERT INTO mytab VALUES ( 23430,'Jason French')
ROLLBACK
INSERT INTO mytab VALUES ( 20993,'Samantha Jones')
COMMIT
DELETE FROM mytab WHERE col1=20993
ROLLBACK
Which of the following indicates the number of records that will be returned
by the statement:
SELECT * FROM mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
E. 4

(22/55)Which of the following DB2 components can limit the resource consump
tion of queries?
(Select the correct response)
A. DB2 Connect
B. DB2 Query Patroller
C. DB2 Performance Monitor
D. DB2 Net Search Extender

(23/55)Which of the following products must be installed to provide a singl
e point of control for local and remote DB2 databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Administration Client
C. DB2 Connect Enterprise Edition
D. DB2 Enterprise-Extended Edition

(24/55)Which of the following is possible once a user has been given mainte
nance authority?
(Select the correct response)
A. DB2 userids can be created.
B. Views can be created on the catalogs.
C. Statistics can be collected for database objects.
D. A table can be populated by using the LOAD command.

(25/55)Given the table T1, created by:
CREATE TABLE t1
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
c1 CHAR(3)
)
The following SQL statements are issued:
INSERT INTO t1 VALUES (1, 'ABC')
INSERT INTO t1 VALUES (5, 'DEF')
Which of the following values are inserted into the ID column by the followin
g statement?
INSERT INTO t1(c1) VALUES ('XYZ')
(Select the correct response)
A. 0
B. 1
C. 2
D. 5
E. 6

(26/55)Which of the following Control Center features can be used to update
information for the optimizer to choose the best path to data?
(Select the correct response)
A. Show Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table

(27/55)Which of the following tools allows the DBA to set limits, and be al
erted if these limits are exceeded?
(Select the correct response)
A. DB2 Index Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor

(28/55)Which of the following can be accomplished with a single UPDATE stat
ement?
(Select the correct response)
A. Updating multiple tables
B. Updating a view consisting of joined tables
C. Updating multiple tables based on a WHERE clause
D. Updating a table based on a sub-select using joined tables

(29/55)Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (c1 IN ('A01','B01','C01'))
)
DB2 verifies that the table check constraint is met during which of the follo
wing actions?
(Select the correct response)
A.   Adding data using load
B.   The reorg of the table
C.   The insert of each row in t1]
D.   The creation of the index for the table


(30/55)Given the following embedded SQL programs:
Program 1:
Create table mytab (col1 int, col2 char(24))
Commit
Program 2:
Insert into mytab values ( 20989,'Joe Smith')
Commit
Insert into mytab values ( 21334,'Amy Johnson')
Delete from mytab
Commit
Insert into mytab values ( 23430,'Jason French')
Rollback
Insert into mytab values ( 20993,'Samantha Jones')
Commit
Delete from mytab where col1=20993
Rollback
Which of the following records will be returned by the statement
SELECT * FROM mytab?
(Select the correct response)
A. 20989, Joe Smith
B. 21334, Amy Johnson
C. 23430, Jason French
D. 20993, Samantha Jones
E. No records are returned

(31/55)In which of the following locations are the referential constraints
stored?
(Select the correct response)
A. The user tables.
B. The explain tables.
C. SYSIBM.SYSTRIGGERS.
D. The system catalog tables.

(32/55)Which of the following SQL statements can remove all rows from a tab
le named COUNTRY?
(Select the correct response)
A. DELETE country
B. DELETE FROM country
C. DELETE * FROM country
D. DELETE ALL FROM country

(33/55)Given two embedded SQL program executions with the following actions
:
Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK

Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4

(34/55)With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a'
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(35/55)Given the table T1 created by:
CREATE TABLE t1
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
c1 CHAR(10) NOT NULL,
c2 CHAR(10)
)
Which of the following INSERT statements will succeed?
(Select the correct response)
A. INSERT INTO t1 VALUES (1, 'abc', NULL)
B. INSERT INTO t1 VALUES (1, NULL, 'def')
C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL)
D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def')

(36/55)Which of the following products can be used to generate Extensible M
arkup Language documents from DB2 tables?
(Select the correct response)
A.   Net Search
B.   XML Extender
C.   AVI Extender
D.   Text Extender

(37/55)Which of the following describes why savepoints are NOT allowed insi
de an atomic unit of work?
(Select the correct response)
A. Atomic units of work span multiple databases, but savepoints are limited t
o units of work which operate on a single database.
B. A savepoint implies that a subset of the work may be allowed to succeed, w
hile atomic operations must succeed or fail as a unit.
C. A savepoint requires an explicit commit to be released, and commit stateme
nts are not allowed in atomic operations such as compound SQL.
D. A savepoint cannot be created without an active connection to a database,
but atomic operations can contain a CONNECT as a sub-statement.

(38/55)Which of the following DB2 UDB isolation levels will NOT lock any ro
ws during read processing?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability

(39/55)For which of the following database objects can locks be obtained?
(Select the correct response)
A. View
B. Table
C. Trigger
D. Buffer Pool

(40/55)Which of the following utilities can examine a table and its indexes
and update the system catalogs with the table's statistical information?
(Select the correct response)
A. runstats
B. getstats
C. check index
D. chkstats

(41/55)Given the statement:
CREATE TABLE t1
(
c1 INTEGER NOT NULL,
c2 INTEGER,
PRIMARY KEY(c1),
FOREIGN KEY(c2) REFERENCES t2
)
How many non-unique indexes are defined for table t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(42/55)Given the following scenario: An application uses a 15 digit value t
o uniquely identify customer transactions. This number is also used for arith
metic operations. Which of the following is the most efficient DB2 data type
for the column definition for this purpose?
(Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. NUMERIC(15,2)
E. DECIMAL(15,0)

(43/55)Which of the following is NOT a valid data type on CREATE TABLE?
(Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
D. DATETIME

(44/55)The user USER1 is executing the statement
CREATE TABLE app1.table1 (col1 INT, col2 INT)
Which of the following privileges is required by USER1 for the statement to b
e successful?
(Select the correct response)
A. CREATEIN for the database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. CREATEIN for the table table1

(45/55)Which of the following Control Center options shows the dependencies
between a specific view and its tables?
(Select the correct response)
A. Show SQL
B. Show Related
C. Sample Contents
D. Customize Columns

(46/55)Which of the following occurs if an application ends abnormally duri
ng an active unit of work?
(Select the correct response)
A. Current unit of work is committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. Current unit of work moves to pending state
(47/55)Which of the following can occur once connected to a database or DRD
A server with an explicit authorization name?
(Select the correct response)
A. Omit a user's password.
B. Change a user's password if the server supports this function.
C. Omit the name of the database or DRDA server if it is local.
D. Use the commit option on the connect statement to commit in-doubt units of
work from a previous connection that was terminated.

(48/55)Which of the following tasks can be performed using the ALTER TABLES
PACE statement?
(Select the correct response)
A. Assign a bufferpool.
B. Change the table space name.
C. Change the type of the table space.
D. Change the page size of the table space.

(49/55)For a clustering index to be effective in keeping the data in order,
which of the following parameters must be set correctly for the index?
(Select the correct response)
A. FREE ROWS
B. PERCENT FREE
C. CLUSTERRATIO
D. CLUSTER FACTOR

(50/55)Which of the following CANNOT be used to restrict specific values fr
om being inserted into a column in a particular table?
(Select the correct response)
A. view
B. index
C. check constraint
D. referential constraint

(51/55)Given an embedded SQL program with a single connection, two threads
and the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
How many records will be successfully inserted into the table mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(52/55)Given a table T1, with a column C1 char(3), that contains strings in
upper and lower case letters, which of the following queries will find all r
ows where C1 is the string 'ABC' in any case?
(Select the correct response)
A. SELECT * FROM t1 WHERE c1 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC')
D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE

(53/55)Given an embedded SQL program with a single connection, two threads
and the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
How many records will be successfully inserted into the table mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(54/55)If a DB2 Warehouse Manager toolkit is selected during the installati
on of DB2 UDB Version 7.1, which of the following databases must be defined?

(Select the correct response)
A. None
B. Target Database
C. Source Database
D. Control Database

(55/55)User2 has DBADM authority on database DB1. This allows the user to d
o which of the following?
(Select the correct response)
A. Drop database DB1
B. Backup database DB1
C. Create tables in any database
D. Create tables in database DB1

****************************************************************



自测题 9


--------------------------------------------------------------------------------
(1/55)Given the following:
TAB1 TAB2
C1 C2 CX CY
---- ---- ----- -----
A 11 A 21
B 12 B 22
C 13 C 23
The following results are desired:
C1 C2 CX CY
---- ---- ---- -----
A 11 A 21
B 12 ----- -----
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx

(2/55)Which of the following SQL statements can remove all rows from a tabl
e named COUNTRY?
(Select the correct response)
A. DELETE country
B. DELETE FROM country
C. DELETE * FROM country
D. DELETE ALL FROM country

(3/55)When establishing client-server communication, passwords CANNOT be ve
rified by:
(Select the correct response)
A. The DRDA DB2 server.
B. The client operating system.
C. The gateway operating system.
D. Looking in the catalog tables for the password.

(4/55)Which of the following occurs if an application ends abnormally durin
g an active unit of work?
(Select the correct response)
A. Current unit of work is committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. Current unit of work moves to pending state

(5/55)Which of the following Control Center features can be used to update
information for the optimizer to choose the best path to data?
(Select the correct response)
A. Show Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table

(6/55)When granted to user1, which of the following will allow user1 to ONL
Y access table data?
(Select the correct response)
A. DBADM authority
B. SYSADM authority
C. SELECT privilege on the table
D. SELECT privilege WITH GRANT OPTION on the table

(7/55)With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a'
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(8/55)Given a table T1, with a column C1 char(3), that contains strings in
upper and lower case letters, which of the following queries will find all ro
ws where C1 is the string 'ABC' in any case?
(Select the correct response)
A. SELECT * FROM t1 WHERE c1 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC')
D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE

(9/55)Given an embedded SQL program with a single connection, two threads a
nd the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
How many records will be successfully inserted into the table mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(10/55)Which of the following describes why savepoints are NOT allowed insi
de an atomic unit of work?
(Select the correct response)
A. Atomic units of work span multiple databases, but savepoints are limited
to units of work which operate on a single database.
B. A savepoint implies that a subset of the work may be allowed to succeed,
while atomic operations must succeed or fail as a unit.
C. A savepoint requires an explicit commit to be released, and commit statem
ents are not allowed in atomic operations such as compound SQL.
D. A savepoint cannot be created without an active connection to a database,
but atomic operations can contain a CONNECT as a sub-statement.

(11/55)Given the following DDL statement:
CREATE TABLE newtab1 LIKE tab1
Which of the following would occur as a result of the statement execution?
(Select the correct response)
A. NEWTAB1 has same triggers as TAB1
B. NEWTAB1 is populated with TAB1 data
C. NEWTAB1 has the same primary key as TAB1
D. NEWTAB1 columns have same attributes as TAB1

(12/55)The DB2 Administration Server (DAS) is required for which of the fol
lowing?
(Select the correct response)
A. For the administrator user id to install or remove DB2
B. For the remote clients to use the Control Center against the instance
C. For checking authorities in the database manager configuration for SYSADM
D. For maintaining authorities added and removed by the SQL GRANT and REVOKE
commands respectively

(13/55)Which of the following types of DB2 locks allows for the most concur
rency within a table?
(Select the correct response)
A. A row lock
B. A page lock
C. A field lock
D. A column lock

(14/55)Which of the following is NOT a valid data type on CREATE TABLE?
(Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
D. DATETIME

(15/55)Which of the following utilities can examine a table and its indexes
and update the system catalogs with the table's statistical information?
(Select the correct response)
A. runstats
B. getstats
C. check index
D. chkstats

(16/55)Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, the list should not change.

Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

(17/55)Which of the following Control Center options shows the dependencies
between a specific view and its tables?
(Select the correct response)
A. Show SQL
B. Show Related
C. Sample Contents
D. Customize Columns

(18/55)Given the following table definition:
STAFF
Id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary DECIMAL(10,2)
comm. DECIMAL(10,2)
Which of the following SQL statements will return the total number of employe
es in each department and the corresponding department id under the following
conditions:
Only return departments with at least one employee receiving a commission gre
ater than 5000. The result should be sorted by the department count from most
to least.
(Select the correct response)
A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER B
Y 2 DESC
B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER B
Y 2 DESC
C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm OR
DER BY 2 DESC
D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept,
comm ORDER BY 3 DESC
(19/55)For which of the following database objects can locks be obtained?
(Select the correct response)
A. View
B. Table
C. Trigger
D. Buffer Pool

(20/55)Given the tables:
COUNTRY
ID NAME PERSON CITYES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 3 10
4 Germany 1 0
5 Germany 7 5

STAFF
ID LASTNAME
1 Jones
2 Smiths
The statement:
SELECT * FROM staff, country
will return how many rows?
(Select the correct response)
A. 2
B. 4
C. 5
D. 7
E. 10

(21/55)A user creates the table TABLE1. Which of the following statements w
ould explicitly give USER1 the ability to read rows from the table?
(Select the correct response)
A. GRANT VIEW TO user1 ON TABLE table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. GRANT ACCESS ON TABLE table1 TO user1

(22/55)Which of the following tools can be used to identify inefficient SQL
statements without executing the query?
(Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. Performance Monitor

(23/55)Which of the following describes when indexes can be explicitly refe
renced by name within an SQL statement?
(Select   the correct response)
A. When   dropping the index
B. When   updating the index
C. When   selecting on the index
D. When   inserting using the index

(24/55) For a clustering index to be effective in keeping the data in order
, which of the following parameters must be set correctly for the index?
(Select the correct response)
A. FREE ROWS
B. PERCENT FREE
C. CLUSTERRATIO
D. CLUSTER FACTOR

(25/55) The user USER1 is executing the statement
CREATE TABLE app1.table1 (col1 INT, col2 INT)
Which of the following privileges is required by USER1 for the statement to b
e successful?
(Select the correct response)
A. CREATEIN for the database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. CREATEIN for the table table1

(26/55) Given the statement:
CREATE TABLE t1
(
c1 INTEGER NOT NULL,
c2 INTEGER,
PRIMARY KEY(c1),
FOREIGN KEY(c2) REFERENCES t2
)
How many non-unique indexes are defined for table t1?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3

(27/55) To set up a client that can access DB2 UDB through DB2 Connect Ente
rprise Edition, which of the following is the minimum software client that mu
st be installed?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client

(28/55)Which of the following CANNOT be used to restrict specific values fr
om being inserted into a column in a particular table?
(Select the correct response)
A. view
B. index
C. check constraint
D. referential constraint

(29/55) Which of the following can be accomplished with a single UPDATE sta
tement?
(Select the correct response)
A. Updating multiple tables
B. Updating a view consisting of joined tables
C. Updating multiple tables based on a WHERE clause
D. Updating a table based on a sub-select using joined tables

(30/55)User2 has DBADM authority on database DB1. This allows the user to d
o which of the following?
(Select the correct response)
A. Drop database DB1
B. Backup database DB1
C. Create tables in any database
D. Create tables in database DB1

(31/55)Given the two following tables:
Names
Names Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13

POINTS
Names Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
Joe Sakic 94

Which of the following statements will display the player's Names, numbers an
d points for all players with an entry in both tables?
(Select the correct response)
A. SELECT names.names, names.number, points.points FROM names INNER JOIN poin
ts ON names.name=points.name
B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN
points ON names.name=points.name
C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN
points ON names.name=points.name
D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN
points ON names.name=points.name

(32/55) Which of the following can occur once connected to a database or DR
DA server with an explicit authorization name?
(Select the correct response)
A. Omit a user's password.
B. Change a user's password if the server supports this function.
C. Omit the name of the database or DRDA server if it is local.
D. Use the commit option on the connect statement to commit in-doubt units of
work from a previous connection that was terminated.

(33/55)Which of the following DB2 components allows the analysis of multidi
mensional databases?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Control Center
C. DB2 OLAP Starter Kit
D. DB2 Spatial Extender
E. DB2 Performance Monitor

(34/55)Which of the following DB2 UDB isolation levels will NOT lock any ro
ws during read processing?
(Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability

(35/55)Which of the following authorities should be given to the DB2 Admini
stration Server (DAS) Instance owner at the administered instance?
(Select the correct response)
A. DBADM
B. SYSADM
C. SYSCTRL
D. SYSMAINT

(36/55)Which of the following products can be used to generate Extensible M
arkup Language documents from DB2 tables?
(Select the correct response)
A. Net Search
B. XML Extender
C. AVI Extender
D. Text Extender

(37/55)Which of the following processing can occur for a unit of work using
an isolation level of Read Stability and scanning through the table more tha
n once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. Rows changed in a result set by other processes from one scan to the next

(38/55)Which two of the following SQL data types should be used to store bi
nary data?
(Select all that apply)
A. CLOB
B. BLOB
C. VARCHAR
D. GRAPHIC
E. VARCHAR FOR BIT DATA

(39/55) Given an application bound with cursor stability which will be upda
ting rows in a table and obtaining row locks, which of the following table lo
cks will DB2 acquire for the application first?
(Select the correct response)
A. U – update
B. X – exclusive
C. IU - intent update
D. IX - intent exclusive

(40/55)Which of the following is the result of the following SQL statement:

ALTER TABLE table1 ADD col2 INT WITH DEFAULT

(Select the correct response)
A. The statement fails with a negative SQL code.
B. The statement fails because no default value is specified.
C. A new column called COL2 is added to TABLE1 and populated with zeros.
D. A new column called COL2 is added to TABLE1 and populated with nulls.
E. A new column called COL2, which cannot contain nulls, is added to TABLE1.

(41/55)In which of the following locations are the referential constraints
stored?
(Select the correct response)
A. The user tables.
B. The explain tables.
C. SYSIBM.SYSTRIGGERS.
D. The system catalog tables.
(42/55)If a DB2 Warehouse Manager toolkit is selected during the installati
on of DB2 UDB Version 7.1, which of the following databases must be defined?

(Select the correct response)
A. None
B. Target Database
C. Source Database
D. Control Database

(43/55)Given the two following 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(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm DECIMAL(10,2)
Which of the following statements will display each department, by name, and
the total salary of all employees in the department?
(Select the correct response)
A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt ORDER BY a.deptname
B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt ORDER BY a.deptname
C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt GROUP BY a.deptname
D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
pt GROUP BY a.deptname

(44/55)Given the following scenario: An application uses a 15 digit value t
o uniquely identify customer transactions. This number is also used for arith
metic operations. Which of the following is the most efficient DB2 data type
for the column definition for this purpose?
(Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. NUMERIC(15,2)]
E. DECIMAL(15,0)

(45/55)Which of the following tools allows the DBA to set limits, and be al
erted if these limits are exceeded?
(Select the correct response)
A. DB2 Index Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor

(46/55) Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (c1 IN ('A01','B01','C01'))
)
DB2 verifies that the table check constraint is met during which of the follo
wing actions?
(Select the correct response)
A. Adding data using load
B. The reorg of the table
C. The insert of each row in t1
D. The creation of the index for the table

(47/55)Given the following SQL statements:
CREATE TABLE tab1 (col1 INT)
CREATE TABLE tab2 (col1 INT)
INSERT INTO tab1 VALUES (NULL),(1)
INSERT INTO tab2 VALUES (NULL),(1)
SELECT COUNT(*) FROM tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
E. 0

(48/55)Given two embedded SQL program executions with the following actions
:
Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK

Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4

(49/55)Given the table T1 created by:
CREATE TABLE t1
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,
c1 CHAR(10) NOT NULL,
c2 CHAR(10)
)
Which of the following INSERT statements will succeed?
(Select the correct response)
A. INSERT INTO t1 VALUES (1, 'abc', NULL)
B. INSERT INTO t1 VALUES (1, NULL, 'def')
C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL)
D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def')

(50/55)Which of the following tasks can be performed using the ALTER TABLES
PACE statement?
(Select the correct response)
A. Assign a bufferpool.
B. Change the table space name.
C. Change the type of the table space.
D. Change the page size of the table space.

(51/55)A view is used instead of a table for users to do which of the follo
wing?
(Select the correct response)
A. Avoid allocating more disk space per database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
D. Avoid allocating frequently used query result tables

(52/55)Given the following table definitions:
DEPARTMENT
Deptno CHAR(3)
Deptno CHAR(30)
Mgrno INTEGER
Admrdept CHAR(3)

EMPLOYEE
Empno INTEGER
Firstname CHAR(30)
Midinit CHAR
Lastname CHAR(30)
Workdept CHAR(3)
Which of the following statements will list the employee's employee number, l
ast name, and department name ONLY for those employees who have a department?
(Select the correct response)
A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE
e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep
artment d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep
artment d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de
partment d WHERE e.workdept = d.deptno

(53/55)A table called EMPLOYEE has columns: name, department, and phone_num
ber. Which of the following can limit access to the phone_number column?
(Select the correct response)
A. Using a view to access the table
B. Using an index on the column
C. Using a referential constraint on the table
D. Using a table check constraint on the table
E. Revoking access from the phone_number column

(54/55)Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, it should only change if another agent unassigns a currently assigned sea
t.
Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

(55/55)Given table EMPLOYEE with columns EMPNO and SALARY and table JOB wit
h columns ID and TITLE, what is the effect of the statement:
UPDATE employee SET salary = salary * 1.15
WHERE salary < 15000 OR
EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr'
)
(Select the correct response)
A. Only managers that make less than 15,000 are given salary increases.
B. Only non-managers that make less than 15,000 are given salaray increases.
C. Employees that make less than 15,000 but no managers are given salary incr
eases.
D. Employees that make less than 15,000 and all managers are given salary inc
reases.

***************************************************



自测题 10


--------------------------------------------------------------------------------

1. With DBADM authority on the database and given the statements:
CREATE TABLE t1 (c1 CHAR(1))
INSERT INTO t1 VALUES ('b')
CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION
INSERT INTO v1 VALUES ('a')
INSERT INTO v1 VALUES ('b')
How many rows would be returned from the statement, SELECT c1 FROM t1?
(Select the correct response)
A.0
B.1
C.2
D.3

2. Which of the following statements will create an index and prevent table T
1 from containing two or more rows with the same values for column C1?
(Select the correct response)
A. CREATE UNIQUE INDEX ix4 ON t1 (c1)
B. CREATE DISTINCT INDEX ix1 ON t1 (c1)
C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)
D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)

3. A user has a numeric data column with a maximum value of 100,000. Which of
the following data types will use the minimum amount of storage for the colu
mn?
(Select the correct response)
A. IDENTITY
B. BIGINT
C. INTEGER
D. SMALLINT

4. Given the table T1, created by:
CREATE TABLE t1
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
c1 CHAR(3)
)
The following SQL statements are issued:
INSERT INTO t1 VALUES (1, 'ABC')
INSERT INTO t1 VALUES (5, 'DEF')
Which of the following values are inserted into the ID column by the followin
g statement?
INSERT INTO t1(c1) VALUES ('XYZ')
(Select the correct response)
A.0
B.1
C.2
D.5
E.6

5. Which of the following is the implicit qualifier for a declared temporary
table?
(Select the correct response)
A. The schema name SYSCAT.
B. The schema name SESSION.
C. The schema name TEMPUSER.
D. The userid specified with the BIND command.
E. The userid who established the connection to the database and declared the
temporary table.

6. Which of the following is the best way to restrict user access to a subset
of columns in a table?
(Select the correct response)
A. Only grant access to the columns within a table that a user is allowed to
see.
B. Create a view that only includes the columns a user is allowed to see. Gra
nt the user access to the view, not the base table.
C. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a join when all data must be
presented.
D. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a union when all data must be
presented.

7. Which of the following is the result of a successful ROLLBACK statement?
(Select the correct response)
A. Held locks are released
B. Release-pending conditions are undone
C. Tables in LOAD PENDING are released
D. Constraint checking conditions are undone
E. Existing database connections are released

8. Which two of the following modes can be used on the lock table statement?
(Select all that apply)
A. SHARE MODE
B. EXCLUSIVE MODE
C. REPEATABLE READ MODE
D. UNCOMMITTED READ MODE
E. INTENT EXCLUSIVE MODE

9. Which of the following must be set up to allow the Control Center to view
database objects?
(Select the correct response)
A. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant

10. Which of the following tools maintains a history of all executed statemen
ts/commands for the current session within the tool?
(Select the correct response)
A. Journal
B. SQL Assist
C. DB2 Alert Center
D. DB2 Command Center

11. Given the two following tables:
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189

PIM
Name PIM
Mats Sundin 14
Jaromir Jagr 18
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, points and
PIM for all players?
(Select the correct response)
A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI
N pim ON points.name=pim.name
B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE
R JOIN pim ON points.name=pim.name
C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTE
R JOIN pim ON points.name=pim.name
D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT
ER JOIN pim ON points.name=pim.name

12. Given the following:
TAB1 TAB2
C1 C2 CX CY
--- --- --- ---
A 11 A 21
B 12 C 22
C 13 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 joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=c0078
B. SELECT * FROM tab1 INNER 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

13. Given two embedded SQL programs and the following actions:
Pgm1 Pgm2
INSERT INTO mytab VALUES (...) DELETE FROM mytab
COMMIT ROLLBACK
DELETE FROM mytab INSERT INTO mytab VALUES (...)
ROLLBACK COMMIT
If there exists one (1) row in table mytab before the programs are executed c
oncurrently, how many records will be in the table once the programs complete
?
(Select the correct response)
A.0
B.1
C.2
D.3
E.4

14 Which of the following DB2 data types is used to store 50 MB of binary dat
a as a single value?
(Select the correct response)
A. BLOB
B. CLOB
C. DBCLOB
D. FOR BIT DATA
E. VARCHAR FOR BIT DATA
15. Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following statements will return all of the records ordered by j
ob with the salaries in descending order?
(Select the correct response
A. SELECT * FROM staff ORDER BY salary DESC, job
B. SELECT * FROM staff GROUP BY salary DESC, job
C. SELECT * FROM staff ORDER BY job, salary DESC
D. SELECT * FROM staff GROUP BY job, salary DESC

16. Given the following table definitions
DEPARTMENT
Deptno CHAR(3)
Deptname CHAR(30)
Mgrno INTEGER
Admrdept CHAR(3)

EMPLOYEE
Empno INTEGER
Firstname CHAR(30)
Midinit CHAR
Lastname CHAR(30)
Workdept CHAR(3)
Which of the following statements will list the employee's employee number, l
ast name, and department name ONLY for those employees who have a department?
A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE
e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep
artment d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep
artment d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de
partment d WHERE e.workdept = d.deptno

17. Given the statement:
CREATE TABLE t1 (c1 CHAR(1))
Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol
lowing command is issued:
ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')
Which of the following occurs?
(Select the correct response)
A.   Rows with   c1 values of   b,c,d,e,f are deleted
B.   Rows with   c1 values of   b,c,d,e,f have c1 set to NULL
C.   The ALTER   command will   fail as rows violate the constraint
D.   The ALTER   command will   move the violating rows to the exception table

18. Given the following table structure:
table1
emp_num INT NOT NULL PRIMARY KEY
emp_fname CHAR(30) NOT NULL
emp_lname CHAR(30) NOT NULL
emp_addr CHAR(60) NOT NULL
emp_pin CHAR(10) NOT NULL
Which of the following columns can be referenced by a foreign key clause from
another table?
(Select the correct response)
A. emp_num
B. emp_pin
C. emp_addr
D. emp_fname
E. emp_lname

19. Which of the following products can be used to perform a dictionary-based
search?
(Select the correct response)
A. Net.Data
B. XML Extender
C. AVI Extender
D. Text Extender

20. Which of the following DB2 components can limit the resource consumption
of queries?
(Select the correct response)
A. DB2 Connect
B. DB2 Query Patroller
C. DB2 Performance Monitor
D. DB2 Net Search Extender

21. Given the table:
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
Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?
(Select the   correct response)
A. ORDER BY   2,1
B. GROUP BY   2, 1
C. ORDER BY   cities, name
D. GROUP BY   cities, name

22. Which of the following will rebuild a package in the database from the ex
isting catalog information?
(Select the correct response)
A. bind
B. rebind
C. update
D. rebuild

23. Given the following column requirements:
Col1 Numeric Identifier - From 1 to 1000000
Col2 Job Code - Variable, 1 to 2 characters long
Col3 Job Description - Variable, 1 to 100 characters long
Col4 Job Length - Length of Job in seconds
Which of the following will minimize the disk space allocated to store the re
cords if Job Description has an average length of 45?
(Select the correct response)
A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT)
B. B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT)
C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT)
D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT)

24. Given the following UPDATE statement:
UPDATE address2 SET housenumber_buildingname=
(SELECT buildingname FROM address1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which of the following describes the result of the statement?
(Select the correct response)
A. The statement will succeed.
B. The statement will fail because a subquery cannot exist in an UPDATE state
ment.
C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined
as primary keys.
D. The statement will succeed if the data retrieved from the subquery does no
t have duplicate values for ADDRESS1.ID.

25. Which of the following processing can occur for a unit of work using an i
solation level of Cursor Stability and allows scanning through the table more
than once within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Have updated result set rows changed by other processes from one scan to t
he next
D. Have accessed result set rows changed by other processes from one scan to
the next

26. How many DB2 Administration Server (DAS) Instances can be set up per phys
ical machine?
(Select the correct response)
A.0
B.1
C. One for each instance on the physical machine
D. One for each database on the physical machine

27. A table called EMPLOYEE has columns: name, department, and phone_number.
Which of the following can limit access to the phone_number column?
(Select the correct response)
A. Using a view to access the table
B. Using an index on the column
C. Using a referential constraint on the table
D. Using a table check constraint on the table
E. Revoking access from the phone_number column

28. Given the following transaction:
CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
INSERT INTO dwaine.mytab VALUES (1,2)
INSERT INTO dwaine.mytab VALUES (4,3)
ROLLBACK
Which of the following would be returned from the statement:
SELECT * FROM dwaine.mytab?
(Select the correct response)
A. COL1 COL2
----------- -----------
0 record(s) selected.
B. COL1 COL2
----------- -----------
1 2
1 record(s) selected.

C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.
D. COL1 COL2
----------- -----------
1 2
4 3

29. Given the table definition:
CREATE TABLE student (name CHAR(30), age INTEGER)
To list the names of the 10 youngest students, which of the following index d
efinition statements on the student table may improve the query performance?

(Select the correct response)
A.   CREATE   INDEX   youngest   ON   student   (age, name)
B.   CREATE   INDEX   youngest   ON   student   (name, age)
C.   CREATE   INDEX   youngest   ON   student   (name, age DESC)
D.   CREATE   INDEX   youngest   ON   student   (name DESC) INCLUDE (age)

30. Which of the following privileges is necessary to populate the table with
large amounts of data?
(Select the correct response)
A. LOAD
B. ALTER
C. UPDATE
D. IMPORT

31. Which of the following DB2 CLP options specify the file that contains the
statements to be executed?
(Select the correct response)
A. –f
B.-b
C.-o
D.-w

32. Given the following table with a primary key on empid:
Emp:
Empid Name
11 Joe Smith
23 Melanie Jones
30 Robert Bruce
49 Janice Baker
66 Mario Diaz
68 Maria Diaton
Give the following statement in an embedded SQL program bound with Repeatable
Read:
Select * from Emp where empid < 55
How many rows in the table will be locked after the statement is run?
A.0
B.1
C.4
D.5
E.6

33. Given table T1 with 100 rows, which of the following queries will retriev
e 10 rows from table T1?
(Select the correct response)
A. SELECT * FROM t1 MAXIMUM 10 ROWS
B. SELECT * FROM t1 READ 10 ROWS ONLY
C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS
D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY

34. Which of the following DELETE RULES on CREATE TABLE will delete a depende
nt table row if the parent table row is deleted?
(Select the correct response
A. ON DELETE REMOVE
B. ON DELETE CASCADE
C. ON DELETE RESTRICT
D. ON DELETE SET NULL
E. ON DELETE PROPAGATE

35. Which of the following isolation levels will lock only the rows returned
in the result set?
A. Read Stability
B. Repeatable Read
C. Cursor Stability
D. Uncommitted Read

36. Using the Control Center Create Table dialog box, which of the following
dialogs allows the table creation DDL to be viewed?
(Select the correct response
A. Copy
B. Show SQL
C. Show Related
D. Sample Contents

37. Which of the following does NOT end a unit of work?
(Select the correct response)
A. COMMIT
B. ROLLBACK
C. TERMINATE
D. SAVEPOINT
E. CONNECT RESET

38. Given the following embedded SQL programs:
Program 1:
CREATE TABLE mytab (col1 INT, col2 CHAR(24))
COMMIT
Program 2:
INSERT INTO mytab VALUES ( 20989,'Joe Smith')
INSERT INTO mytab VALUES ( 21334,'Amy Johnson')
COMMIT
DELETE FROM mytab
ROLLBACK
INSERT INTO mytab VALUES ( 23430,'Jason French')
ROLLBACK
INSERT INTO mytab VALUES ( 20993,'Samantha Jones')
COMMIT
DELETE FROM mytab WHERE col1=20993
ROLLBACK
Which of the following indicates the number of records that will be returned
by the statement:
SELECT * FROM mytab?
(Select the correct response)
A.0
B.1
C.2
D.3
E.4

39. Given an embedded SQL program with a single connection, two threads and t
he following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table myta
b?
(Select the correct response)
A.0
B.1
C.2
D.3

40. Which two of the following types of storage management method is supporte
d by DB2 OLAP Server ?
(Select all that apply)
A. Object
B. Network
C. Relational
D. Hierachical
E. Multi-dimensional

41. Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with col
umns ID and TITLE, what is the effect of the statement:
UPDATE employee SET salary = salary * 1.15
WHERE salary < 15000 OR
EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr'
)
(Select the correct response)
A. Only managers that make less than 15,000 are given salary increases.
B. Only non-managers that make less than 15,000 are given salaray increases.
C. Employees that make less than 15,000 but no managers are given salary incr
eases.
D. Employees that make less than 15,000 and all managers are given salary inc
reases.

42. When manually establishing communications from a Windows NT client throug
h a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT
required to catalog?
(Select the correct response
A. The client.
B. The database on the DRDA server.
C. The Database Connection Service database.
D. The node where the DB2 Connect Gateway is.

43. Which of the following is the most appropriate reason to consider revokin
g the SELECT privilege on the catalog tables from PUBLIC after creating a dat
abase?
(Select the correct response
A. To prevent users from creating tables without proper authority.
B. Some system catalogs record user data in some columns, and this data may b
e confidential.
C. To prevent users from viewing passwords for other DB2 userids that DB2 sto
res in the catalog tables.
D. Some catalog tables are large, so preventing users from viewing them is a
good way to keep users from submitting long-running queries against the catal
ogs.

44. For which of the following can locks be obtained?
(Select the correct response)
A. A trigger
B. A table view
C. A table column
D. A database buffer
E. A row referenced by an index key

45. With tables defined as:
Table1
col1 INT
col2 CHAR(30)

Table2
col1 INT
col2 CHAR(30)
Which of the following statements will insert all the rows in TABLE2 into TAB
LE1?
(Select the correct response)
A. INSERT INTO table1 SELECT col1, col2 FROM table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. INSERT INTO table1 VALUES (table2.col1, table2.col2)
D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)
E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)

47. Which of the following products must be installed to provide a single poi
nt of control for local and remote DB2 databases?
(Select the correct response
A. DB2 Runtime Client
B. DB2 Administration Client
C. DB2 Connect Enterprise Edition
D. DB2 Enterprise-Extended Edition

48. Which one of the following SQL statements sets the default qualifier to "
user1"?
(Select the correct response)
A. SET CURRENT ID = 'user1'
B. SET CURRENT USER = 'user1'
C. SET CURRENT SQLID = 'user1'
D. SET CURRENT QUALIFIER = 'user1'

49. Which of the following can be used to determine the views that are affect
ed by a DROP TABLE statement?
(Select the correct response)
A. DB2 Script Center
B. DB2 Performance Monitor
C DB2 Control Center, Show Related
D. DB2 Control Center, Sample Contents

50. A view is used instead of a table for users to do which of the following?

(Select the correct response)
A. Avoid allocating more disk space per database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
D. Avoid allocating frequently used query result tables

51. Which of the following processing can occur for a unit of work using an i
solation level of Read Stability and scanning through the table more than onc
e within the unit of work?
(Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. Rows changed in a result set by other processes from one scan to the next

52. Given the tables:
TABLEA TABLEB
Empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 1000.00
TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
CONSTRAINT const1 FOREIGN KEY (empid)
REFERENCES tablea (empid) ON DELETE SET NULL)
How many rows would be deleted from tableb if the following command is issued
:
DELETE FROM tablea WHERE empid = '2'?
(Select the correct response)
A.0
B.1
C.2
D.3

53. To set up a client that can access DB2 UDB through DB2 Connect Enterprise
Edition, which of the following is the minimum software client that must be
installed?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client

54. Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following statements will return all of the records ordered by j
ob with the salaries in descending order?
(Select the correct response
E. SELECT * FROM staff ORDER BY salary DESC, job
F. SELECT * FROM staff GROUP BY salary DESC, job
G. SELECT * FROM staff ORDER BY job, salary DESC
H. SELECT * FROM staff GROUP BY job, salary DESC

55. Given the table:
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
Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?

(Select the   correct response)
E. ORDER BY   2,1
F. GROUP BY   2, 1
G. ORDER BY   cities, name
H. GROUP BY cities, name

********************************************************



自测题 11


--------------------------------------------------------------------------------

1. Which of the following is the result of the following SQL statement:
CREATE UNIQUE INDEX empno_ind ON employee (empno)
(Select the correct response)
A. Every value for EMPNO must be unique.
B. UPDATE statements on EMPNO will be rolled back.
C. Insert statements on EMPNO will always be faster.
D. Insert statements on the EMPNO table will result in clustered data.

2. Which of the following will rebuild a package in the database from the exi
sting catalog information?
(Select the correct response)
A. bind
B. rebind
C. update
D. rebuild

3. Why is a unique index not sufficient for creation of a primary key?
(Select the correct response)
A. It is sufficient - a primary key is the same thing as a unique index.
B. Unique indexes can be defined in ascending or descending order. Primary k
eys must be ascending.
C. A unique index can be defined over a column or columns that allow nulls. P
rimary keys cannot contain nulls.
D. A unique index can be defined over a column or columns that allow nulls. T
his is not allowed for primary keys because foreign keys cannot contain nulls
.

4. Which of the following statements will create an index and prevent table T
1 from containing two or more rows with the same values for column C1?
(Select the correct response)
A. CREATE UNIQUE INDEX ix4 ON t1 (c1)
B. CREATE DISTINCT INDEX ix1 ON t1 (c1)
C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)
D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)

5. Which of the following DB2 data types is used to store 50 MB of binary dat
a as a single value?
(Select the correct response)
A. BLOB
B. CLOB
C. DBCLOB
D. FOR BIT DATA
E. VARCHAR FOR BIT DATA

6. Given the following UPDATE statement:
UPDATE address2 SET housenumber_buildingname=
(SELECT buildingname FROM address1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which of the following describes the result of the statement?
(Select the correct response)
A. The statement will succeed.
B. The statement will fail because a subquery cannot exist in an UPDATE state
ment.
C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined
as primary keys.
D. The statement will succeed if the data retrieved from the subquery does no
t have duplicate values for ADDRESS1.ID.

7. Which two of the following types of storage management method is supported
by DB2 OLAP Server ?
(Select all that apply)
A. Object
B. Network
C. Relational
D. Hierachical
E. Multi-dimensional

8. Given the table:
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
Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?

(Select the   correct response)
A. ORDER BY   2,1
B. GROUP BY   2, 1
C. ORDER BY   cities, name
D. GROUP BY   cities, name
9. A view is used instead of a table for users to do which of the following?

(Select the correct response)
A. Avoid allocating more disk space per database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
D. Avoid allocating frequently used query result tables

10. Which of the following must be set up to allow the Control Center to view
database objects?
(Select the correct response)
A. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant

11. Which of the following does NOT end a unit of work?
(Select the correct response)
A. COMMIT
B. ROLLBACK
C. TERMINATE
D. SAVEPOINT
E. CONNECT RESET

12. Given the statement:
CREATE TABLE t1 (c1 CHAR(1))
Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol
lowing command is issued:
ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')
Which of the following occurs?
(Select the correct response)
A. Rows with c1 values of b,c,d,e,f are deleted
B. Rows with c1 values of b,c,d,e,f have c1 set to NULL
C. The ALTER command will fail as rows violate the constraint
D. The ALTER command will move the violating rows to the exception table

13. Which of the following DB2 CLP options specify the file that contains the
statements to be executed?
(Select the correct response)
A. –f
B. –b
C. –o
D. –w

14. Which of the following is the best way to restrict user access to a subse
t of columns in a table?
(Select the correct response)
A. Only grant access to the columns within a table that a user is allowed to
see.
B. Create a view that only includes the columns a user is allowed to see. Gra
nt the user access to the view, not the base table.
C. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a join when all data must be
presented.
D. Create two tables: one with the columns that a user is allowed to see, and
one that has the confidential columns, and use a union when all data must be
presented.

15. Given the following embedded SQL programs:
Program 1:
CREATE TABLE mytab (col1 INT, col2 CHAR(24))
COMMIT
Program 2:
INSERT INTO mytab VALUES ( 20989,'Joe Smith')
INSERT INTO mytab VALUES ( 21334,'Amy Johnson')
COMMIT
DELETE FROM mytab
ROLLBACK
INSERT INTO mytab VALUES ( 23430,'Jason French')
ROLLBACK
INSERT INTO mytab VALUES ( 20993,'Samantha Jones')
COMMIT
DELETE FROM mytab WHERE col1=20993
ROLLBACK
Which of the following indicates the number of records that will be returned
by the statement:
SELECT * FROM mytab?
(Select the correct response)
A..
B.1
C.2
D.3
E.4

16. When manually establishing communications from a Windows NT client throug
h a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT
required to catalog?
(Select the correct response)
A. The client.
B. The database on the DRDA server.
C. The Database Connection Service database.
D. The node where the DB2 Connect Gateway is.

17. Which of the following products can be used to perform a dictionary-based
search?
(Select the correct response)
A. Net.Data
B. XML Extender
C. AVI Extender
D. Text Extender

18. Given the following DDL statements,
CREATE TABLE t1 (a INT, b INT, c INT)
CREATE VIEW v1 AS SELECT a, b, c FROM t1
WHERE a > 250
WITH CHECK OPTION
Which of the following INSERT statements will fail?
(Select the correct response)
A. INSERT INTO t1 VALUES (200, 2, 3)
B. INSERT INTO v1 VALUES (200, 2, 3)
C. INSERT INTO t1 VALUES (300, 2, 3)
D. INSERT INTO v1 VALUES (300, 2, 3)

19. Given the two following tables:
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189

PIM
Name PIM
Mats Sundin 14
Jaromir Jagr 18
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, points and
PIM for all players?
(Select the correct response)
A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI
N pim ON points.name=pim.name
B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE
R JOIN pim ON points.name=pim.name
C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTE
R JOIN pim ON points.name=pim.name
D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT
ER JOIN pim ON points.name=pim.name

20. Which of the following is the implicit qualifier for a declared temporary
table?
(Select the correct response)
A. The schema name SYSCAT.
B. The schema name SESSION.
C. The schema name TEMPUSER.
D. The userid specified with the BIND command.
E. The userid who established the connection to the database and declared the
temporary table.

21. Which of the following SQL statements can remove all rows from a table na
med COUNTRY?
(Select the correct response
A. DELETE country
B. DELETE FROM country
C. DELETE * FROM country
D. DELETE ALL FROM country

22. Which of the following occurs if an application ends abnormally during an
active unit of work?
(Select the correct response)
A. Current unit of work is committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. Current unit of work moves to pending state

23.A user creates the table TABLE1. Which of the following statements would
explicitly give USER1 the ability to read rows from the table?
(Select the correct response)
A. GRANT VIEW TO user1 ON TABLE table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. GRANT ACCESS ON TABLE table1 TO user1

24.Which of the following tools can be used to identify inefficient SQL stat
ements without executing the query?
(Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. Performance Monitor

25.The DB2 Administration Server (DAS) is required for which of the followin
g?
(Select the correct response)
A. For the administrator user id to install or remove DB2
B. For the remote clients to use the Control Center against the instance
C. For checking authorities in the database manager configuration for SYSADM
D. For maintaining authorities added and removed by the SQL GRANT and REVOKE
commands respectively
26.Which of the following authorities should be given to the DB2 Administrat
ion Server (DAS) Instance owner at the administered instance?
(Select the correct response)
A. DBADM
B. SYSADM
C. SYSCTRL
D. SYSMAINT

27.Which two of the following DB2 authorization groups are authorized to cre
ate a table within database sample?
(Select all that apply)
A. DBADM
B. DBCTRL
C. SYSADM
D. DBMAINT
E. ALTERIN
F. SYSMAINT

28.Given the following:
A table containing a list of all seats on an airplane. A seat consists of a s
eat number and whether or not it is assigned. An airline agent lists all the
unassigned seats on the plane. When the agent refreshes the list from the tab
le, the list should not change.
Which of the following isolation levels should be used for this application?

(Select the correct response)
A. Read stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read

29.Which of the following is the result of the following SQL statement:
ALTER TABLE table1 ADD col2 INT WITH DEFAULT
(Select the correct response)
A. The statement fails with a negative SQL code.
B. The statement fails because no default value is specified.
C. A new column called COL2 is added to TABLE1 and populated with zeros.
D. A new column called COL2 is added to TABLE1 and populated with nulls.
E. A new column called COL2, which cannot contain nulls, is added to TABLE1.

30.To set up a client that can access DB2 UDB through DB2 Connect Enterprise
Edition, which of the following is the minimum software client that must be
installed?
(Select the correct response)
A. DB2 Runtime Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client
31.Which of the following types of DB2 locks allows for the most concurrency
within a table?
(Select the correct response)
A. A row lock
B. A page lock
C. A field lock
D. A column lock

32.Which of the following processing can occur for a unit of work using an i
solation level of Read Stability and scanning through the table more than onc
e within the unit of work?
(Select the correct response)

A.   Access uncommitted changes made by other processes
B.   Update uncommitted changes made by other processes
C.   Rows added to a result set by other processes from one scan to the next
D.   Rows changed in a result set by other processes from one scan to the next

33.Given the following SQL statements:
CREATE TABLE tab1 (col1 INT)
CREATE TABLE tab2 (col1 INT)
INSERT INTO tab1 VALUES (NULL),(1)
INSERT INTO tab2 VALUES (NULL),(1)
SELECT COUNT(*) FROM tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
E. 0

34.Given an application bound with cursor stability which will be updating r
ows in a table and obtaining row locks, which of the following table locks wi
ll DB2 acquire for the application first?
(Select the correct response)
A. U – update
B. X – exclusive
C. IU - intent update
D. IX - intent exclusive

35.When granted to user1, which of the following will allow user1 to ONLY ac
cess table data?
(Select the correct response)
A. DBADM authority
B. SYSADM authority
C. SELECT privilege on the table
D. SELECT privilege WITH GRANT OPTION on the table

 **********************************************************




DB2v8 模拟试题

Given the table COUNTRY and the statements below:
COUNTRY

ID    NAME PERSON_ID 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


COUNTRY(PERSON_ID) is the foreign key for STAFF(ID).
Which of the following statements removes from the COUNTRY table those rows that do
not have a STAFF person assigned?

  A. DELETE FROM country WHERE id IN (SELECT id FROM staff)

  B. DELETE FROM country WHERE id NOT IN (SELECT person_id FROM staff)

  C. DELETE FROM country WHERE person_id NOT IN (SELECT id FROM staff)

  D. DELETE FROM country WHERE person_id IN (SELECT person_id FROM staff)

Which of the following isolation levels will hold locks only on the rows in the answer
set at the end of the query?

  A. Read Stability

  B. Repeatable Read

  C. Cursor Stability

  D. Uncommitted Read
Which two of the following SQL data types should be used to store double byte
character data?

  A. CLOB

  B. CHAR

  C. DBCLOB

  D. GRAPHIC

  E. VARCHAR

A unit of work is using an isolation level of Uncommitted Read, and allows scanning
through the table more than once within the unit of work. Which of the following can
occur during processing of this unit of work?

  A. It can access uncommitted changes made by other transactions.

  B. It can update uncommitted changes made by other transactions.

  C. It can update rows and have those updated rows be changed by other transactions
from one scan to the next.

  D. It can update rows and have those updated rows be committed by other transactions
from one scan to the next.

Which of the following can be used to store images in a DB2 database?

  A. DB2 AVI Extender

  B. DB2 XML Extender

  C. DB2 Text Extender

  D. DB2 Spatial Extender

Given the following transaction in an embedded SQL application:

CREATE TABLE dwaine.mytab (col1 INT, col2 INT)
INSERT INTO dwaine.mytab VALUES (1,2)
INSERT INTO dwaine.mytab VALUES (4,3)
ROLLBACK

What is the result of issuing the following statement?

SELECT * FROM dwaine.mytab
A. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.

  B. COL1 COL2
------------ -----------
  0 record(s) selected.


  C. COL1 COL2
------------ -----------
1 2 1 record(s) selected.


  D. COL1 COL2
------------ -----------
1 2
4 3 2 record(s) selected.


Which of the following statements will create an index and prevent table T1 from
containing two or more rows with the same values for column C1?

  A. CREATE UNIQUE INDEX ix1 ON t1 (c1)

  B. CREATE DISTINCT INDEX ix1 ON t1 (c1)

  C. CREATE UNIQUE INDEX ix1 ON t1 (c1,c2)

  D. CREATE DISTINCT INDEX ix1 ON t1 (c1,c2)

Given the following statements:

CREATE TABLE t1 (id INTEGER, CONSTRAINT chkid CHECK (id<100))
INSERT INTO t1 VALUES (100)
COMMIT

Which of the following occurs as a result of issuing the statements?

  A. The row is inserted with ID having a NULL value.

  B. The row is inserted with ID having a value of 100.

  C. The row insertion with a value of 100 for ID is rejected.

  D. The trigger called chkid is activated to validate the data.

When using DB2 Connect, which of the following commands specifies the protocol
information on how to connect to the host or to the server?

  A. CATALOG DCS
B. CATALOG NODE

  C. CATALOG DATABASE

  D. CATALOG ODBC DATA SOURCE

An application using the Repeatable Read isolation level acquires an update lock. When
does the update lock get released?

  A. When the cursor accessing the row is closed

  B. When the transaction issues a ROLLBACK statement

  C. When the cursor accessing the row is moved to the next row

  D. When the transaction changes are made via an UPDATE statement

Given the following statements:

CREATE TABLE t4
(c1 INTEGER NOT NULL,
c2 INTEGER,
c3 DECIMAL(7,2) NOT NULL,
c4 CHAR(20) NOT NULL);
CREATE UNIQUE INDEX i4 ON t4(c1,c3);
ALTER TABLE t4 ADD PRIMARY KEY (c1,c3);

Which of the following statements is TRUE?

  A. The ALTER TABLE statement will fail.

  B. The primary key will use the I4 unique index.

  C. A primary index will need to be created on the composite key (C1,C3).

  D. An additional unique index will automatically be created on the composite key
(C1,C3).

A table has had check constraint enforcement turned off, and additional data has been
inserted. Which of the following will perform data validation to ensure that column
values are valid?

  A. Add a trigger

  B. Collect statistics

  C. Reorganize the table
D. Enable check constraints

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 INTEGER GENERATED BY DEFAULT AS IDENTITY)

  C. CREATE TABLE t1 (employid INTEGER NOT NULL)

  D. CREATE TABLE t1 (employid INTEGER NOT NULL PRIMARY KEY)

Given the following SQL statement:

GRANT EXECUTE ON PACKAGE proc1 TO usera WITH GRANT OPTION

Which two of the following describe what USERA is allowed to do?

  A. Execute SQL statements in package PROC1

  B. Grant any privilege on package PROC1 to other users

  C. Grant bind privilege on package PROC1 to other users

  D. Grant execute privilege on package PROC1 to other users

  E. Access all of the tables referenced in package PROC1 from any program

USER2 has SELECT WITH GRANT OPTION on APPL.TAB1.
Which of the following statements is USER2 authorized to execute?

  A. GRANT INSERT ON TABLE appl.tab1 TO user8

  B. GRANT SELECT ON TABLE appl.tab1 TO user8

  C. GRANT REFERENCES ON TABLE appl.tab1 user8

  D. GRANT ALL PRIVILEGES on TABLE appl.tab1 TO user8

Given the following statement:

CREATE TABLE t1 (c1 CHAR(4) NOT NULL)

Which of the following can be inserted into this table?

  A. 4

  B. NULL
C. 'abc'

  D. 'abcde'

USER3 is running a program A.APP1 that calls stored procedure P.PROC1.
As an administrator, which of the following statements should be executed to give
USER3 the appropriate privilege to be able to execute the code found in stored
procedure P.PROC1?

  A. GRANT EXECUTE ON PACKAGE a.app1 TO user3

  B. GRANT EXECUTE ON PROCEDURE a.app1 TO user3

  C. GRANT EXECUTE ON FUNCTION p.proc1 TO user3

  D. GRANT EXECUTE ON PROCEDURE p.proc1 TO user3

Which of the following tools can be used to catalog a database?

  A. Journal

  B. Task Center

  C. License Center

  D. Configuration Assistant

Given the following tables:

NAMES
Name Number
Wayne Gretzky
Jaromir Jagr
Bobby Orr
Bobby Hull
Brett Hull
Mario Lemieux
Steve Yzerman
Claude Lemieux
Mark Messier
Mats Sundin 99
68
4
23
16
66
19
19
11
13

POINTS
Name Points
Wayne Gretzky
Jaromir Jagr
Bobby Orr
Bobby Hull
Brett Hull
Mario Lemieux   244
168
129
93
121
189

PIM
Name PIM
Mats Sundin
Jaromir Jagr
Bobby Orr
Mark Messier
Brett Hull
Mario Lemieux
Joe Sakic 14
18
12
32
66
23
94

Which of the following statements will display the name, number, points and PIM for
players with an entry in all three tables?

  A.
SELECT names.name, names.number, points.points, pim.pim FROM names INNER JOIN points
ON names.name=points.name INNER JOIN pim ON pim.name=names.name

  B.
SELECT names.name, names.number, points.points, pim.pim FROM names OUTER JOIN points
ON names.name=points.name OUTER JOIN pim ON pim.name=names.name

  C.
SELECT names.name, names.number, points.points, pim.pim FROM names LEFT OUTER JOIN
points ON names.name=points.name LEFT OUTER JOIN pim ON pim.name=names.name

  D.
SELECT names.name, names.number, points.points, pim.pim FROM names RIGHT OUTER JOIN
points ON names.name=points.name RIGHT OUTER JOIN pim ON pim.name=names.name
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 the privileges granted to 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

Which of the following can duplicate the structure and related objects of a database
table?

  A. Copy table

  B. Alter table

  C. Export table

  D. Generate DDL

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(20)
years            INTEGER
salary           DECIMAL(10,2)
comm          DECIMAL(10,2)
Which of the following statements will display all departments, alphabetically by
department name, and the name of the manager of each department?
A. SELECT a.deptname, b.name FROM org a, staff b WHERE b.manager=a.id

  B. SELECT a.deptname, b.name FROM org a, staff b WHERE b.manager=a.id GROUP BY
a.deptname, b.name

  C. SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id ORDER BY
a.deptname, b.name

  D. SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id GROUP BY
b.name ORDER BY a.deptname

A client application on OS/390 or OS/400 must access a DB2 server on Linux. At a
minimum, which of the following products is required to be on the DB2 server?

  A. DB2 Connect Enterprise Edition

  B. DB2 UDB Enterprise Server Edition

  C. DB2 Connect Enterprise Edition and DB2 UDB Workgroup Server Edition

  D. DB2 Connect Enterprise Edition and DB2 UDB Enterprise Server Edition

Given the table COUNTRY and the statements below:
COUNTRY

ID    NAME PERSON_ID CITIES
1     Argentina 1 10
2    Canada 2 20
3    Cuba 2 10
4    Germany 1 0
5    France 7 5

DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, name
OPEN c1
FETCH c1
FETCH c1
COMMIT
FETCH c1

Which of the following is the last name obtained from the table?

  A. Cuba

  B. France

  C. Canada

  D. Germany
E. Argentina

Given the following table definitions:

DEPARTMENT
deptno          CHAR(3)
deptname      CHAR(30)
mgrno I         NTEGER
admrdept      CHAR(3)

EMPLOYEE
empno          INTEGER
firstname      CHAR(30)
midinit          CHAR
lastname       CHAR(30)
workdept     CHAR(3)

Which of the following statements will produce a result set satisfying these criteria?
* The empno and lastname of every employee
* For each employee, include the empno and lastname of their manager
* Includes employees both with and without a manager

  A.
SELECT e.empno, e.lastname FROM employee e LEFT OUTER JOIN (department INNER JOIN
employee m ON mgrno = m.empno) ON e.workdept = deptno

  B.
SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT INNER JOIN
(department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno

  C.
SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT OUTER JOIN
(department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno

  D.
SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT OUTER JOIN
(department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno
Given the following statements:

CREATE TABLE tab1 (c1 CHAR(3) WITH DEFAULT '123',c2 INTEGER);
INSERT INTO tab1(c2) VALUES (123);
Which will be the result of the following statement when issued from the Command Line
Processor?

SELECT * FROM tab1;

  A. C1 C2
--- -----------
0 record(s) selected.
B. C1 C2
--- -----------
123 123
1 record(s) selected.

  C. C1 C2
--- -----------
      123
1 record(s) selected.

  D. C1 C2
--- -----------
- 123
1 record(s) selected.

When constraint checking is suspended or disabled, a table or table space (depending
on platform) is placed in which of the following states?

  A. Paused

  B. Check pending

  C. Intent locked

  D. Constraint waiting

Which of the following DB2 components allows references to Oracle and DB2 databases in
a single query?

  A. DB2 Query Patroller

  B. DB2 Warehouse Manager

  C. DB2 Relational Connect

  D. DB2 Connect Enterprise Edition

Which of the following processes is NOT performed by DB2 Warehouse Manager?

  A. Query

  B. Loading

  C. Extraction

  D. Transformation

SQL source statements for which two of the following are stored in the system catalog?
A. Views

  B. Tables

  C. Indexes

  D. Triggers

  E. Constraints

Examination Score Report


Pre-Assessment/Sample Test for Test 700 Exam 700 - DB2 UDB V8.1 Family Fundamentals
CANDIDATE: Rico Cai
CANDIDATE USERID: rico_cai      DATE: April 30, 2003
(April 30, 2003 9:30:59 AM GMT)
ICE INTERNAL ID: 1072225
EXAM: Exam 700 - DB2 UDB V8.1 Family Fundamentals
NUMBER: 700

PASSING SCORE: 60% (18 out of 30)        YOUR SCORE: 23% (7 out of 30)   GRADE: Fail


The following shows the percentage weighting of each section/category and your related
score.
    Section / Category   % of Test   Your Score

  1.   Planning   17%    0%
  2.   Security   7%    100%
  3.   Accessing DB2 UDB Data    17%      20%
  4.   Working with DB2 UDB Data     30%      11%
  5.   Working with DB2 UDB Objects      20%      50%
  6.   Data Concurrency   10%     0%

Db2考试测试题

  • 1.
    DB2 考试 自测题 1 -------------------------------------------------------------------------------- 1)Which of the following products is required to be installed in order to build an application on AIX, which will access a DB2 UDB for OS/390 database? a) DB2 Connect Personal Edition b) DB2 Universal Database Workgroup Edition c) DB2 Personal Developer's Edition d) DB2 Universal Developer's Edition OK 2) Which of the following tools can be used to catalog a database? a) Journal b) Alert Center c) License Center d) Configuration Assistant OK 3) Which of the following utilities would you run to order data and reclaim space from deleted rows in a table: a) reorg OK b) db2look c) db2move d) runstats # the detail in file “reorg vs runstats.txt” 4) The purpose of the USE privilege is to: a) query data in a table. b) load data into a table. c) create tables within a table space. OK d) create table spaces within a database. 5) Which two of the following authorities can create a database? a) DBADM b) SYSADM c) DBCTRL
  • 2.
    d) SYSCTRL e) SYSMAINT 6)Cataloging a remote database is: a) Performed on a PC or UNIX machine to identify the server the DB2 database manager is on. b) Performed on a PC or UNIX machine to identify the DB2 database to users and applications. OK c) Never performed in DB2, as only one database per node is allowed, so cataloging a node automatically catalogs the database at that node. d) Performed on a PC or UNIX machine to open the catalogs in the DB2 database and present a user with a list of all accessible tables in that database. 7) 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) 8) 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 . 9) 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
  • 3.
    Which of thefollowing 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) OK 10) 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' 11) 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 12) Which of the following CANNOT have an autocommit setting? a) Embedded SQL b) The Command Center c) The Command Line Processor d) The DB2 Call Level Interface 13) Which of the following statements eliminates all but one of each set of duplicate rows in the final result table? a) SELECT UNIQUE * FROM t1 b) SELECT DISTINCT * FROM t1 c) SELECT * FROM DISTINCT T1 d) SELECT UNIQUE (*) FROM t1 e) SELECT DISTINCT (*) FROM t1 14) Given the table: STAFF ID LASTNAME 1 Jones
  • 4.
    2 Smith 3 <null> Whichof 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' 15) Given the following table definitions: DEPARTMENT deptno CHAR(3) deptname CHAR(30) mgrno INTEGER admrdept CHAR(3) EMPLOYEE empno INTEGER firstname CHAR(30) midinit CHAR lastname CHAR(30) workdept CHAR(3) Which of the following statements will list every employee's number and last name with the employee number and last name of their manager, including employees witho ut a manager? a) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT I NNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno b) SELECT e.empno, e.lastname, m.empno, m.lastname, FROM employee e LEFT OUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno c) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT OUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno d) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT INNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno 16) Given the following tables: NAMES Name Number Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Steve Yzerman 19
  • 5.
    Claude Lemieux 19 MarkMessier 11 Mats Sundin 13 POINTS Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 PIM Name PIM Mats Sundin 14 Bobby Orr 12 Mark Messier 32 Brett Hull 66 Mario Lemieux 23 Joe Sakic 94 Which of the following statements will display the player's Names, numbers, p oints and PIM for all players with an entry in all three tables? a) SELECT names.name, names.number, points.points, pim.pim FROM names INN ER JOIN points ON names.name=points.name INNER JOIN pim ON pim.name=names.nam e b) SELECT names.name, names.number, points.points, pim.pim FROM names OUT ER JOIN points ON names.name=points.name OUTER JOIN pim ON pim.name=names.nam e c) SELECT names.name, names.number, points.points, pim.pim FROM names LEF T OUTER JOIN points ON names.name=points.name LEFT OUTER JOIN pim ON pim.name =names.name d) SELECT names.name, names.number, points.points, pim.pim FROM names RIG HT OUTER JOIN points ON names.name=points.name RIGHT OUTER JOIN pim ON pim.na me=names.name 17) Given the tables: EMPLOYEE emp_num emp_name dept 1 Adams 1 2 Jones 1 3 Smith 2 4 Williams 1 DEPT dept_id dept_name
  • 6.
    1 Planning 1 Support andthe statement: ALTER TABLE employee ADD FOREIGN KEY (dept) REFERENCES (dept_id) ON DELETE CASCADE How many units of work will be needed to process this statement: DELETE FROM dept WHERE dept_id=1 a) 0 b) 1 c) 2 d) 3 e) 4 f) 6 1 Given the requirements to store names, employee numbers, and when the emp loyees were hired, which of the following DB2 data types CANNOT be used to co ntain the day the employee was hired? a) CLOB b) TIME c) VARCHAR d) TIMESTAMP 19) Given the transaction: "CREATE TABLE t1 (id INTEGER,CONSTRAINT chkid CHECK (id<100))" "INSERT INTO t1 VALUES (100)" "COMMIT" Which of the following results from the transaction? a) The row is inserted with a NULL value b) The row is inserted with a value of 100 c) The row insertion with a value of 100 is rejected d) The trigger called chkid is fired to validate the data 20) If a table is defined with a check constraint for one or more columns, wh ich of the following will perform the data validation after the table is load ed with the load utility. a) Reorg b) Check c) Runstats d) Image Copy e) Set Integrity 21) 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)
  • 7.
    c) INSERT INTOv1 VALUES ('b') d) INSERT INTO v1 VALUES ('a') e) INSERT INTO v1 VALUES ('ab') 22) 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. 23) Which of the following isolation levels is most likely to acquire a table level lock during an index scan? a) Read Stability b) Repeatable Read c) Cursor Stability d) Uncommitted Read 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 applic ation 25) Which of the following processes is NOT performed by DB2 Warehouse Manage r? a) Query b) Loading c) Extraction d) Transformation 26) Which of the following DB2 components allows reference to Oracle and DB2 databases in a single query? a) DB2 Query Patroller b) DB2 Warehouse Manager c) DB2 Relational Connect d) DB2 Connect Enterprise Edition 27) Given the table: STAFF ID LASTNAME 1 Jones 2 Smith When issuing the query SELECT * FROM staff, the row return order will be base d on which of the following? a) An ambiguous order b) The primary key order
  • 8.
    c) The orderthat the rows were inserted into the table d) The values for the ID column, then the LASTNAME column 2 How many indexes will be created by the following statement? Create table mytab ( Col1 int not null primary key, Col2 char(64), Col3 char(32), Col4 int not null, constraint c4 unique (Col4,Col1) ) a) 0 b) 1 c) 2 d) 3 e) 4 29) 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 30) 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 o n 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
  • 9.
    d) REVOKE REFERENCESON TABLE table1 COLUMNS (col1, col2) FROM USER usera 31) Given, CREATE TABLE t1 (c1 CHAR(4) NOT NULL). Which of the following can be inserted into this table? a) 4 b) NULL c) ‘abc’ d) ‘abcde’ 32) 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 33) Which of the following delete rules will not allow a row to be deleted fr om 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 34) Which of the following processing can occur for a unit of work using an i solation level of Uncommitted Read and scanning through the table more than o nce 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 proces ses from one scan to the next d) Update rows of a return set and have those updates committed by other proc esses from one scan to the next 35) Which of the following database authorities is required to add a new pack age? a) BINDADD b) CREATETAB c) CREATEPKG d) PACKAGEADD 36) 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', ROLLBACK WORK Which of the following indicates the number of new rows that would be in the STAFF table? a) 0
  • 10.
    b) 1 c) 2 d)3 37) 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, alphabeticall y 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 GR OUP BY a.deptname, b.name d) SELECT a.deptname, b.name FROM org a, staff b, WHERE b.manager=a.id G ROUP BY a.deptname, b.name 3 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)) 39) A client application on OS/390 must access a DB2 server on Unix, Windows or OS/2. At a minimum, which of the following is required to be the DB2 serve r machine? a) DB2 Connect Enterprise Edition b) DB2 Universal Database Enterprise Edition c) DB2 Connect and DB2 Universal Database Workgroup Edition d) DB2 Connect and DB2 Universal Database Enterprise Edition 40) Given the statements and operations: "CREATE TABLE t1 (c1 CHAR(1))"
  • 11.
    Six rows areinserted with values of: a, b, c, d, e and f "SET CONSTRAINTS FOR t1 OFF" "ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a')" "SET CONSTRAINTS FOR t1 IMMEDIATE CHECKED FOR EXCEPTION IN t1 USE t1exp" Which of the following describes what happens to the rows with values of b, c , d, e and f? a) deleted from T1 only b) deleted from T1 and written into the t1exp file c) deleted from T1 and inserted into the table t1exp d) deleted from T1 and written into the db2diag.log file e) deleted from T1 and inserted into the table syscat.checks 41) Given the requirement of providing a read-only database, applications acc essing the database should be run with which of the following isolation level s to allow for the most read concurrency? a) Read stability b) Repeatable read c) Cursor stability d) Uncommitted read
  • 12.
    ****************************************************** 自测题 2 -------------------------------------------------------------------------------- (1/55) Whichof the following products must be installed to provide a single point of control for local and remote DB2 databases? (Select the correct response) A. DB2 Runtime Client B. DB2 Administration Client C. DB2 Connect Enterprise Edition D. DB2 Enterprise-Extended Edition (2/55) Which of the following tools maintains a history of all executed state ments/commands for the current session within the tool? (Select the correct response) A. Journal B. SQL Assist C. DB2 Alert Center D. DB2 Command Center (3/55) Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response) A. -f B. -b C. -o D. -w (4/55) Which of the following will rebuild a package in the database from the existing catalog information? (Select the correct response)
  • 13.
    A. bind B. rebind C. update D. rebuild (5/55) Which two of the following types of storage management method is suppo rted by DB2 OLAP Server ? (Select all that apply) A. Object B. Network C. Relational D. Hierarchical E. Multi-dimensional (6/55) Which of the following DB2 components can limit the resource consumpti on of queries? (Select the correct response) A. DB2 Connect B. DB2 Query Patroller C. DB2 Performance Monitor D. DB2 Net Search Extender (7/55)How many DB2 Administration Server (DAS) Instances can be set up per ph ysical machine? (Select the correct response) A. 0 B. 1 C. One for each instance on the physical machine D. One for each database on the physical machine (8/55) Which of the following must be set up to allow the Control Center to v iew database objects? (Select the correct response) A. ODBC B. JAVA C. DB2 Administration Server D. Client Configuration Assistant (9/55) Which of the following privileges is necessary to populate the table w ith large amounts of data? (Select the correct response) A. LOAD B. ALTER C. UPDATE D. IMPORT (10/55) A table called EMPLOYEE has columns: name, department, and phone_numb er. Which of the following can limit access to the phone_number column?
  • 14.
    (Select the correctresponse) A. Using a view to access the table B. Using an index on the column C. Using a referential constraint on the table D. Using a table check constraint on the table E. Revoking access from the phone_number column (11/55) Which of the following is the best way to restrict user access to a s ubset of columns in a table? (Select the correct response) A. Only grant access to the columns within a table that a user is allowe d to see. B. Create a view that only includes the columns a user is allowed to see . Grant the user access to the view, not the base table. C. Create two tables: one with the columns that a user is allowed to see , and one that has the confidential columns, and use a join when all data must be presented. D. Create two tables: one with the columns that a user is allowed to see , and one that has the confidential columns, and use a union when all data must be presented. (12/55) Which of the following is the most appropriate reason to consider rev oking the SELECT privilege on the catalog tables from PUBLIC after creating a database? (Select the correct response) A. To prevent users from creating tables without proper authority. B. Some system catalogs record user data in some columns, and this data may be confidential. C. To prevent users from viewing passwords for other DB2 userids that DB 2 stores in the catalog tables. D. Some catalog tables are large, so preventing users from viewing them is a good way to keep users from submitting long-running queries against the catalogs. (13/55) When manually establishing communications from a Windows NT client th rough a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT required to catalog? (Select the correct response) A. The client. B. The database on the DRDA server. C. The Database Connection Service database. D. The node where the DB2 Connect Gateway is. (14/55) Which of the following can be used to determine the views that are af fected by a DROP
  • 15.
    TABLE statement? (Select thecorrect response) A. DB2 Script Center B. DB2 Performance Monitor C. DB2 Control Center, Show Related D. DB2 Control Center, Sample Contents (15/55) Using the Control Center Create Table dialog box, which of the follow ing dialogs allows the table creation DDL to be viewed? (Select the correct response) A. Copy B. Show SQL C. Show Related D. Sample Contents (16/55) Given the table definition: CREATE TABLE student (name CHAR(30), age INTEGER) To list the names of the 10 youngest students, which of the following index d efinition statements on the student table may improve the query performance? (Select the correct response) A. CREATE INDEX youngest ON student (age, name) B. CREATE INDEX youngest ON student (name, age) C. CREATE INDEX youngest ON student (name, age DESC) D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age) (17/55) Which one of the following SQL statements sets the default qualifier to "user1"? (Select the correct response) A. SET CURRENT ID = 'user1' B. SET CURRENT USER = 'user1' C. SET CURRENT SQLID = 'user1' D. SET CURRENT QUALIFIER = 'user1' (18/55) Which of the following is the implicit qualifier for a declared tempo rary table? (Select the correct response) A. The schema name SYSCAT. B. The schema name SESSION. C. The schema name TEMPUSER. D. The userid specified with the BIND command. E. The userid who established the connection to the database and declare d the temporary table. (19/55) Given the following transaction: CREATE TABLE dwaine.mytab (col1 INT, col2 INT) INSERT INTO dwaine.mytab VALUES (1,2) INSERT INTO dwaine.mytab VALUES (4,3)
  • 16.
    ROLLBACK Which of thefollowing would be returned from the statement: SELECT * FROM dwaine.mytab? (Select the correct response) A. COL1 COL2 ----------- ----------- 0 record(s)selected. B. COL1 COL2 ----------- ----------- 1 2 1 record(s) selected. C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name. D. COL1 COL2 ----------- ----------- 1 2 4 3 2 record(s) selected. (20/55) Which of the following does NOT end a unit of work? (Select the correct response) A. COMMIT B. ROLLBACK C. TERMINATE D. SAVEPOINT E. CONNECT RESET (21/55) Which of the following is the result of the following SQL statement: CREATE UNIQUE INDEX empno_ind ON employee (empno) (Select the correct response) A. Every value for EMPNO must be unique. B. UPDATE statements on EMPNO will be rolled back. C. Insert statements on EMPNO will always be faster. D. Insert statements on the EMPNO table will result in clustered data. (22/55) Given the following DDL statements, CREATE TABLE t1 (a INT, b INT, c INT) CREATE VIEW v1 AS SELECT a, b, c FROM t1 WHERE a > 250 WITH CHECK OPTION Which of the following INSERT statements will fail? (Select the correct response) A. INSERT INTO t1 VALUES (200, 2, 3) B. INSERT INTO v1 VALUES (200, 2, 3) C. INSERT INTO t1 VALUES (300, 2, 3) D. INSERT INTO v1 VALUES (300, 2, 3) (23/55) Which of the following statements will create an index and prevent ta ble T1 from containing two or more rows with the same values for column C1?
  • 17.
    (Select the correctresponse) A. CREATE UNIQUE INDEX ix4 ON t1 (c1) B. CREATE DISTINCT INDEX ix1 ON t1 (c1) C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2) D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2) (24/55) Given the table T1, created by: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued: INSERT INTO t1 VALUES (1, 'ABC') INSERT INTO t1 VALUES (5, 'DEF') Which of the following values are inserted into the ID column by the followin g statement? INSERT INTO t1(c1) VALUES ('XYZ') (Select the correct response) A. 0 B. 1 C. 2 D. 5 E. 6 (25/55) Given the following:TAB1 TAB2 C1 C2 CX CY --- --- --- --- A 11 A 21 B 12 C 22 C 13 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 joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=cx B. SELECT * FROM tab1 INNER 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 (26/55) Given the following UPDATE statement: UPDATE address2 SET housenumber_buildingname=(SELECT buildingname FROM addres s1 WHERE address2.id = address1.id) WHERE HOUSENUMBER_BUILDINGNAME IS NULL Which of the following describes the result of the statement?
  • 18.
    (Select the correctresponse) A. The statement will succeed. B. The statement will fail because a subquery cannot exist in an UPDATE statement. C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are de fined as primary keys. D. The statement will succeed if the data retrieved from the subquery do es not have duplicate values for ADDRESS1.ID. (27/55) Which of the following is possible once a user has been given mainten ance authority? (Select the correct response) A. DB2 userids can be created. B. Views can be created on the catalogs. C. Statistics can be collected for database objects. D. A table can be populated by using the LOAD command. (28/55) Given table T1 with 100 rows, which of the following queries will ret rieve 10 rows from table T1? (Select the correct response) A. SELECT * FROM t1 MAXIMUM 10 ROWS B. SELECT * FROM t1 READ 10 ROWS ONLY C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY (29/55) Given the two following tables: Points Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 PIM Name PIM Mats Sundin 14 Jaromir Jagr 18 Bobby Orr 12 Mark Messier 32 Brett Hull 66 Mario Lemieux 23 Joe Sakic 94
  • 19.
    Which of thefollowing statements will display the player's Names, points and PIM for all players? (Select the correct response) A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNE R JOIN pim ON points.name=pim.name B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTER JOIN pim ON points.name=pim.name C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTER JOIN pim ON points.name=pim.name D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGH T OUTER JOIN pim ON points.name=pim.name (30/55) Given the following table definitions: DEPARTMENT deptno CHAR(3) deptname CHAR(30) mgrno INTEGER admrdept CHAR(3) EMPLOYEE empno INTEGER firstname CHAR(30) midinit CHAR lastname CHAR(30) workdept CHAR(3) Which of the following statements will list the employee's employee number, l ast name, and department name ONLY for those employees who have a department? (Select the correct response) A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE e.workdept = d.deptno B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOI N department d ON e.workdept = d.deptno C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOI N department d ON e.workdept = d.deptno D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JO IN department d WHERE e.workdept = d.deptno (31/55) Given the table: COUNTRY
  • 20.
    ID NAME PERSONCITIES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10 4 Germany 1 0 5 France 7 5 Which of the following clauses when added to the statement SELECT cities, name FROM country returns rows sorted by NAME and then sorted by the number of cities (CITIES)? (Select the correct response) A. ORDER BY 2,1 B. GROUP BY 2, 1 C. ORDER BY cities, name D. GROUP BY cities, name (32/55) Given the following table definition: STAFF id INTEGER name CHAR(20) dept INTEGER job CHAR(20) years INTEGER salary DECIMAL(10,2) comm DECIMAL(10,2) Which of the following statements will return all of the records ordered by j ob with the salaries in descending order? (Select the correct response) A. SELECT * FROM staff ORDER BY salary DESC, job B. SELECT * FROM staff GROUP BY salary DESC, job C. SELECT * FROM staff ORDER BY job, salary DESC D. SELECT * FROM staff GROUP BY job, salary DESC (33/55) Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with columns ID and TITLE, what is the effect of the statement: UPDATE employee SET salary = salary * 1.15 WHERE salary < 15000 OR EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr' ) (Select the correct response) A. Only managers that make less than 15,000 are given salary increases. B. Only non-managers that make less than 15,000 are given salaray increa ses. C. Employees that make less than 15,000 but no managers are given salary increases.
  • 21.
    D. Employees thatmake less than 15,000 and all managers are given salar y increases. (34/55) Given the table definition: DEFIN1: id SMALLINT NOT NULL name VARCHAR(30) hired DATE DEFIN2: deptid SMALLINT NOT NULL name VARCHAR(30) started DATE Which of the following statements will insert successfully into table DEFIN1? (Select the correct response) A. INSERT INTO defin1 (id) VALUES (1) B. INSERT INTO defin1 (name) VALUES ('Florence') C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE FROM defin2 D. INSERT INTO defin1 (name, hired) SELECT DISTINCT 'Florence', CURRENT DATE FROM defin2 (35/55) With tables defined as: Table1 col1 INT col2 CHAR(30) Table2 col1 INT col2 CHAR(30) Which of the following statements will insert all the rows in TABLE2 into TAB LE1? (Select the correct response) A. INSERT INTO table1 SELECT col1, col2 FROM table2 B. INSERT INTO table1 AS SELECT col1, col2 FROM table2 C. INSERT INTO table1 VALUES (table2.col1, table2.col2) D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2) E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2) (36/55) Which of the following is the result of a successful ROLLBACK stateme nt? (Select the correct response) A. Held locks are released B. Release-pending conditions are undone C. Tables in LOAD PENDING are released D. Constraint checking conditions are undone E. Existing database connections are released
  • 22.
    (37/55) Given thefollowing embedded SQL programs: Program 1: CREATE TABLE mytab (col1 INT, col2 CHAR(24)) COMMIT Program 2: INSERT INTO mytab VALUES ( 20989,'Joe Smith') INSERT INTO mytab VALUES ( 21334,'Amy Johnson') COMMIT DELETE FROM mytab ROLLBACK INSERT INTO mytab VALUES ( 23430,'Jason French') ROLLBACK INSERT INTO mytab VALUES ( 20993,'Samantha Jones') COMMIT DELETE FROM mytab WHERE col1=20993 ROLLBACK Which of the following indicates the number of records that will be returned by the statement: SELECT * FROM mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 E. 4 (38/55) Given an embedded SQL program with a single connection, two threads a nd the following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (39/55) Given two embedded SQL programs and the following actions: Pgm1 Pgm2 INSERT INTO mytab VALUES (...) DELETE FROM mytab COMMIT ROLLBACK DELETE FROM mytab INSERT INTO mytab VALUES (...) ROLLBACK COMMIT
  • 23.
    If there existsone (1) row in table mytab before the programs are executed c oncurrently, how many records will be in the table once the programs complete? (Select the correct response) A. 0 B. 1 C. 2 D. 3 E. 4 (40/55) A user has a numeric data column with a maximum value of 100,000. Whi ch of the following data types will use the minimum amount of storage for the column? (Select the correct response) A. IDENTITY B. BIGINT C. INTEGER D. SMALLINT (41/55) Which of the following DB2 data types is used to store 50 MB of binar y data as a single value? (Select the correct response) A. BLOB B. CLOB C. DBCLOB D. FOR BIT DATA E. VARCHAR FOR BIT DATA (42/55) Given the following column requirements: Col1 Numeric Identifier - From 1 to 1000000 Col2 Job Code - Variable, 1 to 2 characters long Col3 Job Description - Variable, 1 to 100 characters long Col4 Job Length - Length of Job in seconds Which of the following will minimize the disk space allocated to store the re cords if Job Description has an average length of 45? (Select the correct response) A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT) B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 IN T) C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 IN T) D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT) (43/55) Which of the following DELETE RULES on CREATE TABLE will delete a dep endent table row if the parent table row is deleted?
  • 24.
    (Select the correctresponse) A. ON DELETE REMOVE B. ON DELETE CASCADE C. ON DELETE RESTRICT D. ON DELETE SET NULL E. ON DELETE PROPAGATE (44/55) Given the following table structure: table1 emp_num INT NOT NULL PRIMARY KEY emp_fname CHAR(30) NOT NULL emp_lname CHAR(30) NOT NULL emp_addr CHAR(60) NOT NULL emp_pin CHAR(10) NOT NULL Which of the following columns can be referenced by a foreign key clause from another table? (Select the correct response) A. emp_num B. emp_pin C. emp_addr D. emp_fname E. emp_lname (45/55) Why is a unique index not sufficient for creation of a primary key? (Select the correct response) A. It is sufficient - a primary key is the same thing as a unique index. B. Unique indexes can be defined in ascending or descending order. Prima ry keys must be ascending. C. A unique index can be defined over a column or columns that allow nul ls. Primary keys cannot contain nulls. D. A unique index can be defined over a column or columns that allow nul ls. This is not allowed for primary keys because foreign keys cannot contain nulls. (46/55) Given the statement: CREATE TABLE t1 (c1 CHAR(1)) Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol lowing command is issued: ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a') Which of the following occurs? (Select the correct response) A. Rows with c1 values of b,c,d,e,f are deleted B. Rows with c1 values of b,c,d,e,f have c1 set to NULL C. The ALTER command will fail as rows violate the constraint D. The ALTER command will move the violating rows to the exception table
  • 25.
    (47/55) With DBADMauthority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (48/55) A view is used instead of a table for users to do which of the follow ing? (Select the correct response) A. Avoid allocating more disk space per database B. Provide users with the ability to define indexes C. Restrict user's access to a subset of the table data D. Avoid allocating frequently used query result tables (49/55) Which of the following products can be used to perform a dictionary-b ased search? (Select the correct response) A. Net.Data B. XML Extender C. AVI Extender D. Text Extender (50/55) Which two of the following modes can be used on the lock table statem ent? (Select all that apply) A. SHARE MODE B. EXCLUSIVE MODE C. REPEATABLE READ MODE D. UNCOMMITTED READ MODE E. INTENT EXCLUSIVE MODE (51/55) For which of the following can locks be obtained? (Select the correct response) A. A trigger B. A table view C. A table column D. A database buffer E. A row referenced by an index key (52/55) Given the following table with a primary key on empid: Emp:
  • 26.
    Empid Name 11 JoeSmith 23 Melanie Jones 30 Robert Bruce 49 Janice Baker 66 Mario Diaz 68 Maria Diaton Give the following statement in an embedded SQL program bound with Repeatable Read: Select * from Emp where empid < 55 How many rows in the table will be locked after the statement is run? (Select the correct response) A. 0 B. 1 C. 4 D. 5 E. 6 (53/55) Which of the following isolation levels will lock only the rows retur ned in the result set? (Select the correct response) A. Read Stability B. Repeatable Read C. Cursor Stability D. Uncommitted Read (54/55) Which of the following processing can occur for a unit of work using an isolation level of Cursor Stability and allows scanning through the table more than once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Have updated result set rows changed by other processes from one scan to the next D. Have accessed result set rows changed by other processes from one sca n to the next (55/55) Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the table, it should only change if another agent una ssigns a currently assigned seat. Which of the following isolation levels should be used for this application?
  • 27.
    (Select the correctresponse) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read ************************************************* 自测题 3 -------------------------------------------------------------------------------- (1/55) Given two embedded SQL programs and the following actions: Pgm1 Pgm2 INSERT INTO mytab VALUES DELETE FROM mytab (...) COMMIT ROLLBACK DELETE FROM mytab (...) ROLLBACK COMMIT If there exists one (1) row in table mytab before the programs are executed c oncurrently, how many records will be in the table once the programs complete ? (Select the correct response) A. 0 B. 1 C. 2 D. 3 E. 4 (2/55)Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response) A. –F B. –B C. –O D. –W (3/55)A view is used instead of a table for users to do which of the follow ing? (Select the correct response) A. Avoid allocating more disk space per database B. Provide users with the ability to define indexes C. Restrict user's access to a subset of the table data
  • 28.
    D. Avoid allocatingfrequently used query result tables (4/55) Given the table definition: CREATE TABLE student (name CHAR(30), age INTEGER) To list the names of the 10 youngest students, which of the following index d efinition statements on the student table may improve the query performance? (Select the correct response) A. CREATE INDEX youngest ON student (age, name) B. CREATE INDEX youngest ON student (name, age) C. CREATE INDEX youngest ON student (name, age DESC) D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age) (5/55) Given the following UPDATE statement: UPDATE address2 SET housenumber_buildingname= (SELECT buildingname FROM address1 WHERE address2.id = address1.id) WHERE HOUSENUMBER_BUILDINGNAME IS NULL Which of the following describes the result of the statement? (Select the correct response) A. The statement will succeed. B. The statement will fail because a subquery cannot exist in an UPDATE state ment. C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined as primary keys. D. The statement will succeed if the data retrieved from the subquery does no t have duplicate values for ADDRESS1.ID. (6/55) Given the following column requirements: Col1 Numeric Identifier - From 1 to 1000000 Col2 Job Code - Variable, 1 to 2 characters long Col3 Job Description - Variable, 1 to 100 characters long Col4 Job Length - Length of Job in seconds Which of the following will minimize the disk space allocated to store the re cords if Job Description has an average length of 45? (Select the correct response) A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT) B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT) C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT) D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT) (7/55) Which of the following will rebuild a package in the database from t he existing catalog information? (Select the correct response) A. bind B. rebind C. update D. rebuild
  • 29.
    (8/55)With tables definedas: Table1 col1 INT col2 CHAR(30) Table2 col1 INT col2 CHAR(30) Which of the following statements will insert all the rows in TABLE2 into TAB LE1? (Select the correct response) A. INSERT INTO table1 SELECT col1, col2 FROM table2 B. INSERT INTO table1 AS SELECT col1, col2 FROM table2 C. INSERT INTO table1 VALUES (table2.col1, table2.col2) D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2) E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2) (9/55) Given an embedded SQL program with a single connection, two threads and the following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (10/55)Which of the following can be used to determine the views that are a ffected by a DROP TABLE statement? (Select the correct response) A. DB2 Script Center B. DB2 Performance Monitor C. DB2 Control Center, Show Related D. DB2 Control Center, Sample Contents (11/55) Which of the following is the implicit qualifier for a declared tem porary table? (Select the correct response) A. The schema name SYSCAT. B. The schema name SESSION. C. The schema name TEMPUSER. D. The userid specified with the BIND command. E. The userid who established the connection to the database and declared the temporary table.
  • 30.
    (12/55) Given tableEMPLOYEE with columns EMPNO and SALARY and table JOB wi th columns ID and TITLE, what is the effect of the statement: UPDATE employee SET salary = salary * 1.15 WHERE salary < 15000 OR EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr' ) (Select the correct response) A. Only managers that make less than 15,000 are given salary increases. B. Only non-managers that make less than 15,000 are given salaray increases. C. Employees that make less than 15,000 but no managers are given salary incr eases. D. Employees that make less than 15,000 and all managers are given salary inc reases. (13/55) Given the following table structure: table1 emp_num INT NOT NULL PRIMARY KEY emp_fname CHAR(30) NOT NULL emp_lname CHAR(30) NOT NULL emp_addr CHAR(60) NOT NULL emp_pin CHAR(10) NOT NULL Which of the following columns can be referenced by a foreign key clause from another table? (Select the correct response) A. emp_num B. emp_pin C. emp_addr D. emp_fname E. emp_lname (14/55)Which of the following DELETE RULES on CREATE TABLE will delete a de pendent table row if the parent table row is deleted? (Select the correct response) A. ON DELETE REMOVE B. ON DELETE CASCADE C. ON DELETE RESTRICT D. ON DELETE SET NULL E. ON DELETE PROPAGATE (15/55) Why is a unique index not sufficient for creation of a primary key? (Select the correct response) A. It is sufficient - a primary key is the same thing as a unique index. B. Unique indexes can be defined in ascending or descending order. Primary ke ys must be ascending. C. A unique index can be defined over a column or columns that allow nulls. P rimary keys cannot contain nulls. D. A unique index can be defined over a column or columns that allow nulls. T
  • 31.
    his is notallowed for primary keys because foreign keys cannot contain nulls . (16/55) When manually establishing communications from a Windows NT client through a DB2 Connect gateway to DB2 UDB for OS/390, which of the following i s NOT required to catalog? (Select the correct response) A. The client. B. The database on the DRDA server. C. The Database Connection Service database. D. The node where the DB2 Connect Gateway is. (17/55)Which two of the following types of storage management method is sup ported by DB2 OLAP Server ? (Select all that apply) A. Object B. Network C. Relational D. Hierachical E. Multi-dimensional (18/55) Which of the following is the result of a successful ROLLBACK state ment? (Select the correct response) A. Held locks are released B. Release-pending conditions are undone C. Tables in LOAD PENDING are released D. Constraint checking conditions are undone E. Existing database connections are released (19/55) Which of the following isolation levels will lock only the rows ret urned in the result set? (Select the correct response) A. Read Stability B. Repeatable Read C. Cursor Stability D. Uncommitted Read (20/55)A user has a numeric data column with a maximum value of 100,000. Wh ich of the following data types will use the minimum amount of storage for th e column? (Select the correct response) A. IDENTITY B. BIGINT C. INTEGER D. SMALLINT (21/55) Which of the following is the most appropriate reason to consider r evoking the SELECT privilege on the catalog tables from PUBLIC after creating
  • 32.
    a database? (Select thecorrect response) A. To prevent users from creating tables without proper authority. B. Some system catalogs record user data in some columns, and this data may b e confidential. C. To prevent users from viewing passwords for other DB2 userids that DB2 sto res in the catalog tables. D. Some catalog tables are large, so preventing users from viewing them is a good way to keep users from submitting long-running queries against the catal ogs. (22/55) Given the table definition: DEFIN1 Id SMALLINT NOT NULL Name VARCHAR(30) Hired DATE DEFIN2: Deptid SMALLINT NOT NULL Name VARCHAR(30) Started DATE Which of the following statements will insert successfully into table DEFIN1? (Select the correct response) A. INSERT INTO defin1 (id) VALUES (1) B. INSERT INTO defin1 (name) VALUES ('Florence') C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE FROM def in2 D. INSERT INTO defin1 (name, hired) SELECT DISTINCT 'Florence', CURRENT DATE FROM defin2 (23/55) Which of the following statements will create an index and prevent table T1 from containing two or more rows with the same values for column C1? (Select the correct response) A. CREATE UNIQUE INDEX ix4 ON t1 (c1) B. CREATE DISTINCT INDEX ix1 ON t1 (c1) C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2) D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2) (24/55) A table called EMPLOYEE has columns: name, department, and phone_nu mber. Which of the following can limit access to the phone_number column? (Select the correct response) A. Using a view to access the table B. Using an index on the column C. Using a referential constraint on the table D. Using a table check constraint on the table E. Revoking access from the phone_number column (25/55) Which of the following is the result of the following SQL statement
  • 33.
    : CREATE UNIQUE INDEXempno_ind ON employee (empno) (Select the correct response) A. Every value for EMPNO must be unique. B. UPDATE statements on EMPNO will be rolled back. C. Insert statements on EMPNO will always be faster. D. Insert statements on the EMPNO table will result in clustered data. (26/55)Which of the following DB2 components can limit the resource consump tion of queries? (Select the correct response) A. DB2 Connect B. DB2 Query Patroller C. DB2 Performance Monitor D. DB2 Net Search Extender (27/55) Given the following table with a primary key on empid: Emp: Empid Name 11 Joe Smith 23 Melanie Jones 30 Robert Bruce 49 Janice Baker 66 Mario Diaz 68 Maria Diaton Give the following statement in an embedded SQL program bound with Repeatable Read: Select * from Emp where empid < 55 How many rows in the table will be locked after the statement is run? (Select the correct response) A. 0 B. 1 C. 4 D. 5 E. 6 (28/55)Which of the following products can be used to perform a dictionary- based search? (Select the correct response) A. Net.Data B. XML Extender C. AVI Extender D. Text Extender (29/55)Which two of the following modes can be used on the lock table state ment? (Select all that apply) A. SHARE MODE B. EXCLUSIVE MODE
  • 34.
    C. REPEATABLE READMODE D. UNCOMMITTED READ MODE E. INTENT EXCLUSIVE MODE (30/55)Which of the following does NOT end a unit of work? (Select the correct response) A. COMMIT B. ROLLBACK C. TERMINATE D. SAVEPOINT E. CONNECT RESET (31/55) Which of the following must be set up to allow the Control Center t o view database objects? (Select the correct response) A. ODBC B. JAVA C. DB2 Administration Server D. Client Configuration Assistant (32/55)Which of the following is the best way to restrict user access to a subset of columns in a table? (Select the correct response) A. Only grant access to the columns within a table that a user is allowed to see. B. Create a view that only includes the columns a user is allowed to see. Gra nt the user access to the view, not the base table. C. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a join when all data must be presented. D. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a union when all data must be presented. (33/55)How many DB2 Administration Server (DAS) Instances can be set up per physical machine? (Select the correct response) A. 0 B. 1 C. One for each instance on the physical machine D. One for each database on the physical machine (34/55) Given the table T1, created by: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued:
  • 35.
    INSERT INTO t1VALUES (1, 'ABC') INSERT INTO t1 VALUES (5, 'DEF') Which of the following values are inserted into the ID column by the followin g statement? INSERT INTO t1(c1) VALUES ('XYZ') (Select the correct response) A. 0 B. 1 C. 2 D. 5 E. 6 (35/55)Given the following transaction: CREATE TABLE dwaine.mytab (col1 INT, col2 INT) INSERT INTO dwaine.mytab VALUES (1,2) INSERT INTO dwaine.mytab VALUES (4,3) ROLLBACK Which of the following would be returned from the statement: SELECT * FROM dwaine.mytab? (Select the correct response) A. COL1 COL2 --------------- -------------- 0 record(s)selected. B. COL1 COL2 --------- -------- 1 2 1 record(s) selected. C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name. D. COL1 COL2 -------- ------- 1 2 4 3 2 record(s) selected. (36/55)Given the following: TAB1 TAB2 C1 C2 CX CY ------ ------ ----- ----- A 11 A 21 B 12 B 22 C 13 C 23 The following results are desired: C1 C2 CX CY ----- ----- ----- ------ A 11 A 21 C 13 C 22 --- ---- D 23 Which of the following joins will yield the desired results?
  • 36.
    (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=cx B. SELECT * FROM tab1 INNER 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 (37/55) Given the following embedded SQL programs: Program 1: CREATE TABLE mytab (col1 INT, col2 CHAR(24)) COMMIT Program 2: INSERT INTO mytab VALUES ( 20989,'Joe Smith') INSERT INTO mytab VALUES ( 21334,'Amy Johnson') COMMIT DELETE FROM mytab ROLLBACK INSERT INTO mytab VALUES ( 23430,'Jason French') ROLLBACK INSERT INTO mytab VALUES ( 20993,'Samantha Jones') COMMIT DELETE FROM mytab WHERE col1=20993 ROLLBACK Which of the following indicates the number of records that will be returned by the statement: SELECT * FROM mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 E. 4 (38/55)Given the statement: CREATE TABLE t1 (c1 CHAR(1)) Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol lowing command is issued: ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a') Which of the following occurs? (Select the correct response) A. Rows with c1 values of b,c,d,e,f are deleted B. Rows with c1 values of b,c,d,e,f have c1 set to NULL C. The ALTER command will fail as rows violate the constraint D. The ALTER command will move the violating rows to the exception table (39/55)Given the two following tables: Points Name Points Wayne Gretzky 244 Jaromir Jagr 168
  • 37.
    Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 PIM Name PIM Mats Sundin 14 Jaromir Jagr 18 Bobby Orr 12 Mark Messier 32 Brett Hull 66 Mario Lemieux 23 Joe Sakic 94 Which of the following statements will display the player's Names, points and PIM for all players? (Select the correct response) A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI N pim ON points.name=pim.name B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE R JOIN pim ON points.name=pim.name C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTE R JOIN pim ON points.name=pim.name D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT ER JOIN pim ON points.name=pim.name (40/55) Which of the following products must be installed to provide a sing le point of control for local and remote DB2 databases? (Select the correct response) A. DB2 Runtime Client B. DB2 Administration Client C. DB2 Connect Enterprise Edition D. DB2 Enterprise-Extended Edition (41/55)Which of the following tools maintains a history of all executed sta tements/commands for the current session within the tool? (Select the correct response) A. Journal B. SQL Assist C. DB2 Alert Center D. DB2 Command Center (42/55) Using the Control Center Create Table dialog box, which of the foll owing dialogs allows the table creation DDL to be viewed? (Select the correct response) A. Copy B. Show SQL C. Show Related D. Sample Contents
  • 38.
    (43/55)Which of thefollowing processing can occur for a unit of work using an isolation level of Cursor Stability and allows scanning through the table more than once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Have updated result set rows changed by other processes from one scan to t he next D. Have accessed result set rows changed by other processes from one scan to the next (44/55)Given the table: COUNTRY ID NAME PERSON CITY 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10 4 Germany 1 0 5 France 7 5 Which of the following clauses when added to the statement SELECT cities, name FROM country returns rows sorted by NAME and then sorted by the number of cities (CITIES)? (Select the correct response) A. ORDER BY 2,1 B. GROUP BY 2, 1 C. ORDER BY cities, name D. GROUP BY cities, name (45/55) Which of the following DB2 data types is used to store 50 MB of bin ary data as a single value? (Select the correct response) A. BLOB B. CLOB C. DBCLOB D. FOR BIT DATA E. VARCHAR FOR BIT DATA (46/55)Which one of the following SQL statements sets the default qualifier to "user1"? (Select the correct response) A. SET CURRENT ID = 'user1' B. SET CURRENT USER = 'user1' C. SET CURRENT SQLID = 'user1' D. SET CURRENT QUALIFIER = 'user1' (47/55)Which of the following privileges is necessary to populate the table with large amounts of data?
  • 39.
    (Select the correctresponse) A. LOAD B. ALTER C. UPDATE D. IMPORT (48/55)For which of the following can locks be obtained? (Select the correct response) A. A trigger B. A table view C. A table column D. A database buffer E. A row referenced by an index key (49/55)Which of the following is possible once a user has been given mainte nance authority? (Select the correct response) A. DB2 userids can be created. B. Views can be created on the catalogs. C. Statistics can be collected for database objects. D. A table can be populated by using the LOAD command. (50/55)With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (51/55) Given the following DDL statements, CREATE TABLE t1 (a INT, b INT, c INT) CREATE VIEW v1 AS SELECT a, b, c FROM t1 WHERE a > 250 WITH CHECK OPTION Which of the following INSERT statements will fail? (Select the correct response) A. INSERT INTO t1 VALUES (200, 2, 3) B. INSERT INTO v1 VALUES (200, 2, 3) C. INSERT INTO t1 VALUES (300, 2, 3) D. INSERT INTO v1 VALUES (300, 2, 3) (52/55)Given table T1 with 100 rows, which of the following queries will re trieve 10 rows from table T1?
  • 40.
    (Select the correct response) A. SELECT * FROM t1 MAXIMUM 10 ROWS B. SELECT * FROM t1 READ 10 ROWS ONLY C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY (53/55)Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, it should only change if another agent unassigns a currently assigned sea t. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read (54/55)With tables defined as: Table1 col1 INT col2 CHAR(30) Table2 col1 INT col2 CHAR(30) Which of the following statements will insert all the rows in TABLE2 into TAB LE1? (Select the correct response) A. INSERT INTO table1 SELECT col1, col2 FROM table2 B. INSERT INTO table1 AS SELECT col1, col2 FROM table2 C. INSERT INTO table1 VALUES (table2.col1, table2.col2) D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2) E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2) (55/55)Given the following table definitions: DEPARTMENT Deptno CHAR(30) Deptname CHAR(30) Mgrno INTEGER Admrdept CHAR(3) EMPLOYEE Empno INTEGER Firstname CHAR(30) Midinit CHAR
  • 41.
    Lastname CHAR(30) Workdept CHAR(3) Whichof the following statements will list the employee's employee number, l ast name, and department name ONLY for those employees who have a department? (Select the correct response) A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE e.workdept = d.deptno B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep artment d ON e.workdept = d.deptno C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep artment d ON e.workdept = d.deptno D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de partment d WHERE e.workdept = d.deptno ********************************************************** 自测题 4 -------------------------------------------------------------------------------- (1/55). Which of the following tasks can be performed using the ALTER TABLES PACE statement? (Select the correct response) A. Assign a bufferpool. B. Change the table space name. C. Change the type of the table space. D. Change the page size of the table space. (2/55). 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. Smiths The statement: SELECT * FROM staff,country
  • 42.
    will return howmany rows? (Select the correct response) A.2 B.4 C.5 D.7 E.10 (3/55). Which of the following products can be used to generate Extensible Ma rkup Language documents from DB2 tables? (Select the correct response) A. Net Search B. XML Extender C. AVI Extender D. TXT Extender (4/55). Which of the following SQL statements can remove all rows from a tabl e named COUNTRY? (Select the correct response) A.DELETE country B.DELETE FROM country C.DELETE * FROM country D.DELETE ALL FROM country (5/55). Which of the following tools can be used to identify inefficient SQL statements without executing the query? (Select the correct response) A. QMF B. Script Center C. Visual Explain D. Performance Monitor (6/55) Given the statement: CREATE TABLE t1 ( c1 INTEGER NOT NULL, c2 INTEGER, PRIMARY KEY(c1), FOREIGN KEY(c2) REFERENCES t2 ) How many non-unique indexes are defined for table t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3
  • 43.
    (7/55) Given twoembedded SQL program executions with the following actions: Pgm1 INSERT INTO mytab VALUES (...) COMMIT INSERT INTO mytab VALUES (...) ROLLBACK Pgm2 INSERT INTO mytab VALUES (...) ROLLBACK INSERT INTO mytab VALUES (...) COMMIT How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A. 1 B. 2 C. 3 D. 4 (8/55) Given the following DDL statement: CREATE TABLE newtab1 LIKE tab1 Which of the following would occur as a result of the statement execution? (Select the correct response) A NEWTAB1 has same triggers as TAB1 B NEWTAB1 is populated with TAB1 data C NEWTAB1 has the same primary key as TAB1 D NEWTAB1 columns have same attributes as TAB1 (9/55) Which of the following describes when indexes can be explicitly refer enced by name within an SQL statement? (Select the correct response) A. When dropping the index B. When updating the index C. When selecting on the index D. When inserting using the index (10/55) Which of the following can be accomplished with a single UPDATE stat ement? (Select the correct response) A. Updating multiple tables B. Updating a view consisting of joined tables C. Updating multiple tables based on a WHERE clause D. Updating a table based on a sub-select using joined tables
  • 44.
    (11/55) Which ofthe following is NOT a valid data type on CREATE TABLE? (Select the correct response) A. CLOB B. DOUBLE C. NUMERIC D. DATETIME (12/55) Given the statement: CREATE TABLE t1 ( c1 CHAR(3) CONSTRAINT c1 CHECK (c1 IN ('A01','B01','C01')) ) DB2 verifies that the table check constraint is met during which of the follo wing actions? (Select the correct response) A. Adding data using load B. The reorg of the table C. The insert of each row in t1 D. The creation of the index for the table (13/55) If a DB2 Warehouse Manager toolkit is selected during the installati on of DB2 UDB Version 7.1, which of the following databases must be defined? (Select the correct response) A. None B. Target Database C. Source Database D. Control Database (14/55) With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a' INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3
  • 45.
    (15/55) Which ofthe following occurs if an application ends abnormally duri ng an active unit of work? (Select the correct response) A. Current unit of work is committed B. Current unit of work is rolled back C. Current unit of work remains active D. Current unit of work moves to pending state (16/55) Which of the following Control Center features can be used to update information for the optimizer to choose the best path to data? (Select the correct response) A. Show Related B. Generate DDL C. Run Statistics D. Reorganize Table (17/55) Given the following: TAB1 TAB2 C1 C2 CX CY -- -- -- -- A 11 A 21 B 12 B 22 C 13 C 23 The following results are desired: C1 C2 CX CY -- -- -- -- A 11 A 21 B 12 -- -- C 13 C 22 Which of the following joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=cx B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx (18/55) Given the following table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm DECIMAL(10,2) The job column contains these job types: manager, clerk, and salesperson. Whi
  • 46.
    ch of thefollowing statements will return the data with all managers togethe r, all clerks together and all salespeople together in the output? (Select the correct response) A. SELECT * FROM staff ORDER BY job B. SELECT job, name FROM staff GROUP BY name, job C. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm. D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm.] (19/55) Which of the following types of DB2 locks allows for the most concur rency within a table? (Select the correct response) A. A row lock B. A page lock C. A field lock D. A column lock (20/55) Which of the following CANNOT be used to restrict specific values fr om being inserted into a column in a particular table? (Select the correct response) A. view B. index C. check constraint D. referential constraint (21/55) Which of the following describes why savepoints are NOT allowed insi de an atomic unit of work? (Select the correct response) A. Atomic units of work span multiple databases, but savepoints are limited t o units of work which operate on a single database. B. A savepoint implies that a subset of the work may be allowed to succeed, w hile atomic operations must succeed or fail as a unit. C. A savepoint requires an explicit commit to be released, and commit stateme nts are not allowed in atomic operations such as compound SQL. D. A savepoint cannot be created without an active connection to a database, but atomic operations can contain a CONNECT as a sub-statement. (22/55) Given the tables: TABLEA TABLEB Empid name empid weeknumber paycheck 1 JOE 1 1 1000.00 2 BOB 1 2 1000.00 2 1 2000.00 TABLEB was defined as follows: CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2) ,
  • 47.
    CONSTRAINT const1 FOREIGNKEY (empid) REFERENCES tablea (empid) ON DELETE SET NULL) How many rows would be deleted from tableb if the following command is issued : DELETE FROM tablea WHERE empid = '2'? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (23/55) Which two of the following DB2 authorization groups are authorized t o create a table within database sample? (Select all that apply) A. DBADM B. DBCTRL C. SYSADM D. DBMAINT E. ALTERIN F. SYSMAINT (24/55) Given the table T1 created by: CREATE TABLE t1 ( id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, c1 CHAR(10) NOT NULL, c2 CHAR(10) ) Which of the following INSERT statements will succeed? (Select the correct response) A. INSERT INTO t1 VALUES (1, 'abc', NULL) B. INSERT INTO t1 VALUES (1, NULL, 'def') C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL) D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def') (25/55) Given the two following tables: Names Name Number Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Steve Yzerman 19 Claude Lemieux 19
  • 48.
    Mark Messier 11 MatsSundin 13 Points Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94 Which of the following statements will display the player's Names, numbers an d points for all players with an entry in both tables? (Select the correct response) A. SELECT names.names, names.number, points.points FROM names INNER JOIN poin ts ON names.name=points.name B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN points ON names.name=points.name C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name (26/55) For which of the following database objects can locks be obtained? (Select the correct response) A. View B. Table C. Trigger D. Buffer Pool (27/55) When granted to user1, which of the following will allow user1 to ONL Y access table data? (Select the correct response) A. DBADM authority B. SYSADM authority C. SELECT privilege on the table D. SELECT privilege WITH GRANT OPTION on the table (28/55) Given the following SQL statements: CREATE TABLE tab1 (col1 INT) CREATE TABLE tab2 (col1 INT) INSERT INTO tab1 VALUES (NULL),(1) INSERT INTO tab2 VALUES (NULL),(1) SELECT COUNT(*) FROM tab1 WHERE col1 IN (SELECT col1 FROM tab2) Which of the following is the result of the SELECT COUNT(*) statement?
  • 49.
    (Select the correctresponse) A. 1 B. 2 C. 3 D. 4 E. 0 (29/55) User2 has DBADM authority on database DB1. This allows the user to d o which of the following? (Select the correct response) A. Drop database DB1 B. Backup database DB1 C. Create tables in any database D. Create tables in database DB1 (30/55) When establishing client-server communication, passwords CANNOT be v erified by: (Select the correct response) A. The DRDA DB2 server. B. The client operating system. C. The gateway operating system. D. Looking in the catalog tables for the password. (31/55) Given an application bound with cursor stability which will be updat ing rows in a table and obtaining row locks, which of the following table loc ks will DB2 acquire for the application first? (Select the correct response) A. U – update B. X – exclusive C. IU - intent update D. IX - intent exclusive (32/55) The user USER1 is executing the statement CREATE TABLE app1.table1 (col1 INT, col2 INT) Which of the following privileges is required by USER1 for the statement to b e successful? (Select the correct response) A. CREATEIN for the database B. CREATEIN for the schema app1 C. CREATEIN for the schema user1 D. CREATEIN for the table table1 (33/55) Which of the following can occur once connected to a database or DRD A server with an explicit authorization name? (Select the correct response) A. Omit a user's password. B. Change a user's password if the server supports this function. C. Omit the name of the database or DRDA server if it is local. D. Use the commit option on the connect statement to commit in-doubt units of
  • 50.
    work from aprevious connection that was terminated. (34/55) Given the two following 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(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) Which of the following statements will display each department, by name, and the total salary of all employees in the department? (Select the correct response) A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt ORDER BY a.deptname B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt ORDER BY a.deptname C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt GROUP BY a.deptname D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt GROUP BY a.deptname (35/55) Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, the list should not change. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read (36/55) The DB2 Administration Server (DAS) is required for which of the fol lowing? (Select the correct response) A. For the administrator user id to install or remove DB2 B. For the remote clients to use the Control Center against the instance
  • 51.
    C. For checkingauthorities in the database manager configuration for SYSADM D. For maintaining authorities added and removed by the SQL GRANT and REVOKE commands respectively (37/55) Given the following scenario: An application uses a 15 digit value t o uniquely identify customer transactions. This number is also used for arith metic operations. Which of the following is the most efficient DB2 data type for the column definition for this purpose? (Select the correct response) A. CHAR B. CLOB C. INTEGER D. NUMERIC(15,2) E. DECIMAL(15,0) (38/55) Given a table T1, with a column C1 char(3), that contains strings in upper and lower case letters, which of the following queries will find all r ows where C1 is the string 'ABC' in any case? (Select the correct response) A. SELECT * FROM t1 WHERE c1 = 'ABC' B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC' C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC') D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE (39/55) Which two of the following SQL data types should be used to store bi nary data? (Select all that apply) A. CLOB B. BLOB C. VARCHAR D. GRAPHIC E. VARCHAR FOR BIT DATA (40/55) In which of the following locations are the referential constraints stored? (Select the correct response) A. The user tables. B. The explain tables. C. SYSIBM.SYSTRIGGERS. D. The system catalog tables. (41/55) Which of the following is the result of the following SQL statement: ALTER TABLE table1 ADD col2 INT WITH DEFAULT (Select the correct response) A. The statement fails with a negative SQL code. B. The statement fails because no default value is specified. C. A new column called COL2 is added to TABLE1 and populated with zeros.
  • 52.
    D. A newcolumn called COL2 is added to TABLE1 and populated with nulls. (42/55) A user creates the table TABLE1. Which of the following statements w ould explicitly give USER1 the ability to read rows from the table? (Select the correct response) A. GRANT VIEW TO user1 ON TABLE table1 B. GRANT READ TO user1 ON TABLE table1 C. GRANT SELECT ON TABLE table1 TO user1 D. GRANT ACCESS ON TABLE table1 TO user1 (43/55) Which of the following tools allows the DBA to set limits, and be al erted if these limits are exceeded? (Select the correct response) A. DB2 Index Wizard B. DB2 Script Center C. DB2 Command Center D. DB2 Performance Monitor (44/55) Given the following embedded SQL programs: Program 1: Create table mytab (col1 int, col2 char(24)) Commit Program 2: Insert into mytab values ( 20989,'Joe Smith') Commit Insert into mytab values ( 21334,'Amy Johnson') Delete from mytab Commit Insert into mytab values ( 23430,'Jason French') Rollback Insert into mytab values ( 20993,'Samantha Jones') Commit Delete from mytab where col1=20993 Rollback Which of the following records will be returned by the statement SELECT * FROM mytab? (Select the correct response) A. 20989, Joe Smith B. 21334, Amy Johnson C. 23430, Jason French D. 20993, Samantha Jones E. No records are returned (45/55) Which of the following DB2 components allows the analysis of multidi mensional databases? (Select the correct response) A. DB2 Runtime Client B. DB2 Control Center C. DB2 OLAP Starter Kit
  • 53.
    D. DB2 SpatialExtender E. DB2 Performance Monitor (46/55) Which of the following DB2 UDB isolation levels will NOT lock any r ows during read processing? (Select the correct response) A. Read Stability B. Repeatable Read C. Uncommited Read D. Cursor Stability (47/55) Given the following table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm DECIMAL(10,2) Which of the following SQL statements will return the total number of employe es in each department and the corresponding department id under the following conditions: Only return departments with at least one employee receiving a commission gre ater than 5000. The result should be sorted by the department count from most to least. (Select the correct response) A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER BY 2 DESC B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER BY 2 DESC C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORD ER BY 2 DESC D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, c omm ORDER BY 3 DESC (48/55) Which of the following utilities can examine a table and its indexes and update the system catalogs with the table's statistical information? (Select the correct response) A. runstats B. getstats C. check index D. chkstats (49/55) Which of the following Control Center options shows the dependencies between a specific view and its tables? (Select the correct response) A. Show SQL B. Show Related
  • 54.
    C. Sample Contents D.Customize Columns (50/55) Given the table COUNTRY and the statements below COUNTRY ID NAME PERSON_ID CITIES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10] 4 Germany 1 0 5 France 7 5 DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam e OPEN c1 FETCH c1 FETCH c1 COMMIT FETCH c1 Which of the following is the last name obtained from the table? (Select the correct response) A. Cuba B. France C. Canada D. Germany E. Argentina (51/55) To set up a client that can access DB2 UDB through DB2 Connect Ente rprise Edition, which of the following is the minimum software client that mu st be installed? (Select the correct response) A. DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client (52/55) Which of the following authorities should be given to the DB2 Admini stration Server (DAS) Instance owner at the administered instance? (Select the correct response) A. DBADM B. SYSADM C. SYSCTRL D. SYSMAINT (53/55) For a clustering index to be effective in keeping the data in order, which of the following parameters must be set correctly for the index? (Select the correct response) A. FREE ROWS B. PERCENT FREE C. CLUSTERRATIO
  • 55.
    D. CLUSTER FACTOR (54/55)Which of the following processing can occur for a unit of work using an isolation level of Read Stability and scanning through the table more tha n once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Rows added to a result set by other processes from one scan to the next D. Rows changed in a result set by other processes from one scan to the next (55/55) Given a table T1, with a column C1 char(3), that contains strings in upper and lower case letters, which of the following queries will find all r ows where C1 is the string 'ABC' in any case? (Select the correct response) A. SELECT * FROM t1 WHERE c1 = 'ABC' B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC' C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC') D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE ********************************************************* 自测题 5 -------------------------------------------------------------------------------- (1/55) When granted to user1, which of the following will allow user1 to ONLY access table data? (Select the correct response) A. DBADM authority B. SYSADM authority C. SELECT privilege on the table D. SELECT privilege WITH GRANT OPTION on the table (2/55) Given the statement: CREATE TABLE t1 ( c1 INTEGER NOT NULL, c2 INTEGER, PRIMARY KEY(c1), FOREIGN KEY(c2) REFERENCES t2 ) How many non-unique indexes are defined for table t1? (Select the correct response)
  • 56.
    A. 0 B. 1 C. 2 D. 3 (3/55) Which two of the following DB2 authorization groups are authorized to create a table within database sample? (Select all that apply) A. DBADM B. DBCTRL C. SYSADM D. DBMAINT E. ALTERIN F. SYSMAINT (4/55) Given the following table definition: STAFF id INTEGER name CHAR(20) dept INTEGER job CHAR(20) years INTEGER salary DECIMAL(10,2) comm DECIMAL(10,2) The job column contains these job types: manager, clerk, and salesperson. Whi ch of the following statements will return the data with all managers togethe r, all clerks together and all salespeople together in the output? (Select the correct response) A. SELECT * FROM staff ORDER BY job B. SELECT job, name FROM staff GROUP BY name, job C. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm (5/55) Which of the following describes why savepoints are NOT allowed insid e an atomic unit of work? (Select the correct response) A. Atomic units of work span multiple databases, but savepoints are limi ted to units of work which operate on a single database. B. A savepoint implies that a subset of the work may be allowed to succe ed, while atomic operations must succeed or fail as a unit. C. A savepoint requires an explicit commit to be released, and commit st atements are not allowed in atomic operations such as compound SQL. D. A savepoint cannot be created without an active connection to a datab ase, but atomic operations can contain a CONNECT as a sub-statement.
  • 57.
    (6/55) Given thetwo following tables: Names Name Number Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Steve Yzerman 19 Claude Lemieux 19 Mark Messier 11 Mats Sundin 13 Points Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94 Which of the following statements will display the player's Names, numbers an d points for all players with an entry in both tables? (Select the correct response) A. SELECT names.names, names.number, points.points FROM names INNER JOIN points ON names.name=points.name B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN points ON names.name=points.name C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name (7/55) Given the following scenario: An application uses a 15 digit value to uniquely identify customer transactions. This number is also used for arithm etic operations. Which of the following is the most efficient DB2 data type f or the column definition for this purpose? (Select the correct response) A. CHAR B. CLOB C. INTEGER D. NUMERIC(15,2) E. DECIMAL(15,0) (8/55) Which of the following can be accomplished with a single UPDATE state ment?
  • 58.
    (Select the correct response) A. Updating multiple tables B. Updating a view consisting of joined tables C. Updating multiple tables based on a WHERE clause D. Updating a table based on a sub-select using joined tables (9/55) 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: SELECT * FROM staff, country will return how many rows? (Select the correct response) A. 2 B. 4 C. 5 D. 7 E. 10 (10/55) A user creates the table TABLE1. Which of the following statements w ould explicitly give USER1 the ability to read rows from the table? (Select the correct response) A. GRANT VIEW TO user1 ON TABLE table1 B. GRANT READ TO user1 ON TABLE table1 C. GRANT SELECT ON TABLE table1 TO user1 D. GRANT ACCESS ON TABLE table1 TO user1 (11/55) Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, the list should not change. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability
  • 59.
    D. Uncommitted read (12/55)Which of the following Control Center options shows the dependencies between a specific view and its tables? (Select the correct response) A. Show SQL B. Show Related C. Sample Contents D. Customize Columns (13/55) Given the following:TAB1 TAB2 C1 C2 CX CY -- -- -- -- A 11 A 21 B 12 C 22 C 13 D 23 The following results are desired:C1 C2 CX CY -- -- -- -- A 11 A 21 B 12 - - C 13 C 22 Which of the following joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=cx B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx (14/55) To set up a client that can access DB2 UDB through DB2 Connect Enter prise Edition, which of the following is the minimum software client that mus t be installed? (Select the correct response) A. DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client (15/55) The user USER1 is executing the statement CREATE TABLE app1.table1 (col1 INT, col2 INT) Which of the following privileges is required by USER1 for the statement to b e successful? (Select the correct response) A. CREATEIN for the database B. CREATEIN for the schema app1 C. CREATEIN for the schema user1 D. CREATEIN for the table table1 (16/55) Which of the following DB2 components allows the analysis of multidi
  • 60.
    mensional databases? (Select thecorrect response) A. DB2 Runtime Client B. DB2 Control Center C. DB2 OLAP Starter Kit D. DB2 Spatial Extender E. DB2 Performance Monitor (17/55) Which of the following tools can be used to identify inefficient SQL statements without executing the query? (Select the correct response) A. QMF B. Script Center C. Visual Explain D. Performance Monitor (18/55) When establishing client-server communication, passwords CANNOT be v erified by: (Select the correct response) A. The DRDA DB2 server. B. The client operating system. C. The gateway operating system. D. Looking in the catalog tables for the password. (19/55) Which two of the following SQL data types should be used to store bi nary data? (Select all that apply) A. CLOB B. BLOB C. VARCHAR D. GRAPHIC E. VARCHAR FOR BIT DATA (20/55) Which of the following occurs if an application ends abnormally duri ng an active unit of work? (Select the correct response) A. Current unit of work is committed B. Current unit of work is rolled back C. Current unit of work remains active D. Current unit of work moves to pending state (21/55) Which of the following products can be used to generate Extensible M arkup Language documents from DB2 tables? (Select the correct response) A. Net Search B. XML Extender C. AVI Extender D. Text Extender
  • 61.
    (22/55) Which ofthe following SQL statements can remove all rows from a tab le named COUNTRY? (Select the correct response) A. DELETE country B. DELETE FROM country C. DELETE * FROM country D. DELETE ALL FROM country (23/55) Given the statement: CREATE TABLE t1 ( c1 CHAR(3) CONSTRAINT c1 CHECK (c1 IN ('A01','B01','C01')) ) DB2 verifies that the table check constraint is met during which of the follo wing actions? (Select the correct response) A. Adding data using load B. The reorg of the table C. The insert of each row in t1 D. The creation of the index for the table (24/55) Given the following DDL statement: CREATE TABLE newtab1 LIKE tab1 Which of the following would occur as a result of the statement execution? (Select the correct response) A. NEWTAB1 has same triggers as TAB1 B. NEWTAB1 is populated with TAB1 data C. NEWTAB1 has the same primary key as TAB1 D. NEWTAB1 columns have same attributes as TAB1 (25/55) Which of the following authorities should be given to the DB2 Admini stration Server (DAS) Instance owner at the administered instance? (Select the correct response) A. DBADM B. SYSADM C. SYSCTRL D. SYSMAINT (26/55) Which of the following is the result of the following SQL statement: ALTER TABLE table1 ADD col2 INT WITH DEFAULT (Select the correct response) A. The statement fails with a negative SQL code. B. The statement fails because no default value is specified. C. A new column called COL2 is added to TABLE1 and populated with zeros. D. A new column called COL2 is added to TABLE1 and populated with nulls.
  • 62.
    E. A newcolumn called COL2, which cannot contain nulls, is added to TAB LE1. (27/55) Given the following table definition: STAFF id INTEGER name CHAR(20) dept INTEGER job CHAR(20) years INTEGER salary DECIMAL(10,2) comm DECIMAL(10,2) Which of the following SQL statements will return the total number of employe es in each department and the corresponding department id under the following conditions: Only return departments with at least one employee receiving a commission gre ater than 5000. The result should be sorted by the department count from most to least. (Select the correct response) A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORD ER BY 2 DESC B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORD ER BY 2 DESC C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, com m ORDER BY 2 DESC D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY de pt, comm ORDER BY 3 DESC (28/55) Which of the following Control Center features can be used to update information for the optimizer to choose the best path to data? (Select the correct response) A. Show Related B. Generate DDL C. Run Statistics D. Reorganize Table (29/55) Which of the following can occur once connected to a database or DRD A server with an explicit authorization name? (Select the correct response) A. Omit a user's password. B. Change a user's password if the server supports this function. C. Omit the name of the database or DRDA server if it is local. D. Use the commit option on the connect statement to commit in-doubt uni ts of work from a previous connection that was terminated. (30/55) If a DB2 Warehouse Manager toolkit is selected during the installati on of DB2 UDB Version 7.1, which of the following databases must be defined?
  • 63.
    (Select the correctresponse) A. None B. Target Database C. Source Database D. Control Database (31/55) Which of the following CANNOT be used to restrict specific values fr om being inserted into a column in a particular table? (Select the correct response) A. view B. index C. check constraint D. referential constraint (32/55) For which of the following database objects can locks be obtained? (Select the correct response) A. View B. Table C. Trigger D. Buffer Pool (33/55) Which of the following types of DB2 locks allows for the most concur rency within a table? (Select the correct response) A. A row lock B. A page lock C. A field lock D. A column lock (34/55) Given the following embedded SQL programs: Program 1: Create table mytab (col1 int, col2 char(24)) Commit Program 2: Insert into mytab values ( 20989,'Joe Smith') Commit Insert into mytab values ( 21334,'Amy Johnson') Delete from mytab Commit Insert into mytab values ( 23430,'Jason French') Rollback Insert into mytab values ( 20993,'Samantha Jones') Commit Delete from mytab where col1=20993 Rollback Which of the following records will be returned by the statement SELECT * FROM mytab? (Select the correct response) A. 20989, Joe Smith
  • 64.
    B. 21334, Amy Johnson C. 23430, Jason French D. 20993, Samantha Jones E. No records are returned (35/55) Given a table T1, with a column C1 char(3), that contains strings in upper and lower case letters, which of the following queries will find all r ows where C1 is the string 'ABC' in any case? (Select the correct response) A. SELECT * FROM t1 WHERE c1 = 'ABC' B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC' C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC') D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE (36/55) In which of the following locations are the referential constraints stored? (Select the correct response) A. The user tables. B. The explain tables. C. SYSIBM.SYSTRIGGERS. D. The system catalog tables. (37/55) Given the table T1 created by: CREATE TABLE t1 ( id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, c1 CHAR(10) NOT NULL, c2 CHAR(10) ) Which of the following INSERT statements will succeed? (Select the correct response) A. INSERT INTO t1 VALUES (1, 'abc', NULL) B. INSERT INTO t1 VALUES (1, NULL, 'def') C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL) D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def') (38/55) For a clustering index to be effective in keeping the data in order, which of the following parameters must be set correctly for the index? (Select the correct response) A. FREE ROWS B. PERCENT FREE C. CLUSTERRATIO D. CLUSTER FACTOR (39/55) Which of the following is NOT a valid data type on CREATE TABLE? (Select the correct response) A. CLOB B. DOUBLE C. NUMERIC
  • 65.
    D. DATETIME (40/55) User2has DBADM authority on database DB1. This allows the user to d o which of the following? (Select the correct response) A. Drop database DB1 B. Backup database DB1 C. Create tables in any database D. Create tables in database DB1 (41/55) Which of the following describes when indexes can be explicitly refe renced by name within an SQL statement? (Select the correct response) A. When dropping the index B. When updating the index C. When selecting on the index D. When inserting using the index (42/55) The DB2 Administration Server (DAS) is required for which of the fol lowing? (Select the correct response) A. For the administrator user id to install or remove DB2 B. For the remote clients to use the Control Center against the instance C. For checking authorities in the database manager configuration for SY SADM D. For maintaining authorities added and removed by the SQL GRANT and RE VOKE commands respectively (43/55) Which of the following tasks can be performed using the ALTER TABLES PACE statement? (Select the correct response) A. Assign a bufferpool. B. Change the table space name. C. Change the type of the table space. D. Change the page size of the table space. (44/55) Given the tables: TABLEA TABLEB empid name empid weeknumber paycheck 1 JOE 1 1 1000.00 2 BOB 1 2 1000.00 2 1 2000.00 TABLEB was defined as follows: CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2) , CONSTRAINT const1 FOREIGN KEY (empid)
  • 66.
    REFERENCES tablea (empid)ON DELETE SET NULL) How many rows would be deleted from tableb if the following command is issued : DELETE FROM tablea WHERE empid = '2'? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (45/55) Given an embedded SQL program with a single connection, two threads and the following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT How many records will be successfully inserted into the table mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (46/55) Given the two following 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(20) years INTEGER salary DECIMAL(10,2) comm DECIMAL(10,2) Which of the following statements will display each department, by name, and the total salary of all employees in the department? (Select the correct response) A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb =b.dept ORDER BY a.deptname B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb =b.dept ORDER BY a.deptname C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb
  • 67.
    =b.dept GROUP BYa.deptname D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb =b.dept GROUP BY a.deptname (47/55) Which of the following processing can occur for a unit of work using an isolation level of Read Stability and scanning through the table more tha n once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Rows added to a result set by other processes from one scan to the ne xt D. Rows changed in a result set by other processes from one scan to the next (48/55) Which of the following DB2 UDB isolation levels will NOT lock any ro ws during read processing? (Select the correct response) A. Read Stability B. Repeatable Read C. Uncommited Read D. Cursor Stability (49/55) With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a' INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (50/55) Which of the following tools allows the DBA to set limits, and be al erted if these limits are exceeded? (Select the correct response) A. DB2 Index Wizard B. DB2 Script Center C. DB2 Command Center D. DB2 Performance Monitor (51/55) Which of the following utilities can examine a table and its indexes and update the system catalogs with the table's statistical information? (Select the correct response) A. runstats B. getstats
  • 68.
    C. check index D.chkstats (52/55) Given the following SQL statements: CREATE TABLE tab1 (col1 INT) CREATE TABLE tab2 (col1 INT) INSERT INTO tab1 VALUES (NULL),(1) INSERT INTO tab2 VALUES (NULL),(1) SELECT COUNT(*) FROM tab1 WHERE col1 IN (SELECT col1 FROM tab2) Which of the following is the result of the SELECT COUNT(*) statement? (Select the correct response) A. 1 B. 2 C. 3 D. 4 E. 0 (53/55) Given an application bound with cursor stability which will be updat ing rows in a table and obtaining row locks, which of the following table loc ks will DB2 acquire for the application first? (Select the correct response) A. U - update B. X - exclusive C. IU - intent update D. IX - intent exclusive (54/55) Given the table COUNTRY and the statements below: COUNTRY ID NAME PERSON_ID CITIES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10 4 Germany 1 0 5 France 7 5 DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam e OPEN c1 FETCH c1 FETCH c1 COMMIT FETCH c1 Which of the following is the last name obtained from the table? (Select the correct response) A. Cuba B. France C. Canada
  • 69.
    D. Germany E. Argentina (55/55)Given two embedded SQL program executions with the following actions : Pgm1 INSERT INTO mytab VALUES (...) COMMIT INSERT INTO mytab VALUES (...) ROLLBACK Pgm2 INSERT INTO mytab VALUES (...) ROLLBACK INSERT INTO mytab VALUES (...) COMMIT How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A. 1 B. 2 C. 3 D. 4 *********************************************************** 自测题 6 -------------------------------------------------------------------------------- 1. With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A.0 B.1 C.2 D.3 2. Which of the following Control Center features can be used to update infor
  • 70.
    mation for theoptimizer to choose the best path to data? (Select the correct response) A Show Related B. Generate DDL C. Run Statistics D. Reorganize Table 3. Given the tables: TABLEA TABLEB Empid name empid weeknumber paycheck 1 JOE 1 1 1000.00 2 BOB 1 2 1000.00 2 1 1000.00 TABLEB was defined as follows: CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2) , CONSTRAINT const1 FOREIGN KEY (empid) REFERENCES tablea (empid) ON DELETE SET NULL) How many rows would be deleted from tableb if the following command is issued : DELETE FROM tablea WHERE empid = '2'? (Select the correct response) A.0 B.1 C.2 D.3 4. Which of the following DB2 UDB isolation levels will NOT lock any rows dur ing read processing? (Select the correct response) A. Read Stability B. Repeatable Read C. Uncommited Read D. Cursor Stability 5. Which of the following processing can occur for a unit of work using an is olation level of Read Stability and scanning through the table more than once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Rows added to a result set by other processes from one scan to the next D. Rows changed in a result set by other processes from one scan to the next 6. Which of the following describes when indexes can be explicitly referenced by name within an SQL statement? (Select the correct response) A. When dropping the index B. When updating the index
  • 71.
    C. When selectingon the index D. When inserting using the index 7. Given an embedded SQL program with a single connection, two threads and th e following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A.0 B.1 C.2 D.3 8. A user creates the table TABLE1. Which of the following statements would e xplicitly give USER1 the ability to read rows from the table? (Select the correct response) A. GRANT VIEW TO user1 ON TABLE table1 B. GRANT READ TO user1 ON TABLE table1 C. GRANT SELECT ON TABLE table1 TO user1 D. GRANT ACCESS ON TABLE table1 TO user1 9. Given the following: TAB1 TAB2 C1 C2 CX CY --- --- --- --- A 11 A 21 B 12 C 22 C 13 D 23 The following results are desired: C1 C2 CX CY -- -- -- -- A 11 A 21 B 12 -- -- C 13 C 22 Which of the following joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=cx B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx] C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx 10. Given the following scenario: An application uses a 15 digit value to uni quely identify customer transactions. This number is also used for arithmetic operations. Which of the following is the most efficient DB2 data type for t he column definition for this purpose?
  • 72.
    (Select the correctresponse) A. CHAR B. CLOB C. INTEGER D. NUMERIC(15,2) E. DECIMAL(15,0) 11. Given the table T1 created by: CREATE TABLE t1 ( id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, c1 CHAR(10) NOT NULL, c2 CHAR(10) ) Which of the following INSERT statements will succeed? (Select the correct response) A. INSERT INTO t1 VALUES (1, 'abc', NULL) B. INSERT INTO t1 VALUES (1, NULL, 'def') C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL) D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def') 12. Which of the following tools allows the DBA to set limits, and be alerted if these limits are exceeded? (Select the correct response) A. DB2 Index Wizard B. DB2 Script Center C. DB2 Command Center D. DB2 Performance Monitor 13. To set up a client that can access DB2 UDB through DB2 Connect Enterprise Edition, which of the following is the minimum software client that must be installed? (Select the correct response) A DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client 14. Which of the following describes why savepoints are NOT allowed inside an atomic unit of work? (Select the correct response) A. Atomic units of work span multiple databases, but savepoints are limited t o units of work which operate on a single database. B. A savepoint implies that a subset of the work may be allowed to succeed, w hile atomic operations must succeed or fail as a unit. C. A savepoint requires an explicit commit to be released, and commit stateme nts are not allowed in atomic operations such as compound SQL. D. A savepoint cannot be created without an active connection to a database, but atomic operations can contain a CONNECT as a sub-statement.
  • 73.
    15. Given thefollowing table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) The job column contains these job types: manager, clerk, and salesperson. Whi ch of the following statements will return the data with all managers togethe r, all clerks together and all salespeople together in the output? (Select the correct response) A. SELECT * FROM staff ORDER BY job B. SELECT job, name FROM staff GROUP BY name, job C. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm. D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm. 16. The user USER1 is executing the statement CREATE TABLE app1.table1 (col1 INT, col2 INT) Which of the following privileges is required by USER1 for the statement to b e successful? (Select the correct response) A. CREATEIN for the database B. CREATEIN for the schema app1 C. CREATEIN for the schema user1 D. CREATEIN for the table table1 17. Which of the following DB2 components allows the analysis of multidimensi onal databases? (Select the correct response) A. DB2 Runtime Client B. DB2 Control Center C. DB2 OLAP Starter Kit D. DB2 Spatial Extender E. DB2 Performance Monitor 18. Which of the following utilities can examine a table and its indexes and update the system catalogs with the table's statistical information? (Select the correct response A. runstats B. getstats C. check index D.Chkstats 19. In which of the following locations are the referential constraints store d? (Select the correct response)
  • 74.
    A. The user tables. B. The explain tables. C. SYSIBM.SYSTRIGGERS. D. The system catalog tables. 20. Which two of the following SQL data types should be used to store binary data? (Select all that apply A. CLOB B. BLOB C. VARCHAR D. GRAPHIC E. VARCHAR FOR BIT DATA 21. Given the two following tables: names name number Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Steve Yzerman 19 Claude Lemieux 19 Mark Messier 11 Mats Sundin 13 Points Name points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94 Which of the following statements will display the player's Names, numbers an d points for all players with an entry in both tables? (Select the correct response) A. SELECT names.names, names.number, points.points FROM names INNER JOIN poin ts ON names.name=points.name B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN points ON names.name=points.name C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name
  • 75.
    22. Which twoof the following DB2 authorization groups are authorized to cre ate a table within database sample? (Select all that apply) A DBADM B. DBCTRL C. SYSADM D. DBMAINT E. ALTERIN F. SYSMAINT 23. Which of the following is the result of the following SQL statement: ALTER TABLE table1 ADD col2 INT WITH DEFAULT (Select the correct response) A The statement fails with a negative SQL code B. The statement fails because no default value is specified.. C A new column called COL2 is added to TABLE1 and populated with zeros. D. A new column called COL2 is added to TABLE1 and populated with nulls. E. A new column called COL2, which cannot contain nulls, is added to TABLE1. 24. Which of the following authorities should be given to the DB2 Administrat ion Server (DAS) Instance owner at the administered instance? (Select the correct response) A. DBADM B. SYSADM C. SYSCTRL D. SYSMAINT 25. Which of the following products can be used to generate Extensible Markup Language documents from DB2 tables? (Select the correct response) A. Net Search B. XML Extender C. AVI Extender D. Text Extender. 26. Which of the following can be accomplished with a single UPDATE statement ? (Select the correct response) A. Updating multiple tables B. Updating a view consisting of joined tables C. Updating multiple tables based on a WHERE clause D. Updating a table based on a sub-select using joined tables 27. Given two embedded SQL program executions with the following actions: Pgm1 INSERT INTO mytab VALUES (...) COMMIT INSERT INTO mytab VALUES (...) ROLLBACK
  • 76.
    Pgm2 INSERT INTO mytabVALUES (...) ROLLBACK INSERT INTO mytab VALUES (...) COMMIT How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A.1 B.2 C.3 D.4 28. Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, the list should not change. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read 29. Which of the following Control Center options shows the dependencies betw een a specific view and its tables? (Select the correct response A. Show SQL B. Show Related C. Sample Contents D. Customize Columns 30. Given the following SQL statements: CREATE TABLE tab1 (col1 INT) CREATE TABLE tab2 (col1 INT) INSERT INTO tab1 VALUES (NULL),(1) INSERT INTO tab2 VALUES (NULL),(1) SELECT COUNT(*) FROM tab1 WHERE col1 IN (SELECT col1 FROM tab2) Which of the following is the result of the SELECT COUNT(*) statement? (Select the correct response) A.1 B.2 C.3 D.4
  • 77.
    E.0 31. Given thetable: 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 DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam e OPEN c1 FETCH c1 FETCH c1 COMMIT FETCH c1 Which of the following is the last name obtained from the table? (Select the correct response) A. Cuba B. France C. Canada D. Germany E. Argentina 32. Given the following table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) Which of the following SQL statements will return the total number of employe es in each department and the corresponding department id under the following conditions: Only return departments with at least one employee receiving a commission gre ater than 5000. The result should be sorted by the department count from most to least. (Select the correct response) A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER BY 2 DESC B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER BY 2 DESC C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORD ER BY 2 DESC D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, c omm ORDER BY 3 DESC
  • 78.
    33. Given thestatement: CREATE TABLE t1 ( c1 CHAR(3) CONSTRAINT c1 CHECK (c1 IN ('A01','B01','C01')) ) DB2 verifies that the table check constraint is met during which of the follo wing actions? (Select the correct response) A. Adding data using load B. The reorg of the table C. The insert of each row in t1 D. The creation of the index for the table 34. Which of the following can occur once connected to a database or DRDA ser ver with an explicit authorization name? (Select the correct response) A. Omit a user's password. B. Change a user's password if the server supports this function. C. Omit the name of the database or DRDA server if it is local. D. Use the commit option on the connect statement to commit in-doubt units of work from a previous connection that was terminated. 35. User2 has DBADM authority on database DB1. This allows the user to do whi ch of the following? (Select the correct response) A. Drop database DB1 B. Backup database DB1 C. Create tables in any database D. Create tables in database DB1 36. When establishing client-server communication, passwords CANNOT be verifi ed by: (Select the correct response) A. The DRDA DB2 server. B. The client operating system. C. The gateway operating system. D. Looking in the catalog tables for the password. 37. Given the table: COUNTRY ID NAME PERSON CITIES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10 4 Germany 1 0
  • 79.
    5 France 75 STAFF ID LASTNAME 1 Jones 2 Smith The statement: SELECT * FROM staff, country will return how many rows? (Select the correct response) A.2 B.4 C.5 D.7 E10 38.For a clustering index to be effective in keeping the data in order, whic h of the following parameters must be set correctly for the index? (Select the correct response) A. FREE ROWS B. PERCENT FREE C. CLUSTERRATIO D. CLUSTER FACTOR 39. Given the two following 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(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) Which of the following statements will display each department, by name, and the total salary of all employees in the department? (Select the correct response) A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt ORDER BY a.deptname B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt ORDER BY a.deptname C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt GROUP BY a.deptname D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de
  • 80.
    pt GROUP BYa.deptname 40. Which of the following occurs if an application ends abnormally during an active unit of work? (Select the correct response) A. Current unit of work is committed B. Current unit of work is rolled back C. Current unit of work remains active D. Current unit of work moves to pending state 41. For which of the following database objects can locks be obtained? (Select the correct response) A. View B. Table C. Trigger D. Buffer Pool 42. Given the following DDL statement: CREATE TABLE newtab1 LIKE tab1 Which of the following would occur as a result of the statement execution? (Select the correct response) A. NEWTAB1 has same triggers as TAB1 B. NEWTAB1 is populated with TAB1 data C. NEWTAB1 has the same primary key as TAB1 D. NEWTAB1 columns have same attributes as TAB1 43. When granted to user1, which of the following will allow user1 to ONLY ac cess table data? (Select the correct response) A. DBADM authority B. SYSADM authority C. SELECT privilege on the table D. SELECT privilege WITH GRANT OPTION on the table 44. Which of the following tools can be used to identify inefficient SQL stat ements without executing the query? (Select the correct response) A. QMF B. Script Center C. Visual Explain D. Performance Monitor 45. Which of the following CANNOT be used to restrict specific values from be ing inserted into a column in a particular table? (Select the correct response) A. view B. index C. check constraint D. referential constraint
  • 81.
    46. Which ofthe following types of DB2 locks allows for the most concurrency within a table? (Select the correct response A. A row lock B. A page lock C. A field lock D. A column lock 47. The DB2 Administration Server (DAS) is required for which of the followin g? (Select the correct response)] A. For the administrator user id to install or remove DB2 B. For the remote clients to use the Control Center against the instance C. For checking authorities in the database manager configuration for SYSADM D. For maintaining authorities added and removed by the SQL GRANT and REVOKE commands respectively 48. Given the statement: CREATE TABLE t1 ( c1 INTEGER NOT NULL, c2 INTEGER, PRIMARY KEY(c1), FOREIGN KEY(c2) REFERENCES t2 ) How many non-unique indexes are defined for table t1? (Select the correct response) A.0 B.1 C.2 D.3 49. Given the following embedded SQL programs: Program 1: Create table mytab (col1 int, col2 char(24)) Commit Program 2: Insert into mytab values ( 20989,'Joe Smith') Commit Insert into mytab values ( 21334,'Amy Johnson') Delete from mytab Commit Insert into mytab values ( 23430,'Jason French') Rollback Insert into mytab values ( 20993,'Samantha Jones') Commit Delete from mytab where col1=20993 Rollback
  • 82.
    Which of thefollowing records will be returned by the statement SELECT * FROM mytab? (Select the correct response) A. 20989, Joe Smith B. 21334, Amy Johnson C. 21334, Amy Johnson D. 20993, Samantha Jones E. No records are returned 50. Given an application bound with cursor stability which will be updating r ows in a table and obtaining row locks, which of the following table locks wi ll DB2 acquire for the application first? (Select the correct response) A. U – update B. X – exclusive C. IU - intent update D. IX - intent exclusive 51 . Which of the following is NOT a valid data type on CREATE TABLE? (Select the correct response) A. CLOB B. DOUBLE C. NUMERIC D. DATETIME 52. If a DB2 Warehouse Manager toolkit is selected during the installation of DB2 UDB Version 7.1, which of the following databases must be defined? (Select the correct response) A. None B. Target Database C. Source Database D. Control Database 53. Which of the following SQL statements can remove all rows from a table na med COUNTRY? (Select the correct response) A. DELETE country B. DELETE FROM country C. DELETE * FROM country D. DELETE ALL FROM country 54. Which of the following tasks can be performed using the ALTER TABLESPACE statement? (Select the correct response) A. Assign a bufferpool. B. Change the table space name. C. Change the type of the table space. D. Change the page size of the table space.
  • 83.
    55.To set upa client that can access DB2 UDB through DB2 Connect Enterprise Edition, which of the following is the minimum software client that must be installed? (Select the correct response) A. DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client ************************************************************** 自测题 7 -------------------------------------------------------------------------------- 1. Given the following table with a primary key on empid: Emp: Empid Name 11 Joe Smith 23 Melanie Jones 30 Robert Bruce 49 Janice Baker 66 Mario Diaz 68 Maria Diaton Give the following statement in an embedded SQL program bound with Repeatable Read: Select * from Emp where empid < 55 How many rows in the table will be locked after the statement is run? A.0 B.1 C.4 D.5 E.6 2. Given an embedded SQL program with a single connection, two threads and th e following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK How many records will be successfully inserted and retained in the table myta b? (Select the correct response)
  • 84.
    A.0 B.1 C.2 D.3 3. With DBADMauthority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A.0 B.1 C.2 D.3 4. Given the following table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) Which of the following statements will return all of the records ordered by j ob with the salaries in descending order? (Select the correct response A. SELECT * FROM staff ORDER BY salary DESC, job B. SELECT * FROM staff GROUP BY salary DESC, job C. SELECT * FROM staff ORDER BY job, salary DESC D. SELECT * FROM staff GROUP BY job, salary DESC 5. Which of the following is the result of a successful ROLLBACK statement? (Select the correct response) A.Held locks are released B. Release-pending conditions are undone C. Tables in LOAD PENDING are released D. Constraint checking conditions are undone E. Existing database connections are released 6. Which of the following processing can occur for a unit of work using an is olation level of Cursor Stability and allows scanning through the table more than once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes
  • 85.
    C. Have updatedresult set rows changed by other processes from one scan to t he next D. Have accessed result set rows changed by other processes from one scan to the next 7. Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, it should only change if another agent unassigns a currently assigned sea t. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read 8. Given the following column requirements: Col1 Numeric Identifier - From 1 to 1000000 Col2 Job Code - Variable, 1 to 2 characters long Col3 Job Description - Variable, 1 to 100 characters long Col4 Job Length - Length of Job in seconds Which of the following will minimize the disk space allocated to store the re cords if Job Description has an average length of 45? (Select the correct response) A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT) B. B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT) C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT) D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT) 9. Which of the following DB2 components can limit the resource consumption o f queries? (Select the correct response) A. DB2 Connect B. DB2 Query Patroller C. DB2 Performance Monitor D. DB2 Net Search Extender 10. Given the table definition: DEFIN1: Id SMALLINT NOT NULL Name VARCHAR(30) Hired DATE DEFIN2: Deptid SMALLINT NOT NULL Name VARCHAR(30) Started DATE
  • 86.
    Which of thefollowing statements will insert successfully into table DEFIN1? (Select the correct response) A. INSERT INTO defin1 (id) VALUES (1) B. INSERT INTO defin1 (name) VALUES ('Florence') C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE FROM def in2 D. INSERT INTO defin1 (name, hired) SELECT DISTINCT 'Florence', CURRENT DATE FROM defin2 11. Which of the following isolation levels will lock only the rows returned in the result set? A. Read Stability B. Repeatable Read C. Cursor Stability D. Uncommitted Read 12. Given the following table definitions DEPARTMENT Deptno CHAR(3) Deptname CHAR(30) Mgrno INTEGER Admrdept CHAR(3) EMPLOYEE Empno INTEGER Firstname CHAR(30) Midinit CHAR Lastname CHAR(30) Workdept CHAR(3) Which of the following statements will list the employee's employee number, l ast name, and department name ONLY for those employees who have a department? A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE e.workdept = d.deptno B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep artment d ON e.workdept = d.deptno C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep artment d ON e.workdept = d.deptno D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de partment d WHERE e.workdept = d.deptno 13. A view is used instead of a table for users to do which of the following? (Select the correct response) A. Avoid allocating more disk space per database B. Provide users with the ability to define indexes C. Restrict user's access to a subset of the table data D. Avoid allocating frequently used query result tables 14. Given the table:
  • 87.
    COUNTRY ID NAME PERSONCITIES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10 4 Germany 1 0 5 France 7 5 Which of the following clauses when added to the statement SELECT cities, name FROM country returns rows sorted by NAME and then sorted by the number of cities (CITIES)? (Select the correct response) A. ORDER BY 2,1 B. GROUP BY 2, 1 C. ORDER BY cities, name D. GROUP BY cities, name 15. Which of the following tools maintains a history of all executed statemen ts/commands for the current session within the tool? (Select the correct response A. Journal B. SQL Assist C. DB2 Alert Center D. DB2 Command Center 16. Given table T1 with 100 rows, which of the following queries will retriev e 10 rows from table T1? (Select the correct response) A. SELECT * FROM t1 MAXIMUM 10 ROWS B. SELECT * FROM t1 READ 10 ROWS ONLY C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY 17. Given the table T1, created by: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued: INSERT INTO t1 VALUES (1, 'ABC') INSERT INTO t1 VALUES (5, 'DEF') Which of the following values are inserted into the ID column by the followin g statement? INSERT INTO t1(c1) VALUES ('XYZ') (Select the correct response) A.0 B.1 C.2
  • 88.
    D.5 E.6 18. Which ofthe following products can be used to perform a dictionary-based search? (Select the correct response) A. Net.Data B. XML Extender C. AVI Extender D. Text Extender 19. Which of the following statements will create an index and prevent table T1 from containing two or more rows with the same values for column C1? (Select the correct response) A. CREATE UNIQUE INDEX ix4 ON t1 (c1) B. CREATE DISTINCT INDEX ix1 ON t1 (c1) C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2) D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2) 20. How many DB2 Administration Server (DAS) Instances can be set up per phys ical machine? (Select the correct response) A.0 B.1 C. One for each instance on the physical machine D. One for each database on the physical machine 21. Why is a unique index not sufficient for creation of a primary key? (Select the correct response) A. It is sufficient - a primary key is the same thing as a unique index. B. Unique indexes can be defined in ascending or descending order. Primary ke ys must be ascending. C. A unique index can be defined over a column or columns that allow nulls. P rimary keys cannot contain nulls. D. A unique index can be defined over a column or columns that allow nulls. T his is not allowed for primary keys because foreign keys cannot contain nulls . 22. Which of the following will rebuild a package in the database from the ex isting catalog information? (Select the correct response) A. bind B. rebind C. update D. rebuild 23. Which of the following DELETE RULES on CREATE TABLE will delete a depende nt table row if the parent table row is deleted? (Select the correct response
  • 89.
    A. ON DELETE REMOVE B. ON DELETE CASCADE C. ON DELETE RESTRICT D. ON DELETE SET NULL E. ON DELETE PROPAGATE 24. Which of the following is the best way to restrict user access to a subse t of columns in a table? (Select the correct response) A. Only grant access to the columns within a table that a user is allowed to see. B. Create a view that only includes the columns a user is allowed to see. Gra nt the user access to the view, not the base table. C. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a join when all data must be presented. D. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a union when all data must be presented. 25. Given the following DDL statements, CREATE TABLE t1 (a INT, b INT, c INT) CREATE VIEW v1 AS SELECT a, b, c FROM t1 WHERE a > 250 WITH CHECK OPTION Which of the following INSERT statements will fail? (Select the correct response) A. INSERT INTO t1 VALUES (200, 2, 3) B. INSERT INTO v1 VALUES (200, 2, 3) C. INSERT INTO t1 VALUES (300, 2, 3) D. INSERT INTO v1 VALUES (300, 2, 3) 26. Which two of the following types of storage management method is supporte d by DB2 OLAP Server ? (Select all that apply) A. Object B. Network C. Relational D. Hierachical E. Multi-dimensional 27. For which of the following can locks be obtained? (Select the correct response) A. A trigger B. A table view C. A table column D. A database buffer E. A row referenced by an index key
  • 90.
    28. Which ofthe following privileges is necessary to populate the table with large amounts of data? (Select the correct response) A. LOAD B. ALTER C. UPDATE D. IMPORT 29. When manually establishing communications from a Windows NT client throug h a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT required to catalog? (Select the correct response A. The client. B. The database on the DRDA server. C. The Database Connection Service database. D. The node where the DB2 Connect Gateway is. 30. Given the statement: CREATE TABLE t1 (c1 CHAR(1)) Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol lowing command is issued: ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a') Which of the following occurs? (Select the correct response) A. Rows with c1 values of b,c,d,e,f are deleted B. Rows with c1 values of b,c,d,e,f have c1 set to NULL C. The ALTER command will fail as rows violate the constraint D. The ALTER command will move the violating rows to the exception table 31. Using the Control Center Create Table dialog box, which of the following dialogs allows the table creation DDL to be viewed? (Select the correct response A. Copy B. Show SQL C. Show Related D. Sample Contents 32. Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response) A. –f B.-b C.-o D.-w 33. A user has a numeric data column with a maximum value of 100,000. Which o f the following data types will use the minimum amount of storage for the col umn? (Select the correct response)
  • 91.
    A. IDENTITY B. BIGINT C. INTEGER D. SMALLINT 34. Which two of the following modes can be used on the lock table statement? (Select all that apply) A. SHARE MODE B. EXCLUSIVE MODE C. REPEATABLE READ MODE D. UNCOMMITTED READ MODE E. INTENT EXCLUSIVE MODE 35. Which of the following must be set up to allow the Control Center to view database objects? (Select the correct response) A. ODBC B. JAVA C. DB2 Administration Server D. Client Configuration Assistant 36. Which of the following is possible once a user has been given maintenance authority? A. DB2 userids can be created. B. Views can be created on the catalogs. C. Statistics can be collected for database objects D. A table can be populated by using the LOAD command. 37. Given the two following tables: Points Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 PIM Name PIM Mats Sundin 14 Jaromir Jagr 18 Bobby Orr 12 Mark Messier 32 Brett Hull 66 Mario Lemieux 23 Joe Sakic 94 Which of the following statements will display the player's Names, points and
  • 92.
    PIM for allplayers? (Select the correct response) A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI N pim ON points.name=pim.name B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE R JOIN pim ON points.name=pim.name C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTE R JOIN pim ON points.name=pim.name D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT ER JOIN pim ON points.name=pim.name 38. Given the following table structure: table1 emp_num INT NOT NULL PRIMARY KEY emp_fname CHAR(30) NOT NULL emp_lname CHAR(30) NOT NULL emp_addr CHAR(60) NOT NULL emp_pin CHAR(10) NOT NULL Which of the following columns can be referenced by a foreign key clause from another table? (Select the correct response) A. emp_num B. emp_pin C. emp_addr D. emp_fname E. emp_lname 39. Which of the following is the result of the following SQL statement: CREATE UNIQUE INDEX empno_ind ON employee (empno) (Select the correct response) A. Every value for EMPNO must be unique. B. UPDATE statements on EMPNO will be rolled back. C. Insert statements on EMPNO will always be faster. D. Insert statements on the EMPNO table will result in clustered data. 40. Given the table definition: CREATE TABLE student (name CHAR(30), age INTEGER) To list the names of the 10 youngest students, which of the following index d efinition statements on the student table may improve the query performance? (Select the correct response) A. CREATE INDEX youngest ON student (age, name) B. CREATE INDEX youngest ON student (name, age) C. CREATE INDEX youngest ON student (name, age DESC) D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age) 41. Which of the following DB2 data types is used to store 50 MB of binary da ta as a single value? (Select the correct response)
  • 93.
    A. BLOB B. CLOB C. DBCLOB D. FOR BIT DATA E. VARCHAR FOR BIT DATA 42. With tables defined as: Table1 col1 INT col2 CHAR(30) Table2 col1 INT col2 CHAR(30) Which of the following statements will insert all the rows in TABLE2 into TAB LE1? (Select the correct response) A. INSERT INTO table1 SELECT col1, col2 FROM table2 B. INSERT INTO table1 AS SELECT col1, col2 FROM table2 C. INSERT INTO table1 VALUES (table2.col1, table2.col2) D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2) E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2) 43. Given the following UPDATE statement: UPDATE address2 SET housenumber_buildingname= (SELECT buildingname FROM address1 WHERE address2.id = address1.id) WHERE HOUSENUMBER_BUILDINGNAME IS NULL Which of the following describes the result of the statement? (Select the correct response) A. The statement will succeed. B. The statement will fail because a subquery cannot exist in an UPDATE state ment. C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined as primary keys. D. The statement will succeed if the data retrieved from the subquery does no t have duplicate values for ADDRESS1.ID. 44. Given the following embedded SQL programs: Program 1: CREATE TABLE mytab (col1 INT, col2 CHAR(24)) COMMIT Program 2: INSERT INTO mytab VALUES ( 20989,'Joe Smith') INSERT INTO mytab VALUES ( 21334,'Amy Johnson') COMMIT DELETE FROM mytab ROLLBACK INSERT INTO mytab VALUES ( 23430,'Jason French')
  • 94.
    ROLLBACK INSERT INTO mytabVALUES ( 20993,'Samantha Jones') COMMIT DELETE FROM mytab WHERE col1=20993 ROLLBACK Which of the following indicates the number of records that will be returned by the statement: SELECT * FROM mytab? (Select the correct response) A.0 B.1 C.2 D.3 E.4 45. Which of the following is the most appropriate reason to consider revokin g the SELECT privilege on the catalog tables from PUBLIC after creating a dat abase? (Select the correct response A. To prevent users from creating tables without proper authority. B. Some system catalogs record user data in some columns, and this data may b e confidential. C. To prevent users from viewing passwords for other DB2 userids that DB2 sto res in the catalog tables. D. Some catalog tables are large, so preventing users from viewing them is a good way to keep users from submitting long-running queries against the catal ogs. 46. Which of the following is the implicit qualifier for a declared temporary table? (Select the correct response) A. The schema name SYSCAT. B. The schema name SESSION. C. The schema name TEMPUSER. D. The userid specified with the BIND command. E. The userid who established the connection to the database and declared the temporary table. 47. Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with col umns ID and TITLE, what is the effect of the statement: UPDATE employee SET salary = salary * 1.15 WHERE salary < 15000 OR EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr' ) (Select the correct response) A. Only managers that make less than 15,000 are given salary increases. B. Only non-managers that make less than 15,000 are given salaray increases. C. Employees that make less than 15,000 but no managers are given salary incr eases.
  • 95.
    D. Employees thatmake less than 15,000 and all managers are given salary inc reases. 48. Which one of the following SQL statements sets the default qualifier to " user1"? (Select the correct response) A. SET CURRENT ID = 'user1' B. SET CURRENT USER = 'user1' C. SET CURRENT SQLID = 'user1' D. SET CURRENT QUALIFIER = 'user1' 49. A table called EMPLOYEE has columns: name, department, and phone_number. Which of the following can limit access to the phone_number column? (Select the correct response) A. Using a view to access the table B. Using an index on the column C. Using a referential constraint on the table D. Using a table check constraint on the table E. Revoking access from the phone_number column 50. Which of the following can be used to determine the views that are affect ed by a DROP TABLE statement? (Select the correct response) A. DB2 Script Center B. DB2 Performance Monitor C DB2 Control Center, Show Related D. DB2 Control Center, Sample Contents 51. Given two embedded SQL programs and the following actions: Pgm1 Pgm2 INSERT INTO mytab VALUES (...) DELETE FROM mytab COMMIT ROLLBACK DELETE FROM mytab INSERT INTO mytab VALUES (...) ROLLBACK COMMIT If there exists one (1) row in table mytab before the programs are executed c oncurrently, how many records will be in the table once the programs complete ? (Select the correct response) A.0 B.1 C.2 D.3 E.4 52. Given the following transaction: CREATE TABLE dwaine.mytab (col1 INT, col2 INT) INSERT INTO dwaine.mytab VALUES (1,2) INSERT INTO dwaine.mytab VALUES (4,3) ROLLBACK
  • 96.
    Which of thefollowing would be returned from the statement: SELECT * FROM dwaine.mytab? (Select the correct response) A. COL1 COL2 ----------- ----------- 0 record(s) selected. B. COL1 COL2 ----------- ----------- 1 2 1 record(s) selected. C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name. D. COL1 COL2 ----------- ----------- 1 2 4 3 2 record(s) selected. 53. Which of the following does NOT end a unit of work? (Select the correct response) A. COMMIT B. ROLLBACK C. TERMINATE D. SAVEPOINT E. CONNECT RESET 54. Given the following: TAB1 TAB2 C1 C2 CX CY --- --- --- --- A 11 A 21 B 12 C 22 C 13 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 joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=c0078 B. SELECT * FROM tab1 INNER 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 55. Which of the following products must be installed to provide a single poi nt of control for local and remote DB2 databases? (Select the correct response
  • 97.
    A. DB2 Runtime Client B. DB2 Administration Client C. DB2 Connect Enterprise Edition D. DB2 Enterprise-Extended Edition ******************************************************** 自测题 8 -------------------------------------------------------------------------------- (1/55)Which two of the following types of storage management method is supp orted by DB2 OLAP Server ? (Select all that apply) A. Object B. Network C. Relational D. Hierachical E. Multi-dimensional (2/55)Which of the following DB2 data types is used to store 50 MB of binar y data as a single value? (Select the correct response) A. BLOB B. CLOB C. DBCLOB D. FOR BIT DATA E. VARCHAR FOR BIT DATA (3/55)Which of the following must be set up to allow the Control Center to view database objects? (Select the correct response) A. ODBC B. JAVA C. DB2 Administration Server D. Client Configuration Assistant (4/55)Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response) A. –f B. –b C. -0 D. –w
  • 98.
    (5/55)Which of thefollowing DELETE RULES on CREATE TABLE will delete a dep endent table row if the parent table row is deleted? (Select the correct response) A. ON DELETE REMOVE B. ON DELETE CASCADE C. ON DELETE RESTRICT D. ON DELETE SET NULL E. ON DELETE PROPAGATE (6/55)With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (7/55)For which of the following can locks be obtained? (Select the correct response) A. A trigger B. A table view C. A table column D. A database buffer E. A row referenced by an index key (8/55)Given the statement: CREATE TABLE t1 (c1 CHAR(1)) Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol lowing command is issued: ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a') Which of the following occurs? (Select the correct response) A. Rows with c1 values of b,c,d,e,f are deleted B. Rows with c1 values of b,c,d,e,f have c1 set to NULL C. The ALTER command will fail as rows violate the constraint D. The ALTER command will move the violating rows to the exception table (9/55)How many DB2 Administration Server (DAS) Instances can be set up per physical machine? (Select the correct response) A. 0 B. 1 C. One for each instance on the physical machine
  • 99.
    D. One foreach database on the physical machine (10/55)Which of the following is the result of a successful ROLLBACK statem ent? (Select the correct response) A. Held locks are released B. Release-pending conditions are undone C. Tables in LOAD PENDING are released D. Constraint checking conditions are undone E. Existing database connections are released (11/55)Which of the following is the most appropriate reason to consider re voking the SELECT privilege on the catalog tables from PUBLIC after creating a database? (Select the correct response) A. To prevent users from creating tables without proper authority. B. Some system catalogs record user data in some columns, and this data may b e confidential. C. To prevent users from viewing passwords for other DB2 userids that DB2 sto res in the catalog tables. D. Some catalog tables are large, so preventing users from viewing them is a good way to keep users from submitting long-running queries against the catal ogs. (12/55)When manually establishing communications from a Windows NT client t hrough a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT required to catalog? (Select the correct response) A. The client. B. The database on the DRDA server. C. The Database Connection Service database. D. The node where the DB2 Connect Gateway is. (13/55)Which of the following will rebuild a package in the database from t he existing catalog information? (Select the correct response) A. bind B. rebind C. update D. rebuild (14/55)A user has a numeric data column with a maximum value of 100,000. Wh ich of the following data types will use the minimum amount of storage for th e column? (Select the correct response) A. IDENTITY B. BIGINT C. INTEGER D. SMALLINT
  • 100.
    (15/55)Which of thefollowing products can be used to perform a dictionary- based search? (Select the correct response) A. Net.Data B. XML Extender C. AVI Extender D. Text Extender (16/55)Given the following transaction: CREATE TABLE dwaine.mytab (col1 INT, col2 INT) INSERT INTO dwaine.mytab VALUES (1,2) INSERT INTO dwaine.mytab VALUES (4,3) ROLLBACK Which of the following would be returned from the statement: SELECT * FROM dwaine.mytab? (Select the correct response) A. COL1 COL2 -------------- ------------- 0 Records selected B. COL1 COL2 ------ ------- 1 2 1 records selected C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name. D. COL1 COL2 ------- -------- 1 2 4 3 2 records selected (17/55)Which of the following privileges is necessary to populate the table with large amounts of data? (Select the correct response) A. LOAD B. ALTER C. UPDATE D. IMPORT (18/55)Given the following table with a primary key on empid: Emp: Empid Name 11 Joe Smith 23 Melanie Jones 30 Robert Bruce 49 Janice Baker 66 Mario Diaz 68 Maria Diaton
  • 101.
    Give the followingstatement in an embedded SQL program bound with Repeatable Read: Select * from Emp where empid < 55 How many rows in the table will be locked after the statement is run? (Select the correct response) A. 0 B. 1 C. 4 D. 5 E. 6 (19/55)Given the following UPDATE statement: UPDATE address2 SET housenumber_buildingname= (SELECT buildingname FROM address1 WHERE address2.id = address1.id) WHERE HOUSENUMBER_BUILDINGNAME IS NULL Which of the following describes the result of the statement? (Select the correct response) A. The statement will succeed. B. The statement will fail because a subquery cannot exist in an UPDATE state ment. C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined as primary keys. D. The statement will succeed if the data retrieved from the subquery does no t have duplicate values for ADDRESS1.ID. (20/55)Given two embedded SQL programs and the following actions: Pgm1 Pgm2 INSERT INTO mytab VALUES (...) DELETE FROM mytab COMMIT ROLLBACK DELETE FROM mytab INSERT INTO mytab VALUES (...) ROLLBACK COMMIT If there exists one (1) row in table mytab before the programs are executed c oncurrently, how many records will be in the table once the programs complete ? (Select the correct response) A. 0 B. 1 C. 2 D. 3 E. 4 (21/55)Given the following embedded SQL programs: Program 1: CREATE TABLE mytab (col1 INT, col2 CHAR(24)) COMMIT Program 2:
  • 102.
    INSERT INTO mytabVALUES ( 20989,'Joe Smith') INSERT INTO mytab VALUES ( 21334,'Amy Johnson') COMMIT DELETE FROM mytab ROLLBACK INSERT INTO mytab VALUES ( 23430,'Jason French') ROLLBACK INSERT INTO mytab VALUES ( 20993,'Samantha Jones') COMMIT DELETE FROM mytab WHERE col1=20993 ROLLBACK Which of the following indicates the number of records that will be returned by the statement: SELECT * FROM mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 E. 4 (22/55)Which of the following DB2 components can limit the resource consump tion of queries? (Select the correct response) A. DB2 Connect B. DB2 Query Patroller C. DB2 Performance Monitor D. DB2 Net Search Extender (23/55)Which of the following products must be installed to provide a singl e point of control for local and remote DB2 databases? (Select the correct response) A. DB2 Runtime Client B. DB2 Administration Client C. DB2 Connect Enterprise Edition D. DB2 Enterprise-Extended Edition (24/55)Which of the following is possible once a user has been given mainte nance authority? (Select the correct response) A. DB2 userids can be created. B. Views can be created on the catalogs. C. Statistics can be collected for database objects. D. A table can be populated by using the LOAD command. (25/55)Given the table T1, created by: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY,
  • 103.
    c1 CHAR(3) ) The followingSQL statements are issued: INSERT INTO t1 VALUES (1, 'ABC') INSERT INTO t1 VALUES (5, 'DEF') Which of the following values are inserted into the ID column by the followin g statement? INSERT INTO t1(c1) VALUES ('XYZ') (Select the correct response) A. 0 B. 1 C. 2 D. 5 E. 6 (26/55)Which of the following Control Center features can be used to update information for the optimizer to choose the best path to data? (Select the correct response) A. Show Related B. Generate DDL C. Run Statistics D. Reorganize Table (27/55)Which of the following tools allows the DBA to set limits, and be al erted if these limits are exceeded? (Select the correct response) A. DB2 Index Wizard B. DB2 Script Center C. DB2 Command Center D. DB2 Performance Monitor (28/55)Which of the following can be accomplished with a single UPDATE stat ement? (Select the correct response) A. Updating multiple tables B. Updating a view consisting of joined tables C. Updating multiple tables based on a WHERE clause D. Updating a table based on a sub-select using joined tables (29/55)Given the statement: CREATE TABLE t1 ( c1 CHAR(3) CONSTRAINT c1 CHECK (c1 IN ('A01','B01','C01')) ) DB2 verifies that the table check constraint is met during which of the follo wing actions? (Select the correct response)
  • 104.
    A. Adding data using load B. The reorg of the table C. The insert of each row in t1] D. The creation of the index for the table (30/55)Given the following embedded SQL programs: Program 1: Create table mytab (col1 int, col2 char(24)) Commit Program 2: Insert into mytab values ( 20989,'Joe Smith') Commit Insert into mytab values ( 21334,'Amy Johnson') Delete from mytab Commit Insert into mytab values ( 23430,'Jason French') Rollback Insert into mytab values ( 20993,'Samantha Jones') Commit Delete from mytab where col1=20993 Rollback Which of the following records will be returned by the statement SELECT * FROM mytab? (Select the correct response) A. 20989, Joe Smith B. 21334, Amy Johnson C. 23430, Jason French D. 20993, Samantha Jones E. No records are returned (31/55)In which of the following locations are the referential constraints stored? (Select the correct response) A. The user tables. B. The explain tables. C. SYSIBM.SYSTRIGGERS. D. The system catalog tables. (32/55)Which of the following SQL statements can remove all rows from a tab le named COUNTRY? (Select the correct response) A. DELETE country B. DELETE FROM country C. DELETE * FROM country D. DELETE ALL FROM country (33/55)Given two embedded SQL program executions with the following actions :
  • 105.
    Pgm1 INSERT INTO mytabVALUES (...) COMMIT INSERT INTO mytab VALUES (...) ROLLBACK Pgm2 INSERT INTO mytab VALUES (...) ROLLBACK INSERT INTO mytab VALUES (...) COMMIT How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A. 1 B. 2 C. 3 D. 4 (34/55)With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a' INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (35/55)Given the table T1 created by: CREATE TABLE t1 ( id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, c1 CHAR(10) NOT NULL, c2 CHAR(10) ) Which of the following INSERT statements will succeed? (Select the correct response) A. INSERT INTO t1 VALUES (1, 'abc', NULL) B. INSERT INTO t1 VALUES (1, NULL, 'def') C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL) D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def') (36/55)Which of the following products can be used to generate Extensible M arkup Language documents from DB2 tables? (Select the correct response)
  • 106.
    A. Net Search B. XML Extender C. AVI Extender D. Text Extender (37/55)Which of the following describes why savepoints are NOT allowed insi de an atomic unit of work? (Select the correct response) A. Atomic units of work span multiple databases, but savepoints are limited t o units of work which operate on a single database. B. A savepoint implies that a subset of the work may be allowed to succeed, w hile atomic operations must succeed or fail as a unit. C. A savepoint requires an explicit commit to be released, and commit stateme nts are not allowed in atomic operations such as compound SQL. D. A savepoint cannot be created without an active connection to a database, but atomic operations can contain a CONNECT as a sub-statement. (38/55)Which of the following DB2 UDB isolation levels will NOT lock any ro ws during read processing? (Select the correct response) A. Read Stability B. Repeatable Read C. Uncommited Read D. Cursor Stability (39/55)For which of the following database objects can locks be obtained? (Select the correct response) A. View B. Table C. Trigger D. Buffer Pool (40/55)Which of the following utilities can examine a table and its indexes and update the system catalogs with the table's statistical information? (Select the correct response) A. runstats B. getstats C. check index D. chkstats (41/55)Given the statement: CREATE TABLE t1 ( c1 INTEGER NOT NULL, c2 INTEGER, PRIMARY KEY(c1), FOREIGN KEY(c2) REFERENCES t2 ) How many non-unique indexes are defined for table t1?
  • 107.
    (Select the correctresponse) A. 0 B. 1 C. 2 D. 3 (42/55)Given the following scenario: An application uses a 15 digit value t o uniquely identify customer transactions. This number is also used for arith metic operations. Which of the following is the most efficient DB2 data type for the column definition for this purpose? (Select the correct response) A. CHAR B. CLOB C. INTEGER D. NUMERIC(15,2) E. DECIMAL(15,0) (43/55)Which of the following is NOT a valid data type on CREATE TABLE? (Select the correct response) A. CLOB B. DOUBLE C. NUMERIC D. DATETIME (44/55)The user USER1 is executing the statement CREATE TABLE app1.table1 (col1 INT, col2 INT) Which of the following privileges is required by USER1 for the statement to b e successful? (Select the correct response) A. CREATEIN for the database B. CREATEIN for the schema app1 C. CREATEIN for the schema user1 D. CREATEIN for the table table1 (45/55)Which of the following Control Center options shows the dependencies between a specific view and its tables? (Select the correct response) A. Show SQL B. Show Related C. Sample Contents D. Customize Columns (46/55)Which of the following occurs if an application ends abnormally duri ng an active unit of work? (Select the correct response) A. Current unit of work is committed B. Current unit of work is rolled back C. Current unit of work remains active D. Current unit of work moves to pending state
  • 108.
    (47/55)Which of thefollowing can occur once connected to a database or DRD A server with an explicit authorization name? (Select the correct response) A. Omit a user's password. B. Change a user's password if the server supports this function. C. Omit the name of the database or DRDA server if it is local. D. Use the commit option on the connect statement to commit in-doubt units of work from a previous connection that was terminated. (48/55)Which of the following tasks can be performed using the ALTER TABLES PACE statement? (Select the correct response) A. Assign a bufferpool. B. Change the table space name. C. Change the type of the table space. D. Change the page size of the table space. (49/55)For a clustering index to be effective in keeping the data in order, which of the following parameters must be set correctly for the index? (Select the correct response) A. FREE ROWS B. PERCENT FREE C. CLUSTERRATIO D. CLUSTER FACTOR (50/55)Which of the following CANNOT be used to restrict specific values fr om being inserted into a column in a particular table? (Select the correct response) A. view B. index C. check constraint D. referential constraint (51/55)Given an embedded SQL program with a single connection, two threads and the following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT How many records will be successfully inserted into the table mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (52/55)Given a table T1, with a column C1 char(3), that contains strings in
  • 109.
    upper and lowercase letters, which of the following queries will find all r ows where C1 is the string 'ABC' in any case? (Select the correct response) A. SELECT * FROM t1 WHERE c1 = 'ABC' B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC' C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC') D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE (53/55)Given an embedded SQL program with a single connection, two threads and the following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT How many records will be successfully inserted into the table mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (54/55)If a DB2 Warehouse Manager toolkit is selected during the installati on of DB2 UDB Version 7.1, which of the following databases must be defined? (Select the correct response) A. None B. Target Database C. Source Database D. Control Database (55/55)User2 has DBADM authority on database DB1. This allows the user to d o which of the following? (Select the correct response) A. Drop database DB1 B. Backup database DB1 C. Create tables in any database D. Create tables in database DB1 **************************************************************** 自测题 9 --------------------------------------------------------------------------------
  • 110.
    (1/55)Given the following: TAB1TAB2 C1 C2 CX CY ---- ---- ----- ----- A 11 A 21 B 12 B 22 C 13 C 23 The following results are desired: C1 C2 CX CY ---- ---- ---- ----- A 11 A 21 B 12 ----- ----- C 13 C 22 Which of the following joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=cx B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx (2/55)Which of the following SQL statements can remove all rows from a tabl e named COUNTRY? (Select the correct response) A. DELETE country B. DELETE FROM country C. DELETE * FROM country D. DELETE ALL FROM country (3/55)When establishing client-server communication, passwords CANNOT be ve rified by: (Select the correct response) A. The DRDA DB2 server. B. The client operating system. C. The gateway operating system. D. Looking in the catalog tables for the password. (4/55)Which of the following occurs if an application ends abnormally durin g an active unit of work? (Select the correct response) A. Current unit of work is committed B. Current unit of work is rolled back C. Current unit of work remains active D. Current unit of work moves to pending state (5/55)Which of the following Control Center features can be used to update information for the optimizer to choose the best path to data? (Select the correct response) A. Show Related
  • 111.
    B. Generate DDL C.Run Statistics D. Reorganize Table (6/55)When granted to user1, which of the following will allow user1 to ONL Y access table data? (Select the correct response) A. DBADM authority B. SYSADM authority C. SELECT privilege on the table D. SELECT privilege WITH GRANT OPTION on the table (7/55)With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 ='a' INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (8/55)Given a table T1, with a column C1 char(3), that contains strings in upper and lower case letters, which of the following queries will find all ro ws where C1 is the string 'ABC' in any case? (Select the correct response) A. SELECT * FROM t1 WHERE c1 = 'ABC' B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC' C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC') D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE (9/55)Given an embedded SQL program with a single connection, two threads a nd the following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT How many records will be successfully inserted into the table mytab? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (10/55)Which of the following describes why savepoints are NOT allowed insi
  • 112.
    de an atomicunit of work? (Select the correct response) A. Atomic units of work span multiple databases, but savepoints are limited to units of work which operate on a single database. B. A savepoint implies that a subset of the work may be allowed to succeed, while atomic operations must succeed or fail as a unit. C. A savepoint requires an explicit commit to be released, and commit statem ents are not allowed in atomic operations such as compound SQL. D. A savepoint cannot be created without an active connection to a database, but atomic operations can contain a CONNECT as a sub-statement. (11/55)Given the following DDL statement: CREATE TABLE newtab1 LIKE tab1 Which of the following would occur as a result of the statement execution? (Select the correct response) A. NEWTAB1 has same triggers as TAB1 B. NEWTAB1 is populated with TAB1 data C. NEWTAB1 has the same primary key as TAB1 D. NEWTAB1 columns have same attributes as TAB1 (12/55)The DB2 Administration Server (DAS) is required for which of the fol lowing? (Select the correct response) A. For the administrator user id to install or remove DB2 B. For the remote clients to use the Control Center against the instance C. For checking authorities in the database manager configuration for SYSADM D. For maintaining authorities added and removed by the SQL GRANT and REVOKE commands respectively (13/55)Which of the following types of DB2 locks allows for the most concur rency within a table? (Select the correct response) A. A row lock B. A page lock C. A field lock D. A column lock (14/55)Which of the following is NOT a valid data type on CREATE TABLE? (Select the correct response) A. CLOB B. DOUBLE C. NUMERIC D. DATETIME (15/55)Which of the following utilities can examine a table and its indexes and update the system catalogs with the table's statistical information? (Select the correct response) A. runstats B. getstats
  • 113.
    C. check index D.chkstats (16/55)Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, the list should not change. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read (17/55)Which of the following Control Center options shows the dependencies between a specific view and its tables? (Select the correct response) A. Show SQL B. Show Related C. Sample Contents D. Customize Columns (18/55)Given the following table definition: STAFF Id INTEGER name CHAR(20) dept INTEGER job CHAR(20) years INTEGER salary DECIMAL(10,2) comm. DECIMAL(10,2) Which of the following SQL statements will return the total number of employe es in each department and the corresponding department id under the following conditions: Only return departments with at least one employee receiving a commission gre ater than 5000. The result should be sorted by the department count from most to least. (Select the correct response) A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER B Y 2 DESC B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER B Y 2 DESC C. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm OR DER BY 2 DESC D. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORDER BY 3 DESC
  • 114.
    (19/55)For which ofthe following database objects can locks be obtained? (Select the correct response) A. View B. Table C. Trigger D. Buffer Pool (20/55)Given the tables: COUNTRY ID NAME PERSON CITYES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 3 10 4 Germany 1 0 5 Germany 7 5 STAFF ID LASTNAME 1 Jones 2 Smiths The statement: SELECT * FROM staff, country will return how many rows? (Select the correct response) A. 2 B. 4 C. 5 D. 7 E. 10 (21/55)A user creates the table TABLE1. Which of the following statements w ould explicitly give USER1 the ability to read rows from the table? (Select the correct response) A. GRANT VIEW TO user1 ON TABLE table1 B. GRANT READ TO user1 ON TABLE table1 C. GRANT SELECT ON TABLE table1 TO user1 D. GRANT ACCESS ON TABLE table1 TO user1 (22/55)Which of the following tools can be used to identify inefficient SQL statements without executing the query? (Select the correct response) A. QMF B. Script Center C. Visual Explain D. Performance Monitor (23/55)Which of the following describes when indexes can be explicitly refe renced by name within an SQL statement?
  • 115.
    (Select the correct response) A. When dropping the index B. When updating the index C. When selecting on the index D. When inserting using the index (24/55) For a clustering index to be effective in keeping the data in order , which of the following parameters must be set correctly for the index? (Select the correct response) A. FREE ROWS B. PERCENT FREE C. CLUSTERRATIO D. CLUSTER FACTOR (25/55) The user USER1 is executing the statement CREATE TABLE app1.table1 (col1 INT, col2 INT) Which of the following privileges is required by USER1 for the statement to b e successful? (Select the correct response) A. CREATEIN for the database B. CREATEIN for the schema app1 C. CREATEIN for the schema user1 D. CREATEIN for the table table1 (26/55) Given the statement: CREATE TABLE t1 ( c1 INTEGER NOT NULL, c2 INTEGER, PRIMARY KEY(c1), FOREIGN KEY(c2) REFERENCES t2 ) How many non-unique indexes are defined for table t1? (Select the correct response) A. 0 B. 1 C. 2 D. 3 (27/55) To set up a client that can access DB2 UDB through DB2 Connect Ente rprise Edition, which of the following is the minimum software client that mu st be installed? (Select the correct response) A. DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client (28/55)Which of the following CANNOT be used to restrict specific values fr
  • 116.
    om being insertedinto a column in a particular table? (Select the correct response) A. view B. index C. check constraint D. referential constraint (29/55) Which of the following can be accomplished with a single UPDATE sta tement? (Select the correct response) A. Updating multiple tables B. Updating a view consisting of joined tables C. Updating multiple tables based on a WHERE clause D. Updating a table based on a sub-select using joined tables (30/55)User2 has DBADM authority on database DB1. This allows the user to d o which of the following? (Select the correct response) A. Drop database DB1 B. Backup database DB1 C. Create tables in any database D. Create tables in database DB1 (31/55)Given the two following tables: Names Names Number Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Brett Hull 16 Mario Lemieux 66 Steve Yzerman 19 Claude Lemieux 19 Mark Messier 11 Mats Sundin 13 POINTS Names Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94 Which of the following statements will display the player's Names, numbers an d points for all players with an entry in both tables?
  • 117.
    (Select the correctresponse) A. SELECT names.names, names.number, points.points FROM names INNER JOIN poin ts ON names.name=points.name B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN points ON names.name=points.name C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name (32/55) Which of the following can occur once connected to a database or DR DA server with an explicit authorization name? (Select the correct response) A. Omit a user's password. B. Change a user's password if the server supports this function. C. Omit the name of the database or DRDA server if it is local. D. Use the commit option on the connect statement to commit in-doubt units of work from a previous connection that was terminated. (33/55)Which of the following DB2 components allows the analysis of multidi mensional databases? (Select the correct response) A. DB2 Runtime Client B. DB2 Control Center C. DB2 OLAP Starter Kit D. DB2 Spatial Extender E. DB2 Performance Monitor (34/55)Which of the following DB2 UDB isolation levels will NOT lock any ro ws during read processing? (Select the correct response) A. Read Stability B. Repeatable Read C. Uncommited Read D. Cursor Stability (35/55)Which of the following authorities should be given to the DB2 Admini stration Server (DAS) Instance owner at the administered instance? (Select the correct response) A. DBADM B. SYSADM C. SYSCTRL D. SYSMAINT (36/55)Which of the following products can be used to generate Extensible M arkup Language documents from DB2 tables? (Select the correct response) A. Net Search B. XML Extender
  • 118.
    C. AVI Extender D.Text Extender (37/55)Which of the following processing can occur for a unit of work using an isolation level of Read Stability and scanning through the table more tha n once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Rows added to a result set by other processes from one scan to the next D. Rows changed in a result set by other processes from one scan to the next (38/55)Which two of the following SQL data types should be used to store bi nary data? (Select all that apply) A. CLOB B. BLOB C. VARCHAR D. GRAPHIC E. VARCHAR FOR BIT DATA (39/55) Given an application bound with cursor stability which will be upda ting rows in a table and obtaining row locks, which of the following table lo cks will DB2 acquire for the application first? (Select the correct response) A. U – update B. X – exclusive C. IU - intent update D. IX - intent exclusive (40/55)Which of the following is the result of the following SQL statement: ALTER TABLE table1 ADD col2 INT WITH DEFAULT (Select the correct response) A. The statement fails with a negative SQL code. B. The statement fails because no default value is specified. C. A new column called COL2 is added to TABLE1 and populated with zeros. D. A new column called COL2 is added to TABLE1 and populated with nulls. E. A new column called COL2, which cannot contain nulls, is added to TABLE1. (41/55)In which of the following locations are the referential constraints stored? (Select the correct response) A. The user tables. B. The explain tables. C. SYSIBM.SYSTRIGGERS. D. The system catalog tables.
  • 119.
    (42/55)If a DB2Warehouse Manager toolkit is selected during the installati on of DB2 UDB Version 7.1, which of the following databases must be defined? (Select the correct response) A. None B. Target Database C. Source Database D. Control Database (43/55)Given the two following 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(20) Years INTEGER Salary DECIMAL(10,2) Comm DECIMAL(10,2) Which of the following statements will display each department, by name, and the total salary of all employees in the department? (Select the correct response) A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt ORDER BY a.deptname B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt ORDER BY a.deptname C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt GROUP BY a.deptname D. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.de pt GROUP BY a.deptname (44/55)Given the following scenario: An application uses a 15 digit value t o uniquely identify customer transactions. This number is also used for arith metic operations. Which of the following is the most efficient DB2 data type for the column definition for this purpose? (Select the correct response) A. CHAR B. CLOB C. INTEGER D. NUMERIC(15,2)] E. DECIMAL(15,0) (45/55)Which of the following tools allows the DBA to set limits, and be al
  • 120.
    erted if theselimits are exceeded? (Select the correct response) A. DB2 Index Wizard B. DB2 Script Center C. DB2 Command Center D. DB2 Performance Monitor (46/55) Given the statement: CREATE TABLE t1 ( c1 CHAR(3) CONSTRAINT c1 CHECK (c1 IN ('A01','B01','C01')) ) DB2 verifies that the table check constraint is met during which of the follo wing actions? (Select the correct response) A. Adding data using load B. The reorg of the table C. The insert of each row in t1 D. The creation of the index for the table (47/55)Given the following SQL statements: CREATE TABLE tab1 (col1 INT) CREATE TABLE tab2 (col1 INT) INSERT INTO tab1 VALUES (NULL),(1) INSERT INTO tab2 VALUES (NULL),(1) SELECT COUNT(*) FROM tab1 WHERE col1 IN (SELECT col1 FROM tab2) Which of the following is the result of the SELECT COUNT(*) statement? (Select the correct response) A. 1 B. 2 C. 3 D. 4 E. 0 (48/55)Given two embedded SQL program executions with the following actions : Pgm1 INSERT INTO mytab VALUES (...) COMMIT INSERT INTO mytab VALUES (...) ROLLBACK Pgm2 INSERT INTO mytab VALUES (...) ROLLBACK
  • 121.
    INSERT INTO mytabVALUES (...) COMMIT How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A. 1 B. 2 C. 3 D. 4 (49/55)Given the table T1 created by: CREATE TABLE t1 ( id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, c1 CHAR(10) NOT NULL, c2 CHAR(10) ) Which of the following INSERT statements will succeed? (Select the correct response) A. INSERT INTO t1 VALUES (1, 'abc', NULL) B. INSERT INTO t1 VALUES (1, NULL, 'def') C. INSERT INTO t1 (c1, c2) VALUES ('abc', NULL) D. INSERT INTO t1 (c1, c2) VALUES (NULL, 'def') (50/55)Which of the following tasks can be performed using the ALTER TABLES PACE statement? (Select the correct response) A. Assign a bufferpool. B. Change the table space name. C. Change the type of the table space. D. Change the page size of the table space. (51/55)A view is used instead of a table for users to do which of the follo wing? (Select the correct response) A. Avoid allocating more disk space per database B. Provide users with the ability to define indexes C. Restrict user's access to a subset of the table data D. Avoid allocating frequently used query result tables (52/55)Given the following table definitions: DEPARTMENT Deptno CHAR(3) Deptno CHAR(30) Mgrno INTEGER Admrdept CHAR(3) EMPLOYEE Empno INTEGER
  • 122.
    Firstname CHAR(30) Midinit CHAR LastnameCHAR(30) Workdept CHAR(3) Which of the following statements will list the employee's employee number, l ast name, and department name ONLY for those employees who have a department? (Select the correct response) A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE e.workdept = d.deptno B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep artment d ON e.workdept = d.deptno C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep artment d ON e.workdept = d.deptno D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de partment d WHERE e.workdept = d.deptno (53/55)A table called EMPLOYEE has columns: name, department, and phone_num ber. Which of the following can limit access to the phone_number column? (Select the correct response) A. Using a view to access the table B. Using an index on the column C. Using a referential constraint on the table D. Using a table check constraint on the table E. Revoking access from the phone_number column (54/55)Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, it should only change if another agent unassigns a currently assigned sea t. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read (55/55)Given table EMPLOYEE with columns EMPNO and SALARY and table JOB wit h columns ID and TITLE, what is the effect of the statement: UPDATE employee SET salary = salary * 1.15 WHERE salary < 15000 OR EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr' ) (Select the correct response) A. Only managers that make less than 15,000 are given salary increases. B. Only non-managers that make less than 15,000 are given salaray increases. C. Employees that make less than 15,000 but no managers are given salary incr
  • 123.
    eases. D. Employees thatmake less than 15,000 and all managers are given salary inc reases. *************************************************** 自测题 10 -------------------------------------------------------------------------------- 1. With DBADM authority on the database and given the statements: CREATE TABLE t1 (c1 CHAR(1)) INSERT INTO t1 VALUES ('b') CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION INSERT INTO v1 VALUES ('a') INSERT INTO v1 VALUES ('b') How many rows would be returned from the statement, SELECT c1 FROM t1? (Select the correct response) A.0 B.1 C.2 D.3 2. Which of the following statements will create an index and prevent table T 1 from containing two or more rows with the same values for column C1? (Select the correct response) A. CREATE UNIQUE INDEX ix4 ON t1 (c1) B. CREATE DISTINCT INDEX ix1 ON t1 (c1) C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2) D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2) 3. A user has a numeric data column with a maximum value of 100,000. Which of the following data types will use the minimum amount of storage for the colu mn? (Select the correct response) A. IDENTITY B. BIGINT C. INTEGER D. SMALLINT 4. Given the table T1, created by: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY,
  • 124.
    c1 CHAR(3) ) The followingSQL statements are issued: INSERT INTO t1 VALUES (1, 'ABC') INSERT INTO t1 VALUES (5, 'DEF') Which of the following values are inserted into the ID column by the followin g statement? INSERT INTO t1(c1) VALUES ('XYZ') (Select the correct response) A.0 B.1 C.2 D.5 E.6 5. Which of the following is the implicit qualifier for a declared temporary table? (Select the correct response) A. The schema name SYSCAT. B. The schema name SESSION. C. The schema name TEMPUSER. D. The userid specified with the BIND command. E. The userid who established the connection to the database and declared the temporary table. 6. Which of the following is the best way to restrict user access to a subset of columns in a table? (Select the correct response) A. Only grant access to the columns within a table that a user is allowed to see. B. Create a view that only includes the columns a user is allowed to see. Gra nt the user access to the view, not the base table. C. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a join when all data must be presented. D. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a union when all data must be presented. 7. Which of the following is the result of a successful ROLLBACK statement? (Select the correct response) A. Held locks are released B. Release-pending conditions are undone C. Tables in LOAD PENDING are released D. Constraint checking conditions are undone E. Existing database connections are released 8. Which two of the following modes can be used on the lock table statement?
  • 125.
    (Select all thatapply) A. SHARE MODE B. EXCLUSIVE MODE C. REPEATABLE READ MODE D. UNCOMMITTED READ MODE E. INTENT EXCLUSIVE MODE 9. Which of the following must be set up to allow the Control Center to view database objects? (Select the correct response) A. ODBC B. JAVA C. DB2 Administration Server D. Client Configuration Assistant 10. Which of the following tools maintains a history of all executed statemen ts/commands for the current session within the tool? (Select the correct response) A. Journal B. SQL Assist C. DB2 Alert Center D. DB2 Command Center 11. Given the two following tables: Points Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 PIM Name PIM Mats Sundin 14 Jaromir Jagr 18 Bobby Orr 12 Mark Messier 32 Brett Hull 66 Mario Lemieux 23 Joe Sakic 94 Which of the following statements will display the player's Names, points and PIM for all players? (Select the correct response) A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI N pim ON points.name=pim.name B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE R JOIN pim ON points.name=pim.name
  • 126.
    C. SELECT points.name,points.points, pim.name, pim.pim FROM points LEFT OUTE R JOIN pim ON points.name=pim.name D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT ER JOIN pim ON points.name=pim.name 12. Given the following: TAB1 TAB2 C1 C2 CX CY --- --- --- --- A 11 A 21 B 12 C 22 C 13 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 joins will yield the desired results? (Select the correct response) A. SELECT * FROM tab1, tab2 WHERE c1=c0078 B. SELECT * FROM tab1 INNER 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 13. Given two embedded SQL programs and the following actions: Pgm1 Pgm2 INSERT INTO mytab VALUES (...) DELETE FROM mytab COMMIT ROLLBACK DELETE FROM mytab INSERT INTO mytab VALUES (...) ROLLBACK COMMIT If there exists one (1) row in table mytab before the programs are executed c oncurrently, how many records will be in the table once the programs complete ? (Select the correct response) A.0 B.1 C.2 D.3 E.4 14 Which of the following DB2 data types is used to store 50 MB of binary dat a as a single value? (Select the correct response) A. BLOB B. CLOB C. DBCLOB D. FOR BIT DATA E. VARCHAR FOR BIT DATA
  • 127.
    15. Given thefollowing table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) Which of the following statements will return all of the records ordered by j ob with the salaries in descending order? (Select the correct response A. SELECT * FROM staff ORDER BY salary DESC, job B. SELECT * FROM staff GROUP BY salary DESC, job C. SELECT * FROM staff ORDER BY job, salary DESC D. SELECT * FROM staff GROUP BY job, salary DESC 16. Given the following table definitions DEPARTMENT Deptno CHAR(3) Deptname CHAR(30) Mgrno INTEGER Admrdept CHAR(3) EMPLOYEE Empno INTEGER Firstname CHAR(30) Midinit CHAR Lastname CHAR(30) Workdept CHAR(3) Which of the following statements will list the employee's employee number, l ast name, and department name ONLY for those employees who have a department? A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHERE e.workdept = d.deptno B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN dep artment d ON e.workdept = d.deptno C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN dep artment d ON e.workdept = d.deptno D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN de partment d WHERE e.workdept = d.deptno 17. Given the statement: CREATE TABLE t1 (c1 CHAR(1)) Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol lowing command is issued: ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a') Which of the following occurs? (Select the correct response)
  • 128.
    A. Rows with c1 values of b,c,d,e,f are deleted B. Rows with c1 values of b,c,d,e,f have c1 set to NULL C. The ALTER command will fail as rows violate the constraint D. The ALTER command will move the violating rows to the exception table 18. Given the following table structure: table1 emp_num INT NOT NULL PRIMARY KEY emp_fname CHAR(30) NOT NULL emp_lname CHAR(30) NOT NULL emp_addr CHAR(60) NOT NULL emp_pin CHAR(10) NOT NULL Which of the following columns can be referenced by a foreign key clause from another table? (Select the correct response) A. emp_num B. emp_pin C. emp_addr D. emp_fname E. emp_lname 19. Which of the following products can be used to perform a dictionary-based search? (Select the correct response) A. Net.Data B. XML Extender C. AVI Extender D. Text Extender 20. Which of the following DB2 components can limit the resource consumption of queries? (Select the correct response) A. DB2 Connect B. DB2 Query Patroller C. DB2 Performance Monitor D. DB2 Net Search Extender 21. Given the table: 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 Which of the following clauses when added to the statement SELECT cities, name FROM country returns rows sorted by NAME and then sorted by the number of cities (CITIES)?
  • 129.
    (Select the correct response) A. ORDER BY 2,1 B. GROUP BY 2, 1 C. ORDER BY cities, name D. GROUP BY cities, name 22. Which of the following will rebuild a package in the database from the ex isting catalog information? (Select the correct response) A. bind B. rebind C. update D. rebuild 23. Given the following column requirements: Col1 Numeric Identifier - From 1 to 1000000 Col2 Job Code - Variable, 1 to 2 characters long Col3 Job Description - Variable, 1 to 100 characters long Col4 Job Length - Length of Job in seconds Which of the following will minimize the disk space allocated to store the re cords if Job Description has an average length of 45? (Select the correct response) A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT) B. B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT) C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT) D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT) 24. Given the following UPDATE statement: UPDATE address2 SET housenumber_buildingname= (SELECT buildingname FROM address1 WHERE address2.id = address1.id) WHERE HOUSENUMBER_BUILDINGNAME IS NULL Which of the following describes the result of the statement? (Select the correct response) A. The statement will succeed. B. The statement will fail because a subquery cannot exist in an UPDATE state ment. C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined as primary keys. D. The statement will succeed if the data retrieved from the subquery does no t have duplicate values for ADDRESS1.ID. 25. Which of the following processing can occur for a unit of work using an i solation level of Cursor Stability and allows scanning through the table more than once within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Have updated result set rows changed by other processes from one scan to t
  • 130.
    he next D. Haveaccessed result set rows changed by other processes from one scan to the next 26. How many DB2 Administration Server (DAS) Instances can be set up per phys ical machine? (Select the correct response) A.0 B.1 C. One for each instance on the physical machine D. One for each database on the physical machine 27. A table called EMPLOYEE has columns: name, department, and phone_number. Which of the following can limit access to the phone_number column? (Select the correct response) A. Using a view to access the table B. Using an index on the column C. Using a referential constraint on the table D. Using a table check constraint on the table E. Revoking access from the phone_number column 28. Given the following transaction: CREATE TABLE dwaine.mytab (col1 INT, col2 INT) INSERT INTO dwaine.mytab VALUES (1,2) INSERT INTO dwaine.mytab VALUES (4,3) ROLLBACK Which of the following would be returned from the statement: SELECT * FROM dwaine.mytab? (Select the correct response) A. COL1 COL2 ----------- ----------- 0 record(s) selected. B. COL1 COL2 ----------- ----------- 1 2 1 record(s) selected. C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name. D. COL1 COL2 ----------- ----------- 1 2 4 3 29. Given the table definition: CREATE TABLE student (name CHAR(30), age INTEGER) To list the names of the 10 youngest students, which of the following index d efinition statements on the student table may improve the query performance? (Select the correct response)
  • 131.
    A. CREATE INDEX youngest ON student (age, name) B. CREATE INDEX youngest ON student (name, age) C. CREATE INDEX youngest ON student (name, age DESC) D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age) 30. Which of the following privileges is necessary to populate the table with large amounts of data? (Select the correct response) A. LOAD B. ALTER C. UPDATE D. IMPORT 31. Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response) A. –f B.-b C.-o D.-w 32. Given the following table with a primary key on empid: Emp: Empid Name 11 Joe Smith 23 Melanie Jones 30 Robert Bruce 49 Janice Baker 66 Mario Diaz 68 Maria Diaton Give the following statement in an embedded SQL program bound with Repeatable Read: Select * from Emp where empid < 55 How many rows in the table will be locked after the statement is run? A.0 B.1 C.4 D.5 E.6 33. Given table T1 with 100 rows, which of the following queries will retriev e 10 rows from table T1? (Select the correct response) A. SELECT * FROM t1 MAXIMUM 10 ROWS B. SELECT * FROM t1 READ 10 ROWS ONLY C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY 34. Which of the following DELETE RULES on CREATE TABLE will delete a depende
  • 132.
    nt table rowif the parent table row is deleted? (Select the correct response A. ON DELETE REMOVE B. ON DELETE CASCADE C. ON DELETE RESTRICT D. ON DELETE SET NULL E. ON DELETE PROPAGATE 35. Which of the following isolation levels will lock only the rows returned in the result set? A. Read Stability B. Repeatable Read C. Cursor Stability D. Uncommitted Read 36. Using the Control Center Create Table dialog box, which of the following dialogs allows the table creation DDL to be viewed? (Select the correct response A. Copy B. Show SQL C. Show Related D. Sample Contents 37. Which of the following does NOT end a unit of work? (Select the correct response) A. COMMIT B. ROLLBACK C. TERMINATE D. SAVEPOINT E. CONNECT RESET 38. Given the following embedded SQL programs: Program 1: CREATE TABLE mytab (col1 INT, col2 CHAR(24)) COMMIT Program 2: INSERT INTO mytab VALUES ( 20989,'Joe Smith') INSERT INTO mytab VALUES ( 21334,'Amy Johnson') COMMIT DELETE FROM mytab ROLLBACK INSERT INTO mytab VALUES ( 23430,'Jason French') ROLLBACK INSERT INTO mytab VALUES ( 20993,'Samantha Jones') COMMIT DELETE FROM mytab WHERE col1=20993 ROLLBACK Which of the following indicates the number of records that will be returned by the statement:
  • 133.
    SELECT * FROMmytab? (Select the correct response) A.0 B.1 C.2 D.3 E.4 39. Given an embedded SQL program with a single connection, two threads and t he following actions: Thread 1: INSERT INTO mytab VALUES (...) Thread 2: INSERT INTO mytab VALUES (...) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (...) Thread 1: ROLLBACK How many records will be successfully inserted and retained in the table myta b? (Select the correct response) A.0 B.1 C.2 D.3 40. Which two of the following types of storage management method is supporte d by DB2 OLAP Server ? (Select all that apply) A. Object B. Network C. Relational D. Hierachical E. Multi-dimensional 41. Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with col umns ID and TITLE, what is the effect of the statement: UPDATE employee SET salary = salary * 1.15 WHERE salary < 15000 OR EXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = 'Mgr' ) (Select the correct response) A. Only managers that make less than 15,000 are given salary increases. B. Only non-managers that make less than 15,000 are given salaray increases. C. Employees that make less than 15,000 but no managers are given salary incr eases. D. Employees that make less than 15,000 and all managers are given salary inc reases. 42. When manually establishing communications from a Windows NT client throug h a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT required to catalog?
  • 134.
    (Select the correctresponse A. The client. B. The database on the DRDA server. C. The Database Connection Service database. D. The node where the DB2 Connect Gateway is. 43. Which of the following is the most appropriate reason to consider revokin g the SELECT privilege on the catalog tables from PUBLIC after creating a dat abase? (Select the correct response A. To prevent users from creating tables without proper authority. B. Some system catalogs record user data in some columns, and this data may b e confidential. C. To prevent users from viewing passwords for other DB2 userids that DB2 sto res in the catalog tables. D. Some catalog tables are large, so preventing users from viewing them is a good way to keep users from submitting long-running queries against the catal ogs. 44. For which of the following can locks be obtained? (Select the correct response) A. A trigger B. A table view C. A table column D. A database buffer E. A row referenced by an index key 45. With tables defined as: Table1 col1 INT col2 CHAR(30) Table2 col1 INT col2 CHAR(30) Which of the following statements will insert all the rows in TABLE2 into TAB LE1? (Select the correct response) A. INSERT INTO table1 SELECT col1, col2 FROM table2 B. INSERT INTO table1 AS SELECT col1, col2 FROM table2 C. INSERT INTO table1 VALUES (table2.col1, table2.col2) D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2) E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2) 47. Which of the following products must be installed to provide a single poi nt of control for local and remote DB2 databases? (Select the correct response A. DB2 Runtime Client B. DB2 Administration Client
  • 135.
    C. DB2 ConnectEnterprise Edition D. DB2 Enterprise-Extended Edition 48. Which one of the following SQL statements sets the default qualifier to " user1"? (Select the correct response) A. SET CURRENT ID = 'user1' B. SET CURRENT USER = 'user1' C. SET CURRENT SQLID = 'user1' D. SET CURRENT QUALIFIER = 'user1' 49. Which of the following can be used to determine the views that are affect ed by a DROP TABLE statement? (Select the correct response) A. DB2 Script Center B. DB2 Performance Monitor C DB2 Control Center, Show Related D. DB2 Control Center, Sample Contents 50. A view is used instead of a table for users to do which of the following? (Select the correct response) A. Avoid allocating more disk space per database B. Provide users with the ability to define indexes C. Restrict user's access to a subset of the table data D. Avoid allocating frequently used query result tables 51. Which of the following processing can occur for a unit of work using an i solation level of Read Stability and scanning through the table more than onc e within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Rows added to a result set by other processes from one scan to the next D. Rows changed in a result set by other processes from one scan to the next 52. Given the tables: TABLEA TABLEB Empid name empid weeknumber paycheck 1 JOE 1 1 1000.00 2 BOB 1 2 1000.00 2 1 1000.00 TABLEB was defined as follows: CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2) , CONSTRAINT const1 FOREIGN KEY (empid) REFERENCES tablea (empid) ON DELETE SET NULL) How many rows would be deleted from tableb if the following command is issued :
  • 136.
    DELETE FROM tableaWHERE empid = '2'? (Select the correct response) A.0 B.1 C.2 D.3 53. To set up a client that can access DB2 UDB through DB2 Connect Enterprise Edition, which of the following is the minimum software client that must be installed? (Select the correct response) A. DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client 54. Given the following table definition: STAFF Id INTEGER Name CHAR(20) Dept INTEGER Job CHAR(20) Years INTEGER Salary DECIMAL(10,2) Comm. DECIMAL(10,2) Which of the following statements will return all of the records ordered by j ob with the salaries in descending order? (Select the correct response E. SELECT * FROM staff ORDER BY salary DESC, job F. SELECT * FROM staff GROUP BY salary DESC, job G. SELECT * FROM staff ORDER BY job, salary DESC H. SELECT * FROM staff GROUP BY job, salary DESC 55. Given the table: 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 Which of the following clauses when added to the statement SELECT cities, name FROM country returns rows sorted by NAME and then sorted by the number of cities (CITIES)? (Select the correct response) E. ORDER BY 2,1 F. GROUP BY 2, 1 G. ORDER BY cities, name
  • 137.
    H. GROUP BYcities, name ******************************************************** 自测题 11 -------------------------------------------------------------------------------- 1. Which of the following is the result of the following SQL statement: CREATE UNIQUE INDEX empno_ind ON employee (empno) (Select the correct response) A. Every value for EMPNO must be unique. B. UPDATE statements on EMPNO will be rolled back. C. Insert statements on EMPNO will always be faster. D. Insert statements on the EMPNO table will result in clustered data. 2. Which of the following will rebuild a package in the database from the exi sting catalog information? (Select the correct response) A. bind B. rebind C. update D. rebuild 3. Why is a unique index not sufficient for creation of a primary key? (Select the correct response) A. It is sufficient - a primary key is the same thing as a unique index. B. Unique indexes can be defined in ascending or descending order. Primary k eys must be ascending. C. A unique index can be defined over a column or columns that allow nulls. P rimary keys cannot contain nulls. D. A unique index can be defined over a column or columns that allow nulls. T his is not allowed for primary keys because foreign keys cannot contain nulls . 4. Which of the following statements will create an index and prevent table T 1 from containing two or more rows with the same values for column C1? (Select the correct response) A. CREATE UNIQUE INDEX ix4 ON t1 (c1) B. CREATE DISTINCT INDEX ix1 ON t1 (c1) C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2) D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2) 5. Which of the following DB2 data types is used to store 50 MB of binary dat
  • 138.
    a as asingle value? (Select the correct response) A. BLOB B. CLOB C. DBCLOB D. FOR BIT DATA E. VARCHAR FOR BIT DATA 6. Given the following UPDATE statement: UPDATE address2 SET housenumber_buildingname= (SELECT buildingname FROM address1 WHERE address2.id = address1.id) WHERE HOUSENUMBER_BUILDINGNAME IS NULL Which of the following describes the result of the statement? (Select the correct response) A. The statement will succeed. B. The statement will fail because a subquery cannot exist in an UPDATE state ment. C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined as primary keys. D. The statement will succeed if the data retrieved from the subquery does no t have duplicate values for ADDRESS1.ID. 7. Which two of the following types of storage management method is supported by DB2 OLAP Server ? (Select all that apply) A. Object B. Network C. Relational D. Hierachical E. Multi-dimensional 8. Given the table: 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 Which of the following clauses when added to the statement SELECT cities, name FROM country returns rows sorted by NAME and then sorted by the number of cities (CITIES)? (Select the correct response) A. ORDER BY 2,1 B. GROUP BY 2, 1 C. ORDER BY cities, name D. GROUP BY cities, name
  • 139.
    9. A viewis used instead of a table for users to do which of the following? (Select the correct response) A. Avoid allocating more disk space per database B. Provide users with the ability to define indexes C. Restrict user's access to a subset of the table data D. Avoid allocating frequently used query result tables 10. Which of the following must be set up to allow the Control Center to view database objects? (Select the correct response) A. ODBC B. JAVA C. DB2 Administration Server D. Client Configuration Assistant 11. Which of the following does NOT end a unit of work? (Select the correct response) A. COMMIT B. ROLLBACK C. TERMINATE D. SAVEPOINT E. CONNECT RESET 12. Given the statement: CREATE TABLE t1 (c1 CHAR(1)) Data has been inserted into the table with rows of a,b,c,d,e,f. Given the fol lowing command is issued: ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 ='a') Which of the following occurs? (Select the correct response) A. Rows with c1 values of b,c,d,e,f are deleted B. Rows with c1 values of b,c,d,e,f have c1 set to NULL C. The ALTER command will fail as rows violate the constraint D. The ALTER command will move the violating rows to the exception table 13. Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response) A. –f B. –b C. –o D. –w 14. Which of the following is the best way to restrict user access to a subse t of columns in a table? (Select the correct response) A. Only grant access to the columns within a table that a user is allowed to
  • 140.
    see. B. Create aview that only includes the columns a user is allowed to see. Gra nt the user access to the view, not the base table. C. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a join when all data must be presented. D. Create two tables: one with the columns that a user is allowed to see, and one that has the confidential columns, and use a union when all data must be presented. 15. Given the following embedded SQL programs: Program 1: CREATE TABLE mytab (col1 INT, col2 CHAR(24)) COMMIT Program 2: INSERT INTO mytab VALUES ( 20989,'Joe Smith') INSERT INTO mytab VALUES ( 21334,'Amy Johnson') COMMIT DELETE FROM mytab ROLLBACK INSERT INTO mytab VALUES ( 23430,'Jason French') ROLLBACK INSERT INTO mytab VALUES ( 20993,'Samantha Jones') COMMIT DELETE FROM mytab WHERE col1=20993 ROLLBACK Which of the following indicates the number of records that will be returned by the statement: SELECT * FROM mytab? (Select the correct response) A.. B.1 C.2 D.3 E.4 16. When manually establishing communications from a Windows NT client throug h a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT required to catalog? (Select the correct response) A. The client. B. The database on the DRDA server. C. The Database Connection Service database. D. The node where the DB2 Connect Gateway is. 17. Which of the following products can be used to perform a dictionary-based search? (Select the correct response) A. Net.Data
  • 141.
    B. XML Extender C.AVI Extender D. Text Extender 18. Given the following DDL statements, CREATE TABLE t1 (a INT, b INT, c INT) CREATE VIEW v1 AS SELECT a, b, c FROM t1 WHERE a > 250 WITH CHECK OPTION Which of the following INSERT statements will fail? (Select the correct response) A. INSERT INTO t1 VALUES (200, 2, 3) B. INSERT INTO v1 VALUES (200, 2, 3) C. INSERT INTO t1 VALUES (300, 2, 3) D. INSERT INTO v1 VALUES (300, 2, 3) 19. Given the two following tables: Points Name Points Wayne Gretzky 244 Jaromir Jagr 168 Bobby Orr 129 Bobby Hull 93 Brett Hull 121 Mario Lemieux 189 PIM Name PIM Mats Sundin 14 Jaromir Jagr 18 Bobby Orr 12 Mark Messier 32 Brett Hull 66 Mario Lemieux 23 Joe Sakic 94 Which of the following statements will display the player's Names, points and PIM for all players? (Select the correct response) A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOI N pim ON points.name=pim.name B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTE R JOIN pim ON points.name=pim.name C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTE R JOIN pim ON points.name=pim.name D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUT ER JOIN pim ON points.name=pim.name 20. Which of the following is the implicit qualifier for a declared temporary table?
  • 142.
    (Select the correctresponse) A. The schema name SYSCAT. B. The schema name SESSION. C. The schema name TEMPUSER. D. The userid specified with the BIND command. E. The userid who established the connection to the database and declared the temporary table. 21. Which of the following SQL statements can remove all rows from a table na med COUNTRY? (Select the correct response A. DELETE country B. DELETE FROM country C. DELETE * FROM country D. DELETE ALL FROM country 22. Which of the following occurs if an application ends abnormally during an active unit of work? (Select the correct response) A. Current unit of work is committed B. Current unit of work is rolled back C. Current unit of work remains active D. Current unit of work moves to pending state 23.A user creates the table TABLE1. Which of the following statements would explicitly give USER1 the ability to read rows from the table? (Select the correct response) A. GRANT VIEW TO user1 ON TABLE table1 B. GRANT READ TO user1 ON TABLE table1 C. GRANT SELECT ON TABLE table1 TO user1 D. GRANT ACCESS ON TABLE table1 TO user1 24.Which of the following tools can be used to identify inefficient SQL stat ements without executing the query? (Select the correct response) A. QMF B. Script Center C. Visual Explain D. Performance Monitor 25.The DB2 Administration Server (DAS) is required for which of the followin g? (Select the correct response) A. For the administrator user id to install or remove DB2 B. For the remote clients to use the Control Center against the instance C. For checking authorities in the database manager configuration for SYSADM D. For maintaining authorities added and removed by the SQL GRANT and REVOKE commands respectively
  • 143.
    26.Which of thefollowing authorities should be given to the DB2 Administrat ion Server (DAS) Instance owner at the administered instance? (Select the correct response) A. DBADM B. SYSADM C. SYSCTRL D. SYSMAINT 27.Which two of the following DB2 authorization groups are authorized to cre ate a table within database sample? (Select all that apply) A. DBADM B. DBCTRL C. SYSADM D. DBMAINT E. ALTERIN F. SYSMAINT 28.Given the following: A table containing a list of all seats on an airplane. A seat consists of a s eat number and whether or not it is assigned. An airline agent lists all the unassigned seats on the plane. When the agent refreshes the list from the tab le, the list should not change. Which of the following isolation levels should be used for this application? (Select the correct response) A. Read stability B. Repeatable read C. Cursor stability D. Uncommitted read 29.Which of the following is the result of the following SQL statement: ALTER TABLE table1 ADD col2 INT WITH DEFAULT (Select the correct response) A. The statement fails with a negative SQL code. B. The statement fails because no default value is specified. C. A new column called COL2 is added to TABLE1 and populated with zeros. D. A new column called COL2 is added to TABLE1 and populated with nulls. E. A new column called COL2, which cannot contain nulls, is added to TABLE1. 30.To set up a client that can access DB2 UDB through DB2 Connect Enterprise Edition, which of the following is the minimum software client that must be installed? (Select the correct response) A. DB2 Runtime Client B. DB2 Personal Edition C. DB2 Administration Client D. DB2 Application Developer's Client
  • 144.
    31.Which of thefollowing types of DB2 locks allows for the most concurrency within a table? (Select the correct response) A. A row lock B. A page lock C. A field lock D. A column lock 32.Which of the following processing can occur for a unit of work using an i solation level of Read Stability and scanning through the table more than onc e within the unit of work? (Select the correct response) A. Access uncommitted changes made by other processes B. Update uncommitted changes made by other processes C. Rows added to a result set by other processes from one scan to the next D. Rows changed in a result set by other processes from one scan to the next 33.Given the following SQL statements: CREATE TABLE tab1 (col1 INT) CREATE TABLE tab2 (col1 INT) INSERT INTO tab1 VALUES (NULL),(1) INSERT INTO tab2 VALUES (NULL),(1) SELECT COUNT(*) FROM tab1 WHERE col1 IN (SELECT col1 FROM tab2) Which of the following is the result of the SELECT COUNT(*) statement? (Select the correct response) A. 1 B. 2 C. 3 D. 4 E. 0 34.Given an application bound with cursor stability which will be updating r ows in a table and obtaining row locks, which of the following table locks wi ll DB2 acquire for the application first? (Select the correct response) A. U – update B. X – exclusive C. IU - intent update D. IX - intent exclusive 35.When granted to user1, which of the following will allow user1 to ONLY ac cess table data? (Select the correct response) A. DBADM authority B. SYSADM authority C. SELECT privilege on the table
  • 145.
    D. SELECT privilegeWITH GRANT OPTION on the table ********************************************************** DB2v8 模拟试题 Given the table COUNTRY and the statements below: COUNTRY ID NAME PERSON_ID 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 COUNTRY(PERSON_ID) is the foreign key for STAFF(ID). Which of the following statements removes from the COUNTRY table those rows that do not have a STAFF person assigned? A. DELETE FROM country WHERE id IN (SELECT id FROM staff) B. DELETE FROM country WHERE id NOT IN (SELECT person_id FROM staff) C. DELETE FROM country WHERE person_id NOT IN (SELECT id FROM staff) D. DELETE FROM country WHERE person_id IN (SELECT person_id FROM staff) Which of the following isolation levels will hold locks only on the rows in the answer set at the end of the query? A. Read Stability B. Repeatable Read C. Cursor Stability D. Uncommitted Read
  • 146.
    Which two ofthe following SQL data types should be used to store double byte character data? A. CLOB B. CHAR C. DBCLOB D. GRAPHIC E. VARCHAR A unit of work is using an isolation level of Uncommitted Read, and allows scanning through the table more than once within the unit of work. Which of the following can occur during processing of this unit of work? A. It can access uncommitted changes made by other transactions. B. It can update uncommitted changes made by other transactions. C. It can update rows and have those updated rows be changed by other transactions from one scan to the next. D. It can update rows and have those updated rows be committed by other transactions from one scan to the next. Which of the following can be used to store images in a DB2 database? A. DB2 AVI Extender B. DB2 XML Extender C. DB2 Text Extender D. DB2 Spatial Extender Given the following transaction in an embedded SQL application: CREATE TABLE dwaine.mytab (col1 INT, col2 INT) INSERT INTO dwaine.mytab VALUES (1,2) INSERT INTO dwaine.mytab VALUES (4,3) ROLLBACK What is the result of issuing the following statement? SELECT * FROM dwaine.mytab
  • 147.
    A. SQLCODE -204indicating that "DWAINE.MYTAB" is an undefined name. B. COL1 COL2 ------------ ----------- 0 record(s) selected. C. COL1 COL2 ------------ ----------- 1 2 1 record(s) selected. D. COL1 COL2 ------------ ----------- 1 2 4 3 2 record(s) selected. Which of the following statements will create an index and prevent table T1 from containing two or more rows with the same values for column C1? A. CREATE UNIQUE INDEX ix1 ON t1 (c1) B. CREATE DISTINCT INDEX ix1 ON t1 (c1) C. CREATE UNIQUE INDEX ix1 ON t1 (c1,c2) D. CREATE DISTINCT INDEX ix1 ON t1 (c1,c2) Given the following statements: CREATE TABLE t1 (id INTEGER, CONSTRAINT chkid CHECK (id<100)) INSERT INTO t1 VALUES (100) COMMIT Which of the following occurs as a result of issuing the statements? A. The row is inserted with ID having a NULL value. B. The row is inserted with ID having a value of 100. C. The row insertion with a value of 100 for ID is rejected. D. The trigger called chkid is activated to validate the data. When using DB2 Connect, which of the following commands specifies the protocol information on how to connect to the host or to the server? A. CATALOG DCS
  • 148.
    B. CATALOG NODE C. CATALOG DATABASE D. CATALOG ODBC DATA SOURCE An application using the Repeatable Read isolation level acquires an update lock. When does the update lock get released? A. When the cursor accessing the row is closed B. When the transaction issues a ROLLBACK statement C. When the cursor accessing the row is moved to the next row D. When the transaction changes are made via an UPDATE statement Given the following statements: CREATE TABLE t4 (c1 INTEGER NOT NULL, c2 INTEGER, c3 DECIMAL(7,2) NOT NULL, c4 CHAR(20) NOT NULL); CREATE UNIQUE INDEX i4 ON t4(c1,c3); ALTER TABLE t4 ADD PRIMARY KEY (c1,c3); Which of the following statements is TRUE? A. The ALTER TABLE statement will fail. B. The primary key will use the I4 unique index. C. A primary index will need to be created on the composite key (C1,C3). D. An additional unique index will automatically be created on the composite key (C1,C3). A table has had check constraint enforcement turned off, and additional data has been inserted. Which of the following will perform data validation to ensure that column values are valid? A. Add a trigger B. Collect statistics C. Reorganize the table
  • 149.
    D. Enable checkconstraints 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 INTEGER GENERATED BY DEFAULT AS IDENTITY) C. CREATE TABLE t1 (employid INTEGER NOT NULL) D. CREATE TABLE t1 (employid INTEGER NOT NULL PRIMARY KEY) Given the following SQL statement: GRANT EXECUTE ON PACKAGE proc1 TO usera WITH GRANT OPTION Which two of the following describe what USERA is allowed to do? A. Execute SQL statements in package PROC1 B. Grant any privilege on package PROC1 to other users C. Grant bind privilege on package PROC1 to other users D. Grant execute privilege on package PROC1 to other users E. Access all of the tables referenced in package PROC1 from any program USER2 has SELECT WITH GRANT OPTION on APPL.TAB1. Which of the following statements is USER2 authorized to execute? A. GRANT INSERT ON TABLE appl.tab1 TO user8 B. GRANT SELECT ON TABLE appl.tab1 TO user8 C. GRANT REFERENCES ON TABLE appl.tab1 user8 D. GRANT ALL PRIVILEGES on TABLE appl.tab1 TO user8 Given the following statement: CREATE TABLE t1 (c1 CHAR(4) NOT NULL) Which of the following can be inserted into this table? A. 4 B. NULL
  • 150.
    C. 'abc' D. 'abcde' USER3 is running a program A.APP1 that calls stored procedure P.PROC1. As an administrator, which of the following statements should be executed to give USER3 the appropriate privilege to be able to execute the code found in stored procedure P.PROC1? A. GRANT EXECUTE ON PACKAGE a.app1 TO user3 B. GRANT EXECUTE ON PROCEDURE a.app1 TO user3 C. GRANT EXECUTE ON FUNCTION p.proc1 TO user3 D. GRANT EXECUTE ON PROCEDURE p.proc1 TO user3 Which of the following tools can be used to catalog a database? A. Journal B. Task Center C. License Center D. Configuration Assistant Given the following tables: NAMES Name Number Wayne Gretzky Jaromir Jagr Bobby Orr Bobby Hull Brett Hull Mario Lemieux Steve Yzerman Claude Lemieux Mark Messier Mats Sundin 99 68 4 23 16 66 19 19 11
  • 151.
    13 POINTS Name Points Wayne Gretzky JaromirJagr Bobby Orr Bobby Hull Brett Hull Mario Lemieux 244 168 129 93 121 189 PIM Name PIM Mats Sundin Jaromir Jagr Bobby Orr Mark Messier Brett Hull Mario Lemieux Joe Sakic 14 18 12 32 66 23 94 Which of the following statements will display the name, number, points and PIM for players with an entry in all three tables? A. SELECT names.name, names.number, points.points, pim.pim FROM names INNER JOIN points ON names.name=points.name INNER JOIN pim ON pim.name=names.name B. SELECT names.name, names.number, points.points, pim.pim FROM names OUTER JOIN points ON names.name=points.name OUTER JOIN pim ON pim.name=names.name C. SELECT names.name, names.number, points.points, pim.pim FROM names LEFT OUTER JOIN points ON names.name=points.name LEFT OUTER JOIN pim ON pim.name=names.name D. SELECT names.name, names.number, points.points, pim.pim FROM names RIGHT OUTER JOIN
  • 152.
    points ON names.name=points.nameRIGHT OUTER JOIN pim ON pim.name=names.name 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 the privileges granted to 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 Which of the following can duplicate the structure and related objects of a database table? A. Copy table B. Alter table C. Export table D. Generate DDL 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(20) years INTEGER salary DECIMAL(10,2) comm DECIMAL(10,2) Which of the following statements will display all departments, alphabetically by department name, and the name of the manager of each department?
  • 153.
    A. SELECT a.deptname,b.name FROM org a, staff b WHERE b.manager=a.id B. SELECT a.deptname, b.name FROM org a, staff b WHERE b.manager=a.id GROUP BY a.deptname, b.name C. SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id ORDER BY a.deptname, b.name D. SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id GROUP BY b.name ORDER BY a.deptname A client application on OS/390 or OS/400 must access a DB2 server on Linux. At a minimum, which of the following products is required to be on the DB2 server? A. DB2 Connect Enterprise Edition B. DB2 UDB Enterprise Server Edition C. DB2 Connect Enterprise Edition and DB2 UDB Workgroup Server Edition D. DB2 Connect Enterprise Edition and DB2 UDB Enterprise Server Edition Given the table COUNTRY and the statements below: COUNTRY ID NAME PERSON_ID CITIES 1 Argentina 1 10 2 Canada 2 20 3 Cuba 2 10 4 Germany 1 0 5 France 7 5 DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, name OPEN c1 FETCH c1 FETCH c1 COMMIT FETCH c1 Which of the following is the last name obtained from the table? A. Cuba B. France C. Canada D. Germany
  • 154.
    E. Argentina Given thefollowing table definitions: DEPARTMENT deptno CHAR(3) deptname CHAR(30) mgrno I NTEGER admrdept CHAR(3) EMPLOYEE empno INTEGER firstname CHAR(30) midinit CHAR lastname CHAR(30) workdept CHAR(3) Which of the following statements will produce a result set satisfying these criteria? * The empno and lastname of every employee * For each employee, include the empno and lastname of their manager * Includes employees both with and without a manager A. SELECT e.empno, e.lastname FROM employee e LEFT OUTER JOIN (department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno B. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT INNER JOIN (department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno C. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT OUTER JOIN (department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno D. SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT OUTER JOIN (department INNER JOIN employee m ON mgrno = m.empno) ON e.workdept = deptno Given the following statements: CREATE TABLE tab1 (c1 CHAR(3) WITH DEFAULT '123',c2 INTEGER); INSERT INTO tab1(c2) VALUES (123); Which will be the result of the following statement when issued from the Command Line Processor? SELECT * FROM tab1; A. C1 C2 --- ----------- 0 record(s) selected.
  • 155.
    B. C1 C2 -------------- 123 123 1 record(s) selected. C. C1 C2 --- ----------- 123 1 record(s) selected. D. C1 C2 --- ----------- - 123 1 record(s) selected. When constraint checking is suspended or disabled, a table or table space (depending on platform) is placed in which of the following states? A. Paused B. Check pending C. Intent locked D. Constraint waiting Which of the following DB2 components allows references to Oracle and DB2 databases in a single query? A. DB2 Query Patroller B. DB2 Warehouse Manager C. DB2 Relational Connect D. DB2 Connect Enterprise Edition Which of the following processes is NOT performed by DB2 Warehouse Manager? A. Query B. Loading C. Extraction D. Transformation SQL source statements for which two of the following are stored in the system catalog?
  • 156.
    A. Views B. Tables C. Indexes D. Triggers E. Constraints Examination Score Report Pre-Assessment/Sample Test for Test 700 Exam 700 - DB2 UDB V8.1 Family Fundamentals CANDIDATE: Rico Cai CANDIDATE USERID: rico_cai DATE: April 30, 2003 (April 30, 2003 9:30:59 AM GMT) ICE INTERNAL ID: 1072225 EXAM: Exam 700 - DB2 UDB V8.1 Family Fundamentals NUMBER: 700 PASSING SCORE: 60% (18 out of 30) YOUR SCORE: 23% (7 out of 30) GRADE: Fail The following shows the percentage weighting of each section/category and your related score. Section / Category % of Test Your Score 1. Planning 17% 0% 2. Security 7% 100% 3. Accessing DB2 UDB Data 17% 20% 4. Working with DB2 UDB Data 30% 11% 5. Working with DB2 UDB Objects 20% 50% 6. Data Concurrency 10% 0%