DB2

53
1. Considering you have a server with 4 processor cores and 8GB of memory, which of the following is the lowest cost DB2 edition that can be used to take advantage of all server's resources? A. DB2 Enterprise Edition B. DB2 Workgroup Edition //slide 29 C. DB2 Express Edition D. DB2 Express-C Edition 2. Which of the following statements is TRUE? A. Licensing by PVU is available on DB2 Express-C edition. B. DB2 Express-C includes support to Table Partitioning. //neni pravda C. DB2 Express can only be licensed by Authorized User. //neni pravda D. The Storage Optimization feature for DB2 Enterprise edition includes Row, Index, Temporary Table and XML Compression. 3. Which of the following isolation levels lets you see data that has been updated by other applications before it is committed? A. Cursor stability B. Read stability C. Repeatable read//jako jediny nedovoluje phantom reads...tedy cist stare hodnoty ktere nekdo meni D. Uncommitted read

Transcript of DB2

Page 1: DB2

1.Considering you have a server with 4 processor cores and 8GB of memory, which of the following is the lowest cost DB2 edition that can be used to take advantage of all server's resources?A.DB2 Enterprise EditionB.DB2 Workgroup Edition //slide 29C.DB2 Express EditionD.DB2 Express-C Edition

2.Which of the following statements is TRUE?A.Licensing by PVU is available on DB2 Express-C edition.B.DB2 Express-C includes support to Table Partitioning. //neni pravdaC.DB2 Express can only be licensed by Authorized User. //neni pravdaD.The Storage Optimization feature for DB2 Enterprise edition includes Row, Index, Temporary Table and XML Compression.

3.Which of the following isolation levels lets you see data that has been updated by other applications before it is committed?A.Cursor stabilityB.Read stabilityC.Repeatable read//jako jediny nedovoluje phantom reads...tedy cist stare hodnoty ktere nekdo meniD.Uncommitted read

4.Which of the following is FALSE about DB2 Instances?A.It has a stand-alone DB2 environment.B.

Page 2: DB2

Only one instance can exist using the same DB2 executable files. //executable files jsou spolecny pro vsechny instanceC.Each instance has its own configuration file.D.There could be multiple instances per data server.

5.Which of the following statements CANNOT be issued against indexes?A.CREATEB.ALTERC.DROPD.All of the above can be issued against indexes.

6.Consider a table TAB1 having the following values:TAB1-----------------COL1 COL2---- ----A 10B 20C 30A 10D 40C 20

Consider the result of a given query:

COL1----ABCD

Which of the following statements would produce the given query result:A.SELECT COL1 FROM TAB1 ORDER BY COL1 FETCH FIRST 4 ROWS ONLYB.

Page 3: DB2

SELECT COL1 FROM TAB1 FETCH FIRST 4 ROWS ONLYC.SELECT DISTINCT COL1 FROM TAB1D.SELECT UNIQUE COL1 FROM TAB1 //tohle chce overit ale prijde mi to jako nejlepsi moznost

7.The SELECT privilege is NOT available for which of the following database objects?A.Sequence B.Nickname//tohle je asi ono...nickname asi ani nexistuje ale existuje aliasC.ViewD.Table

8.Which of the following information is NOT part of the backup file name?A.Database aliasB.Timestamp of the backupC.Instance nameD.Backup type

SAMPLE.0.DB2INST.NODE0000.CATN0000.20100314131259.001...podle me tu je vsechno, tak nevim co chteji odpovedet...slide 243

9.One transaction is trying to acquire a lock to modify a row in table A. Consider the database lock timeout (locktimeout) parameter is set to 20 and that DB2 checks for deadlocks every 60 seconds. What will happen to the transaction after 20 seconds waiting?A.DB2 will randomly select one application and rollback its current transaction to try to free up the lock being held.B.The application will rollback and the application will receive an error.C.The application will commit but the operation waiting for the lock is not completed.D.

Page 4: DB2

The application will commit because after 20 seconds are passed the transaction acquires the lock by force.

10.Which of the following is NOT a valid authentication type that can be used by DB2?A.CLIENTB.CLIENT_ENCRYPT //slide 212C.SERVERD.SERVER_ENCRYPT

11.What is SAX? //tohle sem fulltextem nenaselA.A parsing mechanism, which uses stream events to process XML nodes.B.A parsing mechanism, which uses a binary tree-based algorithm to process XML nodes.C.A parsing mechanism, which uses a character-based algorithm to process XML nodes.D.A parsing mechanism, which uses the PHP SAX interface to process XML nodes.

12.Assuming that you are currently connected to TESTDB, which of the following will allow the view of the database manager settings with details?A.db2 get dbm cfg with detailsB.db2 get dbm cfg show detailC.db2 get db cfg with detailsD.db2 get db cfg show detail

13.Which of the following is FALSE about DSAC?A.Database must be added to the connection list before it can be monitored.B.Dashboard tab displays performance metrics and their values.C.

Page 5: DB2

Alert List tab shows warnings associated for each database.D.Healthy Summary tab summarizes the status of the last operation to run in the database.

14.Which of the following statements is true about constraints?A.A constraint can be added to an existing table using the ALTER TABLE statement.B.Two or more same values can be assigned to the column when there is a unique constraint.C.The NOT NULL constraint can be used to ensure that a particular column in a table is never assigned a zero valueD.The predefined value assigned by a default constraint can not be overwritten.

15.Which of the following statements is incorrect?A.A user can define multiple indexes for a single table in DB2.B.An index for a table is used to improve SQL query performance.C.An index can be defined on a view.D.None of the above.

16.Which of the following statements is FALSE regarding Buffer Pools on DB2?A.Smaller buffer pool works better for a small, sequentially accessed table space.B.Larger buffer pool works better for a table space for an OLTP application.C.A database can have more than one Buffer Pool.D.A table space can have only one Buffer Pool associated to it.

17.Consider the following statement. "Indexes can be created on computed columns." Is this statement:A.True.B.

Page 6: DB2

False.C.True, but only when the column data is produced by a sequence.D.False, but only when the column data is produced by a sequence.

18.User X needs access to server A and B, while user Y needs access to server B, C and D, how many DB2 server licenses by PVU do they need in total assuming all users can be using all machines they have access to at the same time?A.3B.4C.5D.6

19.In relational terminology, an attribute is?A.A recordB.An entityC.A fieldD.A table

20.Consider the following scenario. You are currently connected to a database called MYDB as the user MYUSER. When creating a table within this database, you use the command:

CREATE TABLE MYTABLE (DEPT CHAR(3) NOT NULL)

Under which schema is the table MYTABLE created?A.MYDB//prijde mi to logicky...pripadne poupravteB.MYUSERC.DB2INST1

Page 7: DB2

D.You get an error because your command is ambiguous, as the table schema is not specified.

21.Which of the following is NOT a valid DB2 Table Space ? A.User Table SpacesB.System Temporary Table SpacesC.Metadata Table Spaces// slide 65D.User Temporary Table Spaces

22.Given the following table:USERS--------------------------ID INTEGER NOT NULLNAME CHAR(20) NOT NULLPASSWORD VARCHAR(30)

Which INSERT statement is NOT correct?A.INSERT INTO USERS VALUES ( 23, 'Jim', 'password')B.INSERT INTO USERS VALUES ( 23, 'Jim', NULL )C.INSERT INTO USERS VALUES ( 23, '', 'password')//to ma neco spolecnyho s tim jak rikal ze pokud vlozime null..tak to neni stejny jako prazdny misto.proto myslilm ze tohle je onoD.INSERT INTO USERS VALUES ( 23, NULL, 'password')

23.Which of the following options is TRUE about applications developed with Embedded SQL?A.Application code is embedded inside the DB2 database.B.Application needs to be precompiled.C.Application can be directly compiled by the programming language compiler.D.Application code can be compiled by DB2 compiler.

Page 8: DB2

24.Given the options below, which of the following statements can alter a table?A.ALTER//nebo tu je nejaky figl?B.CHANGEC.UPDATED.Once a table is defined and created it cannot be altered.

25.If table TABLE1 contains 50 rows, which of the following statement will only return the first five of the rows?A.SELECT * FROM table1 MAXROWS 5B.SELECT * FROM table1 RETURN FIRST 5 ROWSC.SELECT * FROM table1 WHILE ROW < 5D.SELECT * FROM table1 FETCH FIRST 5 ROWS ONLY

26.In the following situation:

Suday: full backupMonday: delta incrementalTuesday: incrementalWednesday: delta incrementalThursday: system crashed

Which of the following options contains the correct restore order so that the database can be restored to the last stable moment before the crash?A.Restore the incremental backup from Tuesday and the incremental backup from Wednesday, then roll forward the database using the transaction log files.B.Restore only the delta incremental backup from Wednesday.C.Restore the full backup from Sunday, the incremental cumulative backup from Tuesday, the incremental delta from Wednesday, then roll forward the database using the transaction log files.//opet...prijde mi to logicky kdyztak opravteD.

Page 9: DB2

Restore the full backup from Sunday, the delta incremental from Wednesday, then roll forward the transaction log files.

27.Which privilege is required to invoke a user-defined function?A.REFERENCESB.EXECUTEC.CALLD.USAGE

28.Which of the following statements is TRUE about transactions?A.Operations inside a transaction are executed in parallel.B.Several COMMIT statements can be executed inside the same transaction.C.Transactions guarantee atomicity of a group of operations.D.A COMMIT can be executed right after a ROLLBACK statement in order to revert the effects of the ROLLBACK.

29.Which of the following commands can be used to undo operations executed inside a unit of work?A.COMMITB.ROLLBACKC.RETURND.UNDO TRANSACTION

30.Which of the following packages have the smallest footprint but is still suitable for executing JDBC applications?A.IBM Data Server ClientB.

Page 10: DB2

IBM Data Server Runtime ClientC.IBM Data Server Driver for JDBC and SQLJD.IBM Data Server Driver Package

31.Which of the following statements can be used to increase in 10% the salary of all employess in department D1:A.UPDATE employees WHERE dept = 'D1' SET salary = salary * 1.1B.UPDATE employees SET salary = (salary * 1.1)C.UPDATE employees SET salary = salary * 1.1 WHERE dept = 'D1'D.UPDATE salary = salary * 1.1 ON TABLE employees WHERE dept = 'D1'

32.The four basic SQL statements of the Data Manipulation Language are:A.SELECT, INSERT, ALTER, DROPB.CREATE, INSERT, ALTER, DROPC.UPDATE, DROP, INSERT, REMOVED.INSERT, UPDATE, DELETE, SELECT

33.Which of the following statements is correct?A.All JOIN operators can be expressed as a combination of SELECT statements and cartesian productsB.The cartesian product of 2 sets will never have duplicate rowsC.INNER JOIN and OUTER JOIN of 2 tables will always be differentD.Adding GROUP BY to a SELECT statement will always return less rows than the same SELECT statement without the GROUP BY clause.

34.Given the following tables with the given data:

Page 11: DB2

STUDENT------------------name id----- -----Jim 1Sarah 2Frank 3

PROFESSOR------------------name course----- -----Jenny PHY_102Mark MAT_202Angie DB_101Jenny CSI_201

ENROLL------------------student_id course_id------ -----2 PHY_1022 DB_1013 PHY_1021 CSI_2013 MAT_202

After executing the query:

SELECT P.name, COUNT AS COUNT FROM STUDENT LEFT JOIN ENROLLON id=student_id, PROFESSOR AS PGROUP BY P.name

What would the result be?A.NAME COUNT---------------- --------Angie 1Jenny 3Mark 1B.NAME COUNT---------------- --------Angie 6

Page 12: DB2

Jenny 12Mark 6C.NAME COUNT---------------- --------Angie 1Jenny 2Mark 1D.NAME COUNT---------------- --------Angie 3Jenny 6Mark 3

35.Which of the following is NOT a definition of a relation?A.A relation may be thought of as a set of columns.B.Each row represents a fact that corresponds to a real-world entity or relationshipC.Each row has a value of an item or set of items that uniquely identifies that row in the tableD.Each column typically is called by its column name or column header or attribute name

36.Which of the following is true about Dynamic SQL?A.It is precompiled and binded in dynamic databases.B.The structured of an SQL statement must be completely specified at precompile time.C.It is compiled and executed by an application at run-time.D.Dynamic SQL does not exist.

37.Which of the following is true about the table below?

CREATE TABLE EMPLOYEE (ID INTEGER NOT NULL,

Page 13: DB2

NAME VARCHAR(30) NOT NULL,EXTENSION INTEGER NOT NULL,MANAGER VARCHAR(30) NOT NULL

PRIMARY KEY (ID));

TERMINATE;

ID NAME EXTENSION MANAGER1 John S 53412 Y2 Susan P 54123 N3 Jennifer L 51234 N

A.ID is a value found in the EMPLOYEE tableB.ID, 1, 2, 3 makes up a row in the EMPLOYEE tableC.The MANAGER domain consists only of the value YD.NAME, John S, Susan P, Jennifer L makes up a column in the EMPLOYEE table

38.The link between a column or set of columns in one table that refers to the set of column in another table is?A.PointerB.CursorC.Primary keyD.Foreign key

39.Which of the following statements is FALSE?A.The ALTER sequence privilege allows a user to perform administrative tasks like restarting the sequence, changing the increment value for the sequence, and add or change the comment associated with the sequence.B.

Page 14: DB2

When the GRANT statement is executed with the WITH GRANT OPTION clause specified, the user/group receiving privileges is given the ability to grant the CONTROL privilege to others.C.The USAGE privilege is the sequence privilege that allows a user to use the PREVIOUS VALUE and NEXT VALUE expressions that are associated with the sequence.D.The ALTER privilege for tables allows a user to modify the structure of a table.

40.Which is a true statement about Namespaces?A.Namespaces are the same as a root node within an XML document.B.Namespaces are types of nodes within XML documents.C.Namespaces help to distinguish between same element names in different domains.D.Namespaces help to uniquely identify XML elements by associating them to an URL, which is a valid web page.

41.Which of the following is the best implementation for a User Defined Function that emphasizes on database operations, considering that performance is critical to the application?A.Java external functionB.SQL PL functionC.Composed functionD.C built-in function

42.Which of the following is NOT displayed by DB2 Access Plan?A.Properties for operatorsB.Indexes or columnsC.Global informationD.Authorization type

Page 15: DB2

43.What is the lowest privilege/authority required to execute the following SQL statement?

CREATE VIEW view1 AS SELECT * FROM table1 WHERE AGE > 18A.REFERENCES privilege on table1B.SELECT privilege on table1C.DBADM authorityD.SYSADM authority

44.Consider the following IMPORT statement:

IMPORT FROM /data/dept.del of DELXML FROM /data/xmlfilesINSERT INTO dept

The table dept contains three columns: CID (INTEGER), NAME(VARCHAR(10)), INFO(XML). Which of the following /data/dept.del import files will be accepted by DB2?

A.1000, "John Smith", <XDS FIL=C1.xml/>1001,"Jane Doe", <XDS FIL=C2.xml/>1002, "Mary David", <XDS FIL=C3.xml/>B.1000, "John Smithson", "<XDS FIL='C1.xml' />"1001,"Jane Doe", "<XDS FIL='C2.xml' />"1002, "Mary David", "<XDS FIL='C3.xml' />"C.1000, "John Smith", "<XDS= 'C1.xml' />"1001,"Jane Doe", "<XDS= 'C2.xml' />"1002, "Mary David", "<XDS= 'C3.xml' />"D.1000, "John Smith", "<XDS FIL='C1.xml' />"1001,"Jane Doe", "<XDS FIL='C2.xml' />"1002, "Mary David", "<XDS FIL='C3.xml' />"

45.Consider the following. As the user MYUSER, you issue the following command:

Page 16: DB2

CREATE ALIAS A1 for T1What will be the result of the command?A.The alias DEFAULT.A1 is created for DEFAULT.T1.B.The alias MYUSER.A1 is created for MYUSER.T1.C.The alias ALIAS.A1 is created for ALIAS.T1.D.You get an error because your command is ambiguous, as the schema is not specified.

46.Consider TB1 has no rows initially and that the auto commit feature is disabled. After execution of the following statements, how many rows will be inserted in TB1?

INSERT INTO TB1 VALUES (1, 'ABC')INSERT INTO TB1 VALUES (2, 'DEF')COMMITINSERT INTO TB1 VALUES (3, 'GHI')ROLLBACKCOMMIT

A.0B.1C.2D.3

47.Which of the following statements is TRUE regarding the case when a client using the SERVER_ENCRYPT authentication type connects to a server using the SERVER authentication type?A.Data will be passed to the server encrypted.B.Data will be passed to the server unencrypted.C.Server will be unable to process the encrypted data and an error will occur.D.None of the above is true.

Page 17: DB2

48.A foreign key must?A.Be defined in all tables in the databaseB.Match the field value of a primary key in a related table or be NULL.C.Be uniqueD.Be numeric

49.Which of the following commands produces a backup image from a database?A.START BACKUP DATABASE SAMPLE USING D:\bkpB.BACKUP DATABASE SAMPLE TARGET= D:\bkpC.BACKUP DATABASE SAMPLE TO D:\bkpD.START BACKUP DATABASE SAMPLE TO D:\bkp

50.The type of data structure that is used in a relational model is?A.TableB.TreeC.NodeD.None of the above

51.If the current session has an isolation level of CS, which of the following will change the isolation level to UR for the current statement?A.SELECT * FROM sample ISOLATION URB.SELECT * FROM sample URC.SELECT * FROM sample USE UR

Page 18: DB2

D.SELECT * FROM sample WITH UR

52.Which of the following is NOT true about Database Management Systems?A.Relational Database Management Systems use Structured Query Language to interact with databases.B.Database Management Systems act as an interface used to communicate with databases.C.Applications can choose to bypass the Database Management System when accessing databases for performance reasons.D.DB2 is a Database Management System.

53.A database can be used to do which of the following?A.Create a repository of data.B.Provide an organized mechanism for manipulating data.C.Provide support for data processing.D.All of the above.

54.Consider a Stored Procedure with the following definition:

CREATE OR REPLACE PROCEDURE proc1 (IN p2 VARCHAR(20))BEGIN…END@

Using DB2 CLP, which of the following commands would successfully execute procedure PROC1?A.CALL proc1(DEFAULT)B.CALL proc1(?)

Page 19: DB2

C.CALL proc1(NULL)D.None of the above

55.Which of the following is NOT a valid approach for storing XML documents?A.Shredding XML documents into tables in a RDBMSB.Storing XML documents in CLOB columnsC.Inserting XML documents in an integer columnD.Using an external XML-only database

56.Which one of the following is a valid XPATH expression to retrieve an attribute value within an XML document?A./customerinfo/name/cidB./customerinfo/name/text(@cid)C./customerinfo/name/data(@cid)D./customerinfo/name/"cid"

57.Which of the following is the correct syntax for using the XMLTRANSFORM SQL/XML function?A.UPDATE XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ;B.SELECT FROM XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ;C.SELECT INTO XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ;D.SELECT XSLTRANSFORM (XMLDOC USING XSLT) FROM XMLDATA, XMLTRANS WHERE ID = 1 and XSLID = 2 ;

58.

Page 20: DB2

Which of the following languages can NOT be used to create a UDF in DB2 9.7?A.Perl// mam pocit ze tam pisou ze je pouzitelny jen C, C++, a JavaB.SQL PLC.JavaD.C#

59.The Data Manipulation Language is used to:A.select, insert, update, or delete database recordsB.create, modify, or drop database objectsC.provide data object access controlD.all of the above

60.Which of the following is NOT true about data?A.Data is useful and has meaning associated to it.B.Data can be quantitative or qualitative.C.Data describes a variable or set of variables.D.Essentially data can be thought of as the result of observations based on things like measurements and statistics.

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

61.Given the following UPDATE statement:

UPDATE employees SET workdept =(SELECT deptno FROM department WHERE deptno = 'A01')WHERE workdept IS NULL

Page 21: DB2

Which of the following describes the result if this statement is executed?

A.The statement will fail because an UPDATE statement cannot contain a subquery

B.The statement will only succeed if the data retrieved by the subquery does not contain

multiple recordsC.

The statement will succeed; if the data retrieved by the subquery contains multiple records, only the first record will be used to perform the update

D.The statement will only succeed if every record in the EMPLOYEES table has a null

value in the WORKDEPT column

62.Which of the following statements is NOT true regarding Table Spaces on DB2?

A.A Table Space is a logical object in between logical table and physical containers

B.All tables, indexes, and other data are stored in a table space

C.A Table Space is a logical object required to store data, indexes and tables in temporary

memoryD.

A Table Space is always associated to a Buffer Pool

63.Assume a table which contains the following columns:

EMP_IDEMP_NAMEPHONEEMAILSALARY

64.Which of the following is the simplest way to restrict users from viewing SALARY information, while still allowing them to see the other values?

A.

Page 22: DB2

Encrypt the table's data.B.

Create a view that does not contain the SALARY column. Grant access to the view and revoke access from the original table.

C.Revoke SELECT access for the SALARY column from users who should not see

SALARY data.D.

Store SALARY data in a separate table and grant SELECT privilege for that table to the appropriate users.

65.Assuming that you are currently connected to TESTDB, which of the following will allow

the view of the database settings with details?

A.db2 get db cfg with detail

B.db2 get db cfg show detail

C.db2 get dbm cfg with detail

D.db2 get dbm cfg show detail

66.Which of the following statements grants user John the ability to insert data to table

tab1?

A.GRANT ADD ON TABLE tab1 TO John

B.GRANT INSERT ON TABLE tab1 TO John

C.GRANT ADD ON TABLE tab1 TO USER John

D.GRANT INSERT ON TABLE tab1 TO USER John

67.Given the options below, which of the following statements can add records to a table?

Page 23: DB2

A.ADDREC

B.ADDRECORD

C.INSERT

D.ADD

A company has a large amount of data to store and wants to be able to do the following with the data:

Have a standard interface for accessing the data.Have multiple users with the ability to insert, update and delete data.Make changes to the data without risk of losing data and its consistency.Have the capability to handle huge volumes of data and users.Have tools for data backup, restore and recovery.

68.What data storage method is the most optimal solution for the company?

A.Text files

B.Comma delimited data files

C.Spreadsheets

D.Database

69.Which of the following is true about Relational Databases?

A.A column can store values of different data types.

B.A table consists of columns and rows.

C.Rows in the same table can have a different set of columns.

D.Rows are also known as fields of the table.

Page 24: DB2

70.Which of the following is the lowest cost DB2 product that can be legally installed on a windows server that has 4 CPUs capable of performing row compression?

A.DB2 Express Edition

B.DB2 Workgroup Edition

C.DB2 Express-C Edition

D.DB2 Enterprise Edition

71.Which of the following is a tool to configure automatic database backup?

A.Configure Automatic Maintenance wizard

B.Design Advisor

C.Explain tool

D.EXPORT utility

72.Which of the following is the lowest cost DB2 product that can be legally installed on a

Linux server that has 2 CPUs?

A.DB2 Express Edition

B.DB2 Enterprise Server Edition

C.DB2 Everyplace

D.DB2 Workgroup Server Edition

73.

Page 25: DB2

How can an application modify the isolation level of operations running against a DB2 database?

A.Isolation level can be changed for a particular SQL statement.

B.Isolation level can only be changed for the whole user session and all operations in that

session will be affected.C.

Isolation level to be used can be specified when executing the COMMIT operation.D.

Isolation level is determined at the moment an application connects to the database. To change the isolation level, an application is required to create a new connection specifying the desired level.

74.Consider the following command:

CREATE TABLESPACE MYTBSP1 MANAGED BY AUTOMATIC

What will the command result in?

A.Creation of a normal table space called mytbsp1 that is managed automatically.

B.Creation of a user table space called mytbsp1 that is managed automatically.

C.Creation of a temporary table space called mytbsp1 that is managed automatically.

D.This command will return an error to the user.

75.When a user is connected to a database, which of the following privileges is required for

the user to use a package?

A.BIND

B.BINDADD

C.EXECUTE

Page 26: DB2

D.USE

76.Which of the following is NOT a supported type of trigger?

A.AFTER

B.BEFORE

C.DURING

D.INSTEAD OF

77.What is authorization?

A.Authorization is a process that checks whether you have sufficient privileges to perform

the desired database operation.B.

Authorization is the process where the DBA gathers information to see who will have access to the database.

C.Authorization is the process where the DB2 database checks with Windows security to

see if you have access to the DB2 database.D.

Authorization is a process that validates that you are who you claim to be by verifying your user ID and password.

78.Consider the following XML document:

<customerinfo><name>John Smith</name><addr country="Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip>

Page 27: DB2

</addr><phone type="work">963-289-4136</phone></customerinfo>

Consider the following UPDATE expression:update xmlcustomerset info = xmlquery( 'transformcopy $new := $imodify (do insert <phone type="cell">777-555-3333</phone> after $new/customerinfo/addr,for $j in $new/customerinfo/addr/phonereturn do rename $j as "telephone")return $new' passing info as "i")where cid = 1000;

Which of the following represents the XML document after the TRANSFORM expression has been executed:

A.<customerinfo> <name>John Smith</name>

<addr country="Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type="cell">777-555-3333</phone><phone type="work">963-289-4136</phone></customerinfo>

B.<customerinfo> <name>John Smith</name>

<addr country="Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type="cell">777-555-3333</phone><telephone type="work">963-289-4136</telephone></customerinfo>

C.<customerinfo> <name>John Smith</name>

Page 28: DB2

<addr country="Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type="cell">777-555-3333</phone><telephone type="work">963-289-4136</telephone></customerinfo>

D.<customerinfo> <name>John Smith</name>

<addr country="Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip><phone type="cell">777-555-3333</phone></addr><telephone type="work">963-289-4136</telephone></customerinfo>

79.What are the entities used to model data in the Relational Model?

A.A collection of instances of entities.

B.Relations, attributes and tuples

C.A collection of instances of record types.

D.Table, rows and columns

Which of the following best define what a transaction is?

A.A sequence of one or more SQL operations grouped together, also known as a single

unit of work.B.

A set of independent operations that can be executed in parallel.C.

Page 29: DB2

A data isolation level that can help prevent deadlocks by allowing reads on previously committed data.

D.An object of a DB2 database.

80.Which of the following SQL statements can be used to remove data from table "users":

A.REMOVE TABLE users

B.DROP TABLE users

C.DELETE TABLE users

D.ALTER TABLE users

81.Given the following table:

TAB1-------------------COL1 COL2----- -----A 10B 20C 30A 10D 40C 30

Assuming the following results are desired:

TAB1-------------------COL1 COL2----- -----A 10B 20C 30D 40

Page 30: DB2

Which of the following statements will produce the desired results?

A.SELECT UNIQUE * FROM tab1

B.SELECT DISTINCT * FROM tab1

C.SELECT UNIQUE(*) FROM tab1

D.SELECT DISTINCT(*) FROM tab1

82.You are tasked with designing a model that can be used by the software developer to

implement a given application. Which of the following is NOT true about your model?

A.The model is a low level of abstraction with concrete and detailed design.

B.The model includes specific implementation and protocol details.

C.The model should define relationships between the managed objects.

D.The model being designed is an Information Model.

83.What is SQL/XML?

A.SQL/XML is a communication protocol for DB2 databases.

B.A.SQL/XML is part of the XQuery standard and provides various publishing functions to

transform XML data into relational form and vice versa.C.

SQL/XML is a language that provides various publishing functions to transform XML data into relational form and vice versa.//zas tipuju tak kdyztak opravte

D.SQL/XML is an extension to SQL standard and provides various publishing functions to

transform XML data into relational form and vice versa.

Page 31: DB2

84.Which of the following is NOT part of the XQuery FLOWR expression?

A.FOR clause

B.LET clause

C.ORDER BY clause

D.WITH clause

85.Given the following two tables:

TAB1------------------COL_1 COL_2----- -----A 10B 12C 14

TAB2-------------------COL_A COL_B----- -----A 21C 23D 25

86.Assuming the following results are desired:

COL_1 COL_2 COL_A COL_BA 10 A 21B 12 - -C 14 C 23- - D 25

Which of the following joins will produce the desired results?

Page 32: DB2

A.SELECT * FROM tab1 INNER JOIN tab2 ON col_1 = col_a

B.SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON col_1 = col_a

C.SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON col_1 = col_a

D.SELECT * FROM tab1 FULL OUTER JOIN tab2 ON col_1 = col_a

87.Which of the following objects you would need to create in order to execute a block of

code every time table TB1 is updated?

A.An AFTER trigger

B.A UDF

C.A Stored Procedure

D.An User Defined Type

88.Given the following table definition:

SALES--------------------------SALES_DATE DATESALES_PERSON CHAR(20)REGION CHAR(20)SALES INTEGER

Which of the following SQL statements will remove all rows that had a SALES_DATE in the year 1995?

A.DELETE * FROM sales WHERE YEAR(sales_date) = 1995

B.DELETE FROM sales WHERE YEAR(sales_date) = 1995

C.

Page 33: DB2

DROP * FROM sales WHERE YEAR(sales_date) = 1995D.

DROP FROM sales WHERE YEAR(sales_date) = 1995

89.Application B wants to read a subset of rows from table EMPLOYEE multiple times

inside the same transaction.

Which isolation level should be used in order to guarantee that every time the same set of rows is returned?

A.Currently Committed

B.Read Stability

C.Repeatable Read

D.Uncommitted Read

90.Using DB2's CLP, to access a remote database for the first time, it is necessary to:

A.First catalog the remote system or node, and then catalog the database within the

remote nodeB.

First register the remote system user in the system catalog, and then setup a SSH communication to the remote node

C.DB2 cannot use databases in remote systems unless SYSADM authority is granted to

the local userD.

First list all the remote databases with the db2 list database directory command, and then select the remote database from the list

91.Which of the following is NOT true about columns?

Page 34: DB2

A.Each column consists of one or more fields//opet typ

B.Each column contains a specific type of information

C.Columns must be designated a specific data type

D.Columns are also known as fields

92.Given the following two tables

NAMES--------------------------------STUDENT_NAME STUDENT_NUMBER------------ ----------------Wayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Mario Lemieux 66

MARKS--------------------------------NAME Marks-------- -------Wayne Gretzky 80Bobby Orr 94Brett Hull 77Mario Lemieux 83

How many rows would be returned using the following statement?

SELECT distinct name FROM student_names, marks

A.9

B.20

C.5

D.

Page 35: DB2

6

92.Considering the SQL statement below, which option best describes what APP.TAX is:

SELECT APP.TAX(SALARY) FROM EMPLOYEE

A.User Defined Function

B.Stored Procedure

C.Trigger

D.User Defined Type

93.Which of the following statements is FALSE about transactions?

A.Operations inside a transaction are executed in parallel.

B.Only 1 COMMIT statement can be executed inside the same transaction.

C.Transactions guarantee atomicity of a group of operations.

D.A ROLLBACK or COMMIT statement finalizes a transaction.

94.Which of the following is true about a well-formed XML document?

A.Has one or more root nodes.

B.Tags can have at most one attribute.

C.Always has a single document node.

D.End tags are optional.

Page 36: DB2

Given the following table:

CURRENT_EMPLOYEES-----------------------------EMPID INTEGER NOT NULLNAME CHAR(20)SALARY DECIMAL(10,2)

PAST_EMPLOYEES-----------------------------EMPID INTEGER NOT NULLNAME CHAR(20)SALARY DECIMAL(10,2)

95.Assuming both tables contain data, which of the following statements will NOT successfully add data to table CURRENT_EMPLOYEES?

A.INSERT INTO current_employees (empid) VALUES (10)

B.INSERT INTO current_employees VALUES (10, 'JAGGER', 85000.00)

C.INSERT INTO current_employees SELECT empid, name, salary FROM

past_employees WHERE empid = 20D.

INSERT INTO current_employees (name, salary) VALUES (SELECT name, salary FROM past_employees WHERE empid = 20)

96.Given the following two tables:

NAMES---------------------------NAME NUMBER---------- -------Wayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Mario Lemieux 66

Page 37: DB2

POINTS----------------------------NAME POINTS---------- -------Wayne Gretzky 244Bobby Orr 129Brett Hull 121Mario Lemieux 189Joe Sakic 94

How many rows would be returned using the following statement?

SELECT * FROM names, points

A.0

B.5

C.10

D.25

97.After the following SQL statement is executed:

GRANT ALL PRIVILEGES ON TABLE student TO USER user1

Assuming user USER1 has no other authorities or privileges, which of the following actions is USER1 allowed to perform?

A.Grant all privileges on table STUDENT to other users.

B.Drop a view associated to the table STUDEN.

C.Drop the table STUDENT.

D.None of the above.

98.A Dirty Read occurs when?

Page 38: DB2

A.A transaction read the same row of data twice and returns different data values with

each read.B.

A search based on some criterion returns additional rows after consecutive searches during a transaction.

C.Uncommitted data is returned, but the transaction that originated them was rolled back.

D.Two transactions read and then attempt to update the same data, the second update will

overwrite the first update before it is committed.// slide 171

98.Consider the following scenario. You have 3 tables with the same name (TABLE_1)

under 3 different schemas (SYSIBM, DEFAULT and DB2INST1). You are connected to a DB2 database in your Linux server as db2inst1 and issue the following statement:

SELECT * FROM table_1

Which table will you be selecting data from:

A.You get an error because your query is ambiguous, as the table schema is not specified

B.SYSIBM.table_1

C.DEFAULT.table_1

D.DB2INST1.table_1

99.Which of the following is an XML-based language for transforming XML documents?

A.XHTML

B.XSLT

C.HTML

D.Java

Page 39: DB2

100.What is the purpose of a DB2 Access Plan?

A.SQL developers can define Access Plans to tell DB2 the best way to retrieve the data

from a SQL queryB.

Describes the order of operations to access data necessary to execute a SQL or XQuery statement

C.To replicate data between a DB2 database and relational databases from other vendors

D.To visually construct complex DML statements and examine the results of their

execution

101.Which of the following best describes what an incremental cumulative backup is?

A.Backup all of the data that has changed since the last successful full or delta backup.

B.Backup of a single table space.

C.Backup of the entire database.

D.Backup all of the data that has changed since the last full backup.

102.Which of the following DB2 client/driver packages is NOT suitable for developing ODBC

applications?

A.IBM Data Server Client

B.IBM Data Server Driver for ODBC and CLI

C.IBM Data Server Runtime Client

D.IBM Data Server Driver Package

Page 40: DB2

103.Which of the following commands would delete the SAMPLE database?

A.db2 drop sample// snad si to pamatuju spravne

B.db2 delete database sample

C.db2 drop sample db

D.db2 drop database sample

104.Which of the following is true about Dynamic SQL?

A.It is precompiled and binded in dynamic databases.

B.The structured of an SQL statement must be completely specified at precompile time.

C.It is compiled and executed by an application at run-time.

D.Dynamic SQL does not exist.

105.What is a Trusted Context?

A.It is a special area in a buffer pool that can be written only by a selected set of users.

B.It is a DB2 capability that allows applications to change users without breaking the

connection to the database.C.

It is a DB2 capability that allows users to establish a connection to the database without providing user name or password.// snad tomou rozumim spravme...slide 214

D.It is a type of container in a table space that allows faster I/O operations.

Page 41: DB2

106.How does automatic storage work in DB2?

A.Automatic storage simplifies storage management by allowing you to specify storage

paths where the database manager can place table space data, and where the database manager allocates space for various uses.

B.Automatic storage is an option which is set when you create a DB2 database. It allows

transactions that are written to the database to be automatically committed.C.

Automatic storage is a function of DB2 that allows tables to be backed up automatically on a set schedule.

D.Automatic Storage can be used to automatically reorganize the data on the physical

media in order to improve performance.

107.Which of the following is FALSE about views?

A.Do not contain real data// snad ot je ono

B.Any view can be updated, independent of its definition

C.When changes are made to data through a view, the data is changed in the underlying

tableD.

Can be used interchangeably with tables when retrieving data

108.Which of the following is a well-formed XML document?

A.<Name xmlns="htpp://sample.default.nspace.com" Gender="MALE">

<FirstName>Amitabh</FirstName><LastName>Patel</LastName></Name>

B.

Page 42: DB2

<Name xmlns="http://sample.default.nspace.com" MALE="Gender"><FirstName>Amitabh</FirstName><LastName>Patel</LastName></name>

C.<Name Gender="MALE">

<FirstName>Amitabh <LastName>Patel</FirstName> </LastName></Name>

D.//trochu sem premyslel jestli neni problem u gender=female ale snad to je enum

<Name Gender=FEMALE><FirstName>Jaya</FirstName><LastName>Patel</LastName></Name>

109.Which Data Model was created with the focus of providing better data independence?

A.Relational

B.Hierarchical

C.Semantic

D.Network

120.Which of the following is true about columns?

A.Each column consists of one or more records

B.Columns are where the individual pieces of information are stored for each record

C.Columns must be designated a specific data type

D.Columns are also known as records