Sie sind auf Seite 1von 28

Information Management Ecosystem Partnerships IBM Canada Lab Summer/Fall 2010

DB2 Certification Sample Test

Information Management

2010 IBM Corporation

Information Management

Which of the following is the major difference between relational data and XML data? ! "elational #ata is self$#escri%ing& 'M( #ata is not B! "elational #ata )as in)erent or#ering& 'M( #ata #oes not C! "elational #ata must %e ta%ular& 'M( #ata #oes not )a*e to %e ta%ular D! "elational #ata is comprise# of entities& 'M( #ata is comprise# of num%ers+ c)aracters+ an# #ates

2010 IBM Corporation

Information Management

A table named DEPARTME T has the following col!mns"


DEPT#ID DEPT# AME MA A$ER A%$#&ALAR' Which of the following is the best wa( to )re*ent most !sers from *iewing A%$#&ALAR' data? ! -ncr.pt t)e ta%le/s #ata B! Create a *ie0 t)at #oes not contain t)e 123S ( "4 column C! "e*o5e S-(-CT access for t)e 123S ( "4 column from users 0)o s)oul# not see 123S ( "4 #ata D! Store 123S ( "4 #ata in a separate ta%le an# grant S-(-CT pri*ilege for t)at ta%le to t)e appropriate users

2010 IBM Corporation

Information Management

Which of the following statements will catalog the database M'D+ on the node M' ,DE and assign it the alias M' EWD+? ! C T (72 D T B S- m.ne0#% T 87D- m.no#e B! C T (72 D T B S- m.ne0#% S m.#% T 87Dm.no#e C! C T (72 D T B S- m.#% T 87D- m.no#e D! C T (72 D T B S- m.#% S m.ne0#% T 87Dm.no#e

2010 IBM Corporation

Information Management

In which of the following scenarios wo!ld a stored )roced!re be beneficial? ! n application running on a remote client nee#s to %e a%le to con*ert #egrees Celsius to #egrees Fa)ren)eit an# *ice *ersa B! n application running on a remote client nee#s to collect t)ree input *alues+ perform a calculation using t)e *alues pro*i#e#+ an# store t)e input #ata+ along 0it) t)e results of t)e calculation in t0o #ifferent %ase ta%les C! n application running on a remote client nee#s to trac5 e*er. mo#ification ma#e to a ta%le t)at contains sensiti*e #ata D! n application running on a remote client nee#s to ensure t)at e*er. ne0 emplo.ee t)at :oins t)e compan. is assigne# a uni;ue+ se;uential emplo.ee num%er
2010 IBM Corporation

Information Management

If the following &-L statements are e.ec!ted in the order shown"

CREATE TABLE orders (order_num INTEGER NOT NULL, buyer_name VARCHAR(35 , amoun! NU"ERIC(5,# $

CREATE UNI%UE IN&E' (d)_orderno ON orders(order_num $

<

Which of the following describes the res!lting beha*ior? ! -*er. 7"D-"38=M *alue entere# must %e uni;ue& 0)ene*er t)e 7"D-"S ta%le is ;uerie# ro0s s)oul# %e #ispla.e# in or#er of increasing 7"D-"38=M *alues B! -*er. 7"D-"38=M *alue entere# must %e uni;ue& 0)ene*er t)e 7"D-"S ta%le is ;uerie# ro0s 0ill %e #ispla.e# in no particular or#er C! Duplicate 7"D-"38=M *alues are allo0e#& no ot)er in#e> can %e create# for t)e 7"D-"S ta%le t)at reference t)e 7"D-"38=M column D! -*er. 7"D-"38=M *alue entere# must %e uni;ue& no ot)er in#e> can %e create# for t)e 7"D-"S ta%le t)at reference t)e 7"D-"38=M column

2010 IBM Corporation

Information Management

An alias can be an alternate name for which two of the following D+/ objects? ! Se;uence B! Trigger C! 1ie0 D! Sc)ema -! Ta%le

2010 IBM Corporation

Information Management

Which of the following e*ents will ,T ca!se a trigger to be acti*ated? ! select operation B! n insert operation C! n up#ate operation D! #elete operation

2010 IBM Corporation

Information Management

Which of the following D+/ objects can be referenced b( an I &ERT statement to generate *al!es for a col!mn? ! Se;uence B! I#entit. column C! Trigger D! Ta%le function

2010 IBM Corporation

Information Management

A se0!ence was created with the DDL statement shown below"

CREATE *E%UENCE my_se+ *TART ,ITH -. INCRE"ENT B/ -. CACHE -. 1ser 1&ER2 s!ccessf!ll( e.ec!tes the following statements in the order shown" VALUE* NE'T VALUE 0OR my_se+ INTO 123ar$ VALUE* NE'T VALUE 0OR my_se+ INTO 123ar$ 1ser 1&ER/ s!ccessf!ll( e.ec!tes the following statements in the order shown" ALTER *E%UENCE my_se+ RE*TART ,ITH 5 INCRE"ENT B/ 5 CACHE 5$ VALUE* NE'T VALUE 0OR my_se+ INTO 123ar$ After !sers 1&ER2 and 1&ER/ are finished3 !ser 1&ER4 e.ec!tes the following 0!er(" *ELECT NE'T VALUE 0OR my_se+ 0RO" sys(bm4sysdummy

What *al!e will be ret!rned b( the 0!er(? !9 B! 10 C! 20 D! ,0


2010 IBM Corporation

10

Information Management

$i*en the following two tables"

5ow man( rows wo!ld be ret!rned !sing the following statement? &ELE6T name 7R,M names3 )oints !0 B! 9 C! 10 D! 29
2010 IBM Corporation

11

Information Management

$i*en the following two tables"

Ass!ming the following res!lts are desired"

Which of the following joins will )rod!ce the desired res!lts?


A4 B4 C4 &4 *ELECT *ELECT *ELECT *ELECT 5 5 5 5 0RO" 0RO" 0RO" 0RO" !ab!ab!ab!abINNER 6OIN !ab# ON 7o8_- 9 7o8_a LE0T OUTER 6OIN !ab# ON 7o8_- 9 7o8_a RIGHT OUTER 6OIN !ab# ON 7o8_- 9 7o8_a 0ULL OUTER 6OIN !ab# ON 7o8_- 9 7o8_a
2010 IBM Corporation

12

Information Management

If the following &-L statements are e.ec!ted in the order shown"

CREATE TABLE !ab8e- (7- INTEGER, 7# INTEGER $ IN*ERT INTO !ab8e- VALUE* (-#3, :5; $ U<&ATE !ab8e- *ET 7- 9 NULL$

What will be the res!lt of the following statement? ! B! C! D!

*ELECT 5 0RO" !ab8e-$

1,

2010 IBM Corporation

Information Management

$i*en the following table"

Ass!ming the following res!lts are desired"

Which of the following statements will )rod!ce the desired res!lts? ! *ELECT UNI%UE 5 0RO" !ab B! *ELECT &I*TINCT 5 0RO" !ab C! *ELECT UNI%UE(5 0RO" !ab D! *ELECT &I*TINCT(5 0RO" !ab 2010 IBM Corporation

16

Information Management

Ass!ming table TA+2 contains 288 rows3 which of the following 0!eries will ret!rn onl( half of the rows a*ailable? ! S-(-CT B F"7M ta%1 FI8D FI"ST 90 "7CS B! S-(-CT B F"7M ta%1 F-TCD FI"ST 90 "7CS 78(4 C! S-(-CT B F"7M ta%1 CDI(- "7C38=M E 90 D! S-(-CT B F"7M ta%1 M '"7CS 90

19

2010 IBM Corporation

Information Management

$i*en the following two tables"

Which two of the following 0!eries will dis)la( the em)lo(ee name and de)artment name for all em)lo(ees that are in &ales?
A4 B4 C4 &4 E4

1<

2010 IBM Corporation

Information Management

$i*en the following table definition"

Which of the following 0!eries will ret!rn &ALE& information3 sorted b( &ALE&#PER&, 3 from A to 93 and &ALE&#DATE3 from most recent to earliest?
A4 *ELECT 0RO" sa8es B4 *ELECT 0RO" sa8es C4 *ELECT 0RO" sa8es &4 *ELECT 0RO" sa8es (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! *ORT B/ sa8es_=erson,sa8es_da!e &E*C (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! *ORT B/ sa8es_=erson &E*C, sa8es_da!e (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! OR&ER B/ sa8es_=erson, sa8es_da!e &E*C (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! OR&ER B/ sa8es_=erson &E*C, sa8es_da!e
2010 IBM Corporation

1?

Information Management

$i*en the following table definition"

Which of the following 0!eries will ret!rn &ALE& information3 sorted b( &ALE&#PER&, 3 from A to 93 and &ALE&#DATE3 from most recent to earliest?
A4 *ELECT 0RO" sa8es B4 *ELECT 0RO" sa8es C4 *ELECT 0RO" sa8es &4 *ELECT 0RO" sa8es (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! *ORT B/ sa8es_=erson,sa8es_da!e &E*C (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! *ORT B/ sa8es_=erson &E*C, sa8es_da!e (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! OR&ER B/ sa8es_=erson, sa8es_da!e &E*C (n3o(7e_no, sa8es_=erson, sa8es_da!e, sa8es_am! OR&ER B/ sa8es_=erson &E*C, sa8es_da!e
2010 IBM Corporation

1@

Information Management

Which two of the following statements are tr!e abo!t the 5A%I $ cla!se? ! T)e D 1I82 clause is use# in place of t)e CD-"clause! B! T)e D 1I82 clause uses t)e same s.nta> as t)e CD-"- clause! C! T)e D 1I82 clause can onl. %e use# 0it) t)e 2"7=F B4 clause! D! T)e D 1I82 clause accepts 0il#car#s! -! T)e D 1I82 clause uses t)e same s.nta> as t)e I8 clause!

1A

2010 IBM Corporation

Information Management

$i*en the following table definition"

Which of the following &-L statements will remo*e all rows that had a &ALE&#DATE in the (ear 2::;?
! D-(-T- B F"7M sales CD-"- 4- "Gsales3#ateH I 1AA9 B! D-(-T- F"7M sales CD-"- 4- "Gsales3#ateH I 1AA9 C! D"7F B F"7M sales CD-"- 4- "Gsales3#ateH I 1AA9 D! D"7F F"7M sales CD-"- 4- "Gsales3#ateH I 1AA9

21

2010 IBM Corporation

Information Management

$i*en the following 6REATE TA+LE statement" Which two of the following will ,T occ!r when the statement is e.ec!ted? ! T B(-2 0ill )a*e t)e same column names an# column #ata t.pes as T B(-1 B! T B(-2 0ill )a*e t)e same column #efaults as T B(-1 C! T B(-2 0ill )a*e t)e same nulla%ilit. c)aracteristics as T B(-1 D! T B(-2 0ill )a*e t)e same in#e>es as T B(-1! -! T B(-2 0ill )a*e t)e same referential constraints as T B(-1

CREATE TABLE !ab8e# LI>E !ab8e

22

2010 IBM Corporation

Information Management

Data Concurrenc.

Which of the following isolation le*els will loc< all rows scanned to b!ild a res!lt data set? ! =ncommitte# "ea# B! Cursor Sta%ilit. C! "ea# Sta%ilit. D! "epeata%le "ea#

26

2010 IBM Corporation

Information Management

Data%ase Transactions
Create ta%le t%1 G c1 integer primar. 5e.+ c2 *arc)arG10HH

Consi#ering t)e follo0ing statements are successfull. e>ecute# in C(F 0it) auto$commit #isa%le#+ )o0 man. ro0s are I8S-"T-D in t)e ta%le t%1J
Insert into t%1 *alues G@+ /paul/H Insert into t%1 *alues G@+ /paul/H commit Insert into t%1 *alues G@+ /paul/H roll%ac5

!0 B! 1 C! 2 D! ,
29 2010 IBM Corporation

Information Management

Data%ase "eco*er.
db2 backup database sample to /home/db2inst1/backups Backup successful. The timestamp for this backup image is: <T1>

C)ic) of t)e %elo0 0ill restore t)e #ata%aseJ


restore #ata%ase sample offline from /)ome/#%2inst1/%ac5ups ta5en at <T1> 0it)out rolling for0ar# B! #%2 restore #ata%ase sample offline from /)ome/#%2inst1/%ac5ups ta5en at <T2> 0it)out rolling for0ar# C! #%2 restore #ata%ase sample online from /)ome/#%2inst1/%ac5ups ta5en at <T2> 0it)out rolling for0ar# D! #%2 restore #ata%ase sample from /)ome/#%2inst1/%ac5ups ta5en at <T1> 0it)out rolling for0ar#
! #%2

2<

2010 IBM Corporation

Information Management

$i*en the following table definition"

Which of the following will retrie*e the rows that ha*e a missing *al!e in the &ALE&#PER&, ?
A4 B4 C4 &4 *ELECT *ELECT *ELECT *ELECT 5 5 5 5 0RO" 0RO" 0RO" 0RO" sa8es sa8es sa8es sa8es ,HERE ,HERE ,HERE ,HERE m(d(n(! m(d(n(! m(d(n(! m(d(n(! 9 ? ? 9 NULL 9 @A I* NULL

2?

2010 IBM Corporation

Information Management

$i*en the following store )roced!re e.ists"

Proced!re )roc2 =I *ar2 *archar=28>3 ,1T rc I TE$ER> ?@@

Which is the correct wa( to in*o<e this )roced!re from 6LP?


A4 B4 C4 &4 CALL =ro7-(?*ALE*-?, B CALL my=ro7-(?*ALE*-?, B CALL =ro7-(*ALE*-, B RUN =ro7-(?*ALE*-?, B

2@

2010 IBM Corporation

Information Management

Which is tr!e abo!t an I+M D+/ Instance

?@@

?
A4 Can on8y 2a3e one =er ser3er B4 (C one Ca(8s, a88 (ns!ean7es on !2e ser3er Ca(8 C4 T2ere on8y be one &a!abase =er (ns!an7e &4

,2a! (s a d(r!y read ,2a! (s deC oC ACI& !erms D durab(8(!y444e!7

2A

2010 IBM Corporation

Information Management Ecosystem Partnerships IBM Canada Lab

Questions? E-mail: imschool@us.ibm.com Subject: DB2 Academic Wo !sho"#

Summer/Fall 2010

Information Management

2010 IBM Corporation

Das könnte Ihnen auch gefallen