SlideShare une entreprise Scribd logo
1  sur  156
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
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题
Db2考试测试题

Contenu connexe

Tendances

FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3Syahriha Ruslan
 
Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)Poonam Chopra
 
CDAC CCAT examination important question
CDAC CCAT examination important questionCDAC CCAT examination important question
CDAC CCAT examination important questionprabhatjon
 
Gate Previous Years Papers
Gate Previous Years PapersGate Previous Years Papers
Gate Previous Years PapersRahul Jain
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Poonam Chopra
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisUniversity of Illinois,Chicago
 
A quick introduction to R
A quick introduction to RA quick introduction to R
A quick introduction to RAngshuman Saha
 
FP305 data structure june 2012
FP305   data structure june 2012FP305   data structure june 2012
FP305 data structure june 2012Syahriha Ruslan
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)Ankit Dubey
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisUniversity of Illinois,Chicago
 
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014prabhatjon
 
Database management system file
Database management system fileDatabase management system file
Database management system fileAnkit Dixit
 
FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013Syahriha Ruslan
 
Java (Information Technology) Question paper for T.Y Bca
Java (Information Technology) Question paper for T.Y BcaJava (Information Technology) Question paper for T.Y Bca
Java (Information Technology) Question paper for T.Y BcaJIGAR MAKHIJA
 

Tendances (20)

FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3FP305 data structure PAPER FINAL SEM 3
FP305 data structure PAPER FINAL SEM 3
 
CBSE Sample Paper IP
CBSE Sample Paper IPCBSE Sample Paper IP
CBSE Sample Paper IP
 
7th semester Computer Science and Information Science Engg (2013 December) Qu...
7th semester Computer Science and Information Science Engg (2013 December) Qu...7th semester Computer Science and Information Science Engg (2013 December) Qu...
7th semester Computer Science and Information Science Engg (2013 December) Qu...
 
7th Semester (June; July-2015) Computer Science and Information Science Engin...
7th Semester (June; July-2015) Computer Science and Information Science Engin...7th Semester (June; July-2015) Computer Science and Information Science Engin...
7th Semester (June; July-2015) Computer Science and Information Science Engin...
 
Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)Sample Paper Class XI (Informatics Practices)
Sample Paper Class XI (Informatics Practices)
 
CDAC CCAT examination important question
CDAC CCAT examination important questionCDAC CCAT examination important question
CDAC CCAT examination important question
 
Gate Previous Years Papers
Gate Previous Years PapersGate Previous Years Papers
Gate Previous Years Papers
 
Computer Science Sample Paper 2015
Computer Science Sample Paper 2015Computer Science Sample Paper 2015
Computer Science Sample Paper 2015
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 
A quick introduction to R
A quick introduction to RA quick introduction to R
A quick introduction to R
 
FP305 data structure june 2012
FP305   data structure june 2012FP305   data structure june 2012
FP305 data structure june 2012
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 
7th cs june 2013
7th cs   june 20137th cs   june 2013
7th cs june 2013
 
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
GUESS FUNDAMENTAL PAPER FOE CCAT Feb 2014
 
7th Semester Information Science (2013-June) Question Papers
7th Semester Information Science (2013-June) Question Papers 7th Semester Information Science (2013-June) Question Papers
7th Semester Information Science (2013-June) Question Papers
 
7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
 
Database management system file
Database management system fileDatabase management system file
Database management system file
 
FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013FP 301 OOP FINAL PAPER JUNE 2013
FP 301 OOP FINAL PAPER JUNE 2013
 
Java (Information Technology) Question paper for T.Y Bca
Java (Information Technology) Question paper for T.Y BcaJava (Information Technology) Question paper for T.Y Bca
Java (Information Technology) Question paper for T.Y Bca
 

En vedette

deadpointmagazine
deadpointmagazinedeadpointmagazine
deadpointmagazinefm2008
 
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告fm2008
 
Glastonbury 2009
Glastonbury 2009Glastonbury 2009
Glastonbury 2009fm2008
 
经典攀岩图片
经典攀岩图片经典攀岩图片
经典攀岩图片fm2008
 
Panyancn
PanyancnPanyancn
Panyancnfm2008
 
它们是你心中完美的手机吗
它们是你心中完美的手机吗它们是你心中完美的手机吗
它们是你心中完美的手机吗fm2008
 
Itsm+manager资格认证课程比较 v0.3
Itsm+manager资格认证课程比较 v0.3Itsm+manager资格认证课程比较 v0.3
Itsm+manager资格认证课程比较 v0.3fm2008
 
绝妙创意广告锦集
绝妙创意广告锦集绝妙创意广告锦集
绝妙创意广告锦集fm2008
 

En vedette (8)

deadpointmagazine
deadpointmagazinedeadpointmagazine
deadpointmagazine
 
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
Aix5[1].3+hacmp+oracle9 i+weblogic8.1安装实施报告
 
Glastonbury 2009
Glastonbury 2009Glastonbury 2009
Glastonbury 2009
 
经典攀岩图片
经典攀岩图片经典攀岩图片
经典攀岩图片
 
Panyancn
PanyancnPanyancn
Panyancn
 
它们是你心中完美的手机吗
它们是你心中完美的手机吗它们是你心中完美的手机吗
它们是你心中完美的手机吗
 
Itsm+manager资格认证课程比较 v0.3
Itsm+manager资格认证课程比较 v0.3Itsm+manager资格认证课程比较 v0.3
Itsm+manager资格认证课程比较 v0.3
 
绝妙创意广告锦集
绝妙创意广告锦集绝妙创意广告锦集
绝妙创意广告锦集
 

Similaire à Db2考试测试题

Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperHarish Gyanani
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answersdebarghyamukherjee60
 
Preparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001fPreparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001fGihan Wikramanayake
 
Top 10 sap abap faqs-www.bigclasses.com
Top 10 sap abap faqs-www.bigclasses.comTop 10 sap abap faqs-www.bigclasses.com
Top 10 sap abap faqs-www.bigclasses.combigclasses.com
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12chinthala Vijaya Kumar
 
CAPE Computer Science Unit 1 Paper 1 - Practice Paper
CAPE Computer Science Unit 1 Paper 1 - Practice PaperCAPE Computer Science Unit 1 Paper 1 - Practice Paper
CAPE Computer Science Unit 1 Paper 1 - Practice PaperAlex Stewart
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docxrosemarybdodson23141
 
xii-ip-support-material.pdf
xii-ip-support-material.pdfxii-ip-support-material.pdf
xii-ip-support-material.pdfkajalkhorwal106
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
MariaDB Optimizer
MariaDB OptimizerMariaDB Optimizer
MariaDB OptimizerJongJin Lee
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2Knowledge Center Computer
 
PEGA Training ( pegabpm99@gmail.com)
PEGA Training ( pegabpm99@gmail.com)PEGA Training ( pegabpm99@gmail.com)
PEGA Training ( pegabpm99@gmail.com)Ashock Kumar
 
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-20081 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008Kumar Nirmal Prasad
 
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-20081 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008Kumar Nirmal Prasad
 
Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docx
Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docxSuppose that a PRODUCT table contains two attributes, PROD_CODE an.docx
Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docxpicklesvalery
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Databricks
 
Base SAS Full Sample Paper
Base SAS Full Sample Paper Base SAS Full Sample Paper
Base SAS Full Sample Paper Jimmy Rana
 

Similaire à Db2考试测试题 (20)

Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
 
Plsql pdf
Plsql pdfPlsql pdf
Plsql pdf
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
 
Preparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001fPreparing for BIT – IT2301 Database Management Systems 2001f
Preparing for BIT – IT2301 Database Management Systems 2001f
 
Top 10 sap abap faqs-www.bigclasses.com
Top 10 sap abap faqs-www.bigclasses.comTop 10 sap abap faqs-www.bigclasses.com
Top 10 sap abap faqs-www.bigclasses.com
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
 
CAPE Computer Science Unit 1 Paper 1 - Practice Paper
CAPE Computer Science Unit 1 Paper 1 - Practice PaperCAPE Computer Science Unit 1 Paper 1 - Practice Paper
CAPE Computer Science Unit 1 Paper 1 - Practice Paper
 
Exam_Questions.docx
Exam_Questions.docxExam_Questions.docx
Exam_Questions.docx
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
xii-ip-support-material.pdf
xii-ip-support-material.pdfxii-ip-support-material.pdf
xii-ip-support-material.pdf
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
MariaDB Optimizer
MariaDB OptimizerMariaDB Optimizer
MariaDB Optimizer
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
PEGA Training ( pegabpm99@gmail.com)
PEGA Training ( pegabpm99@gmail.com)PEGA Training ( pegabpm99@gmail.com)
PEGA Training ( pegabpm99@gmail.com)
 
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-20081 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
 
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-20081 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
1 allahabad bank-clerk-exam-computer-general-konwledge-solved-paper-2008
 
Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docx
Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docxSuppose that a PRODUCT table contains two attributes, PROD_CODE an.docx
Suppose that a PRODUCT table contains two attributes, PROD_CODE an.docx
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
 
C MCQ
C MCQC MCQ
C MCQ
 
Base SAS Full Sample Paper
Base SAS Full Sample Paper Base SAS Full Sample Paper
Base SAS Full Sample Paper
 

Plus de fm2008

Bmc产品综述.v.1.4
Bmc产品综述.v.1.4Bmc产品综述.v.1.4
Bmc产品综述.v.1.4fm2008
 
Bmc+agent介绍
Bmc+agent介绍Bmc+agent介绍
Bmc+agent介绍fm2008
 
Bmc china presentation_workshop_chi
Bmc china presentation_workshop_chiBmc china presentation_workshop_chi
Bmc china presentation_workshop_chifm2008
 
Uniper itsm enterprise_suite与bmc_remedy_功能对比
Uniper itsm enterprise_suite与bmc_remedy_功能对比Uniper itsm enterprise_suite与bmc_remedy_功能对比
Uniper itsm enterprise_suite与bmc_remedy_功能对比fm2008
 
Itil bmc产品remedy详细介绍
Itil bmc产品remedy详细介绍Itil bmc产品remedy详细介绍
Itil bmc产品remedy详细介绍fm2008
 
Ibm发布ccmdb帮助企业提升it服务管理
Ibm发布ccmdb帮助企业提升it服务管理Ibm发布ccmdb帮助企业提升it服务管理
Ibm发布ccmdb帮助企业提升it服务管理fm2008
 
Ibm mq series使用指南
Ibm mq series使用指南Ibm mq series使用指南
Ibm mq series使用指南fm2008
 
Db2的内存管理
Db2的内存管理Db2的内存管理
Db2的内存管理fm2008
 
对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑
对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑
对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑fm2008
 
奥莱雪鸟攀冰大会新闻报告 Low
奥莱雪鸟攀冰大会新闻报告 Low奥莱雪鸟攀冰大会新闻报告 Low
奥莱雪鸟攀冰大会新闻报告 Lowfm2008
 
户外运动的“米帅”:discovery频道当红帅哥贝尔
户外运动的“米帅”:discovery频道当红帅哥贝尔户外运动的“米帅”:discovery频道当红帅哥贝尔
户外运动的“米帅”:discovery频道当红帅哥贝尔fm2008
 
STP购物流程
STP购物流程STP购物流程
STP购物流程fm2008
 
登山圣经的简体版
登山圣经的简体版登山圣经的简体版
登山圣经的简体版fm2008
 
20世纪中国两次和平转型的机会
20世纪中国两次和平转型的机会20世纪中国两次和平转型的机会
20世纪中国两次和平转型的机会fm2008
 
野外生存知识:各类绳结的打法及用途
野外生存知识:各类绳结的打法及用途野外生存知识:各类绳结的打法及用途
野外生存知识:各类绳结的打法及用途fm2008
 
Twitter
TwitterTwitter
Twitterfm2008
 
2款助你“遨游”星际的天文类软件
2款助你“遨游”星际的天文类软件 2款助你“遨游”星际的天文类软件
2款助你“遨游”星际的天文类软件 fm2008
 
Glastonbury 2009
Glastonbury 2009Glastonbury 2009
Glastonbury 2009fm2008
 

Plus de fm2008 (18)

Bmc产品综述.v.1.4
Bmc产品综述.v.1.4Bmc产品综述.v.1.4
Bmc产品综述.v.1.4
 
Bmc+agent介绍
Bmc+agent介绍Bmc+agent介绍
Bmc+agent介绍
 
Bmc china presentation_workshop_chi
Bmc china presentation_workshop_chiBmc china presentation_workshop_chi
Bmc china presentation_workshop_chi
 
Uniper itsm enterprise_suite与bmc_remedy_功能对比
Uniper itsm enterprise_suite与bmc_remedy_功能对比Uniper itsm enterprise_suite与bmc_remedy_功能对比
Uniper itsm enterprise_suite与bmc_remedy_功能对比
 
Itil bmc产品remedy详细介绍
Itil bmc产品remedy详细介绍Itil bmc产品remedy详细介绍
Itil bmc产品remedy详细介绍
 
Ibm发布ccmdb帮助企业提升it服务管理
Ibm发布ccmdb帮助企业提升it服务管理Ibm发布ccmdb帮助企业提升it服务管理
Ibm发布ccmdb帮助企业提升it服务管理
 
Ibm mq series使用指南
Ibm mq series使用指南Ibm mq series使用指南
Ibm mq series使用指南
 
Db2的内存管理
Db2的内存管理Db2的内存管理
Db2的内存管理
 
对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑
对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑
对谷歌的退出,你 可以有不同意见,但是不要这么没逻辑
 
奥莱雪鸟攀冰大会新闻报告 Low
奥莱雪鸟攀冰大会新闻报告 Low奥莱雪鸟攀冰大会新闻报告 Low
奥莱雪鸟攀冰大会新闻报告 Low
 
户外运动的“米帅”:discovery频道当红帅哥贝尔
户外运动的“米帅”:discovery频道当红帅哥贝尔户外运动的“米帅”:discovery频道当红帅哥贝尔
户外运动的“米帅”:discovery频道当红帅哥贝尔
 
STP购物流程
STP购物流程STP购物流程
STP购物流程
 
登山圣经的简体版
登山圣经的简体版登山圣经的简体版
登山圣经的简体版
 
20世纪中国两次和平转型的机会
20世纪中国两次和平转型的机会20世纪中国两次和平转型的机会
20世纪中国两次和平转型的机会
 
野外生存知识:各类绳结的打法及用途
野外生存知识:各类绳结的打法及用途野外生存知识:各类绳结的打法及用途
野外生存知识:各类绳结的打法及用途
 
Twitter
TwitterTwitter
Twitter
 
2款助你“遨游”星际的天文类软件
2款助你“遨游”星际的天文类软件 2款助你“遨游”星际的天文类软件
2款助你“遨游”星际的天文类软件
 
Glastonbury 2009
Glastonbury 2009Glastonbury 2009
Glastonbury 2009
 

Dernier

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Dernier (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

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 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
  • 4. 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
  • 5. 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
  • 6. 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)
  • 7. 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
  • 8. 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
  • 9. 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
  • 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 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
  • 12. ****************************************************** 自测题 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)
  • 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 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
  • 15. 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)
  • 16. 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?
  • 17. (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?
  • 18. (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
  • 19. 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
  • 20. 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.
  • 21. 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
  • 22. (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
  • 23. 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?
  • 24. (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
  • 25. (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:
  • 26. 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?
  • 27. (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
  • 28. 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
  • 29. (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.
  • 30. (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
  • 31. 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
  • 32. 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
  • 33. : 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
  • 34. 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:
  • 35. 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?
  • 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 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?
  • 39. (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?
  • 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) 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
  • 42. 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
  • 43. (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
  • 44. (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
  • 45. (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
  • 46. 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) ,
  • 47. 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
  • 48. 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?
  • 49. (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
  • 50. 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
  • 51. 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.
  • 52. 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
  • 53. 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
  • 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 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?
  • 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 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
  • 61. (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.
  • 62. 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?
  • 63. (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
  • 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) 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)
  • 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 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
  • 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 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