db2 File

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 19

1. Which of the following is NOT true? A.

Structured Query Language is the standard language for manipulating data in a Relational Database Management System. B. Database Management Systems act as an interface used to communicate with databases. C. The Hierarchical data model organizes data in tables with columns and rows. D. DB2 is a Database Management System. 2. Consider the following scenario. We have a table, table_1, which has only one column storing an integer value. The following statements are executed successfully in the order shown: CREATE SEQUENCE my_seq START WITH 1 INCREMENT BY 1 CACHE 5 INSERT INTO table_1 VALUES (NEXT VALUE FOR my_seq); INSERT INTO table_1 VALUES (NEXT VALUE FOR my_seq); After a db2 terminate and reconnection to the database, the following statement was issued: INSERT INTO table_1 VALUES (NEXT VALUE FOR my_seq); SELECT * FROM table_1 What value will be the last value returned by the query? A. 1 B. 2 C. 3 D. 6

3. Which of the following is NOT true about keys in the relational model? A. Primary keys are defined by a subset of attributes of a relation. B. Primary keys uniquely identify each tuple of the relation. C. Primary keys define the relationship between two tables. D. A relation can have multiple foreign keys. 4. Given the following tables: CURRENT_EMPLOYEES -------------------------EMPID INTEGER NOT NULL NAME CHAR(20) SALARY DECIMAL(10,2) ENABLED CHAR(1) PAST_EMPLOYEES -------------------------EMPID INTEGER NOT NULL NAME CHAR(20) SALARY DECIMAL(10,2) Assuming PAST_EMPLOYEES is empty and CURRENT_EMPLOYEES is populated, which of the following statements will copy all past employees (enabled column is 'N') from CURRENT_EMPLOYEES to table PAST_EMPLOYEES? A INSERT INTO past_employees VALUES (current_employees WHERE ENABLED = 'N') B. INSERT INTO past_employees (SELECT empid, name, salary FROM current_employees) C. INSERT INTO past_employees (SELECT * FROM current_employees WHERE ENABLED = 'N') D. INSERT INTO past_employees (SELECT empid, name, salary FROM current_employees WHERE ENABLED in ('N')) 4. When does authentication takes place? A. Just before DB2 executes a SQL statement sent by a client application. B. When the user connects to the database. C. When the user disconnects from a database. D. It is part of DB2 server startup process 5. Which of the following events will NOT cause a trigger to be activated? A. DELETE B. SELECT C. INSERT D. UPDATE 6. Which of the following is a reason for using databases to store data INSTEAD of the many alternatives? A. Databases store data in an unstructured way for faster insert performance. B. Databases are cheaper to use than other alternatives. C. Databases are an intrinsic functionality of most Operating Systems, thus it's widely available to

applications. D. Databases allow multiple users to handle and change the data without losing data and its consistency. 7. Which of the following options best describes a domain found in the table below? CREATE TABLE EMPLOYEE ( ID INTEGER NOT NULL, NAME VARCHAR(30) NOT NULL, EXTENSION INTEGER NOT NULL, MANAGER VARCHAR(30) NOT NULL PRIMARY KEY (ID)); TERMINATE; ID NAME EXTENSION MANAGER 1 John S 53412 Y 2 Susan P 54123 N 3 Jennifer L 51234 N A. Manager Domain = (N) B. Name Domain = (Set of all Possible Names) C. Extension Doman = (53412) D. ID Domain = (1, 2, 3) 8. Buffer pools are associated with table spaces so that they can increase performance by caching data in memory. Which of the following is true? A. A table space can only be associated with a buffer pool that has the same page size. B. A table space can only be associated with a buffer pool that has a smaller or same page size. C. A table space can only be associated with a buffer pool that has a larger or same page size. D. A table space can only be associated with a buffer pool that has a larger page size.

9. Which of the following is true about Static SQL? A. It takes advantage of the table statistics at runtime. B. The structured of the SQL statement must be completely specified at the precompilation phase. C. It is compiled and executed by an application at run-time. D. Static SQL does not exist. 10. Which of the following privileges permits a user to create objects within a schema? A. CONTROL B. ALTER C. REFERENCES D. CREATEIN 11. Consider a Stored Procedure with the following definition: CREATE OR REPLACE PROCEDURE proc1 (p1 INTEGER, OUT p2 VARCHAR(20)) BEGIN END @ Using DB2 CLP, which of the following commands would successfully execute procedure PROC1? A. CALL proc1(1, DEFAULT) B. CALL proc1(1, ?) C. CALL proc1(1) D. None of the above 12. In DB2 9.7, which of the following functions can be used to create tables from XML documents? A. XMLTABLE B. TABLEXML C. XML2RELATIONAL D. XML2TABLE 13. If circular logging is used, the following types of backup are allowed:

A. Online full backup B. Offline full backup C. Online incremental backup D. Offline incremental backup 14. Which of the following tools would you use if you need to execute SQL statements against a DB2 database from the command line? A. DB2 Health Center B. DB2 Command Line Processor C. DB2 Command Line Advisor D. DB2 Control Center 15. Which of the following installation packages does NOT contain the GUI administration tools? A. DB2 Data Server Enterprise Edition B. DB2 Data Server Express-C Edition C. IBM Data Server Client D. IBM Data Server Runtime 16. Consider table TB1 defined as below: CREATE TABLE TB1 ( C1 INTEGER PRIMARY KEY, C2 VARCHAR(10)) Considering the following statements are successfully executed in CLP with auto-commit disabled, how many rows are INSERTED in table TB1 INSERT INTO TB1 VALUES (1, 'John') INSERT INTO TB1 VALUES (1, 'John') COMMIT INSERT INTO TB1 VALUES (1, 'John') ROLLBACK A. 0 B. 1 C. 2 D. 3 17. Which of the following is true about Table Spaces in DB2? A. A Table Space is a file managed by the operating system where DB2 can store data. B. A Table Space is always associated with a buffer pool. C. A Table Space to store user's temporary table data is automatically created when a database is created. D. A Table Space can be managed by the database (DB2) or by an external application. 18. Which of the following best describes the advantages of executing a set of DML statements inside a single transaction? A. The DBMS records those operations in the audit logs since they are grouped inside a transaction. B. The DBMS stores the transaction operations so that the client applications can rerun the transaction more easily. C. The DBMS guarantees that either all changes performed by the DML are stored, or in case of error, the changes are undone, leaving the database in a consistent state. D. The DBMS guarantees that all operations are always executed successfully. 19. Which of the following tools can be used to develop stored procedures? A. DB2 CLP B. DB2 Command Editor C. IBM Data Studio D. All of the Above 20. Your company has asked you to create a database to store and organize data about the structure of the company. You want to store branch and employee data as well as data on the products that each employee in your company deals with. In order to reduce redundancy, how many tables should you create? Consider that your model should be tailored to reduce the possible number of NULL values in the table(s). A. 1 B. 2 C. 3 D. 4

21. Which of the following statements is FALSE regarding Buffer Pools? A. Buffer Pools work as a cache, storing data that is read from table spaces. B. Pages in a Buffer Pool can be 4k, 8k, 16k and 32k in size. C. A database can only have one Buffer Pool. D. The size of a Buffer Pool can be automatically resized by STMM 22. Which of the following is true about Relational Databases and the Relational Data Model? A. A table does not allow duplicates and a relation does. B. A domain is the smallest unit of data. C. A column is the equivalent to a tuple. D. A domain is the set of some possible values for a specific field 23. Which of the following is NOT a DML statement? A. SELECT B. INSERT C. ALTER D. UPDATE 24. Given the following table definition: SALES -------------------------SALES_DATE DATE SALES_PERSON CHAR(20) REGION CHAR(20) SALES INTEGER Which of the following SQL statements will remove all sales that occurred in 1995? A..DELETE * FROM sales WHERE YEAR(sales_date) = 1995 B. DELETE FROM sales WHERE YEAR(sales_date) = 1995 C. REMOVE * FROM sales WHERE YEAR(sales_date) = 1995 D. REMOVE FROM sales WHERE YEAR(sales_date) = 1995 25. Which of the following best describes the benefits of supporting XQuery's TRANSFORM expression in DB2? A. It can be used to modify both XML and relational data, providing a common language for developers n to handle the database data. B. When used in a UPDATE statement, it simplifies the update of XML documents stored in the database, since all processing is done by the DB2 engine. C. It is very useful to change XML nodes when the XML document is loaded in the client application. D. It can be used to automatically clean up unnecessary tags in a XML document, providing smaller documents thus saving space in the database. A 26. Which of the following statements revoke access to SAMPLE database from user TOM? A. REVOKE CONNECT ON sample FROM USER tom B. REVOKE ACCESS FROM USER tom ON DATABASE C. REVOKE ACCESS FROM USER tom ON sample D. REVOKE CONNECT ON DATABASE FROM USER tom 27. Which of the following privileges permits a user to update the comment associated with a table? A. ALTER B. CONTROL C. CREATEIN D. REFERENCES 28. What is the default isolation level in DB2 9.7 for Linux, Unix and Windows for new databases? A. Cursor Stability B. Cursor Stability with Currently Committed semantics C. Uncommitted Read D. None of the above 29. Which of the following is true about the Information Model? A. Allows specification of objects in a detailed level. B. It can describe objects but not the relationships between them. C. It is a group of descriptions explaining objects of a data model. D. Data models can be used to map an Information Model to a software implementation D 30. Assuming that you are currently connected to a DB2 database, which of the following commands will

terminate your connection? A. db2 connect reset B. db2 connect end C. db2 connect kill D. db2 connect finalize 31. Giving the following create table statement CREATE TABLE student_marks (student_name CHAR(20) NOT NULL, student_number INTEGER NOT NULL, math INTEGER, phys INTEGER, engl Integer) Which of the following statements will retrieve the student's name who does NOT have a phys mark? A. SELECT student_name FROM student_marks WHERE phys = ' ' B. SELECT student_name FROM student_marks WHERE phys = NULL C. SELECT student_name FROM student_marks WHERE phys = 0 D. SELECT student_name FROM student_marks WHERE phys is NULL 32. What are the advantages of using Stored Procedures? A. Reduces network traffic B. Access to features that exist only on the server C. Enforcement of business rules D. All of the above 33. Which of the following tools will give you the best performance to import large amounts of data into a DB2 table? A. IMPORT B. LOAD C. FAST IMPORT D. BULK INSERT 34. Given the following table: GUESTS -----------------name age --------Jenny 34 Rodney 36 Oliver 21 Angie 42 Tom 28 Vincenzo 25 What names would be displayed as the result of the following SQL query SELECT name FROM GUESTS WHERE name LIKE '%o_' A. Oliver, Rodney, Tom, Vincenzo B. Rodney, Tom C. Tom D. Oliver, Rodney, Tom 35. 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. 36. Which of the following is NOT true about Relational Databases? A. Each column contains a specific type of information. B. Columns are where the individual pieces of information are stored. C. A primary key can be composed of only one attribute. D. Foreign keys are an attribute in one relation whose values match a primary key of another relation. 37. Which of the following elements are shown in a DB2 Access Plan?

A. Configuration parameters relevant to optimization. B. Properties for operators. C. Statistics. D. All of the above. D 38. Which of the following XML fragment correctly indicates the result of the given statement below? values (XMLELEMENT (name "Name", XMLNAMESPACES( DEFAULT 'htpp://sample.default.nspace.com'), XMLATTRIBUTES ('MALE' as "Gender"), XMLCONCAT( XMLELEMENT (name "FirstName", 'Amitabh'), XMLELEMENT (name "LastName", 'Patel')))) A. <Name xmlns="htpp://sample.default.nspace.com" Gender="MALE"> <FirstName>Amitabh</FirstName> <LastName>Patel</LastName> </Name> B. <Name xmlns="htpp://sample.default.nspace.com"> <Gender>MALE</Gender> <FirstName>Amitabh</FirstName> <LastName>Patel</LastName> </Name> C. <Name Gender="MALE"> <FirstName>Amitabh <LastName>Patel</LastName></FirstName> </Name> D. None of the above 39. Which one of the following SQL statements will inline XML documents smaller than 1000 bytes, stored within the EMPINFO column? A. CREATE TABLE EMPLOYEES (empid char(8), empinfo XML inline length(1024)) B. ALTER TABLE EMPLOYEES ALTER COLUMN empinfo SET INLINE LENGTH 1000 C. CREATE TABLE EMPLOYEES (empid char(8), empinfo XML) SET INLINING (1000) D. CREATE TABLE EMPLOYEES (empid char(8), empinfo XML DEFAULT INLINE 1000) 40. Given the following UPDATE statement UPDATE employees SET workdept = (SELECT deptno FROM department) WHERE workdept = NULL 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 fail because the WORKDEPT column appears in the SET and WHERE clause at the same time. C. The statement will only succeed if table DEPARTMENT has only 1 row. D. The statement will only succeed if every record in the EMPLOYEES table has a null value in the WORKDEPT column 41. The authentication method in a DB2 server is defined within: A. The database configuration. B. The system's catalog. C. The DB2 registry. D. The database manager configuration. 42. In embedded SQL, which of the following is an example of how to establish a connection to the SAMPLE database in DB2? A. EXEC SQL CONNECT TO SAMPLE B. DB2 CONNECT TO DB SAMPLE C. EXEC CONNECT TO SAMPLE D. EXEC DB2 CONNECT TO DATABASE SAMPLE

43. Which of the following statements is TRUE?

A. The owner of a table does not automatically receive CONTROL privilege for that table. B. The owner of a table automatically receives CONTROL privilege, but does not automatically receive all other table privileges available for that table. C. If the CONTROL privilege is revoked from the table owner, all other privileges that were automatically granted to the owner when the table was created are automatically revoked. D. If the CONTROL privilege is revoked from the table owner, all other privileges that were automatically granted to the owner when the table was created need to be explicitly revoked. 44. Given the options below, which of the following statements can remove a table from a database? A. REMOVE B. DELETE C. DEL D. DROP 45. Which of the following statements best describes the XML Regions Index in DB2? A. The Regions Index is a descriptor for referencing large objects in the LOB storage area. B. The Regions Index is a new type of XML index available in DB2 9.7. C. The Regions Index facilitates access to document regions in the XML data area. D. The Regions Index can be compressed by issuing an offline reorg operation on the table. 46. Application A is running under the Repeatable Read isolation level and holds an Update lock on table TAB1. Application B wants to query table TAB1 and cannot wait for Application A to release its lock. Which isolation level should Application B run under to achieve this objective? A. Repeatable Read B. Read Stability C. Cursor Stability D. Uncommitted Read 47. Which of the following is a characteristic of High Availability? A. It allows compression of data. B. It allows definition of a policy to guarantee quality of service to applications. C. It allows replication of data to a standby server that can take over in case of failure. D. It allows high performance of a DB2 server by distributing workload across several machine. 48. If secondary log files are to be allocated until the unit of work commits or storage is exhausted, which type of logging is used? A. Circular logging B. Archival logging C. Infinite logging D. It cannot be done in DB2 49. Which of the following options can be used to check the minimum point in time (PIT) for a table space restore? A. LIST TABLESPACES SHOW ALL B. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) FROM /tbspbkp C. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) ONLINE FROM /tbspbkp D. GET SNAPSHOT FOR TABLESPACE ON <database> 50. Given the following two tables: TAB1 -----------------COL_1 COL_2 --------A 10 B 12 C 14 TAB2 -----------------COL_A COL_B --------A 21 C 23 D 25 Assuming the following results are desired:

COL_1 COL_2 A 10 B 12 C 14

COL_A A C

COL_B 21 23

Which of the following joins will produce the desired results? 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 51. Which of the following programming languages can be used to develop applications that require access to a DB2 database? A. Java B. PHP C. C# D. All of the above 52. Which Data Model was created with the focus of providing better data independence? A. Semi-structured B. Hierarchical C. Relational D. Entity-Relationship 53. When creating a DB2 database, which of the following table spaces is NOT automatically created? A. User table space B. User temporary table space C. Catalog table space D. System temporary table space 54. Which of the following is NOT a SQL/XML function in DB2 9.7? A. XMLQUERY B. XMLEXISTS C. EXISTS D. XMLCAST 55. Which of the following is characteristic difference between Cursor Stability and Currently Committed? A. Reader blocks Reader B. Reader blocks Writer C. Writer blocks Reader D. Writer blocks Writer 56. Two tables are created by the following statement CREATE TABLE color ( c_id INTEGER NOT NULL PRIMARY KEY, C_desc CHAR(20)) CREATE TABLE object ( o_id CHAR(2), o_desc CHAR(20), c_id INTEGER REFERENCES COLOR (c_id) ON DELETE CASCADE) Which option correctly describes the change on the two tables after the statement below is executed: DELETE FROM color WHERE c_id = 2 A. Only rows in table COLOR can be affected. B. Only rows in table OBJECT can be affected. C. Rows in both color and object with c_id = 2 will be deleted. D. No row will be deleted. C

57. Which of the following is NOT a Feature Pack that can add extra functionality to a DB2 server? A. Advanced Access Control B. Storage Optimization C. Performance Optimization D. pureXML 58. Consider a table TAB1 having the following values: TAB1 ----------------COL1 COL2 ------A 10 B 20 C 30 A 10 D 40 C 20 Which of the following statements can be used to modify the values in TAB1 so that the final content is as follows: TAB1 ----------------COL1 COL2 ------C 30 D 40 A. DELETE FROM TAB1INSERT INTO TAB1 VALUES ('C', 40) INSERT INTO TAB1 VALUES ('D', 30) B. UPDATE TAB1 SET COL1 = NULL WHERE COL2 IN (10, 20) C. DELETE FROM TAB1 WHERE COL2 NOT IN (30, 40) D. DELETE FROM TAB1 WHERE COL2 IN (10, 20) A 59. Considering the SQL statement below, which option best describes what ABS is: UPDATE tb1 SET col1 = ABS(col2) A. Stored Procedure B. Built-in function C. Trigger D. User Defined Type

1. 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 2. 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. 3. Given the following table definition: SALES -------------------------SALES_DATE DATE SALES_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. DROP * FROM sales WHERE YEAR(sales_date) = 1995 D. DROP FROM sales WHERE YEAR(sales_date) = 1995 4. 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. B 5. 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 B 6. Given the following table: CURRENT_EMPLOYEES ----------------------------EMPID INTEGER NOT NULL NAME CHAR(20) SALARY DECIMAL(10,2) PAST_EMPLOYEES ----------------------------EMPID INTEGER NOT NULL NAME CHAR(20) SALARY DECIMAL(10,2) 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 = 20 D. INSERT INTO current_employees (name, salary) VALUES (SELECT name, salary FROM past_employees WHERE empid = 20) d

7. 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. D 8. 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. D 9. 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. C 10. 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 node B. 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 user D. First list all the remote databases with the db2 list database directory command, and then select the remote database from the list A 11. 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 query. B. 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 D 12. 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 D 13. 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 memory D. A Table Space is always associated to a Buffer Pool D 14. Which of the following commands would delete the SAMPLE database? A. db2 drop sample B. db2 delete database sample C. db2 drop sample db D. db2 drop database sample 15. 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 16. 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 17. 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 D 18. 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. 19. Which of the following is NOT a supported type of trigger? A. AFTER B. BEFORE C. DURING D. INSTEAD OF 20. Given the following two tables: TAB1 -----------------COL_1 COL_2 --------A 10 B 12 C 14 TAB2 ------------------COL_A COL_B --------A 21 C 23 D 25 Assuming the following results are desired: COL_1 A B C COL_2 10 12 14 COL_A A C D COL_B 21 23 25

Which of the following joins will produce the desired results? 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 D 21. 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. A data isolation level that can help prevent deadlocks by allowing reads on previously committed data. D. An object of a DB2 database. A

22. 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. A 23. Which Data Model was created with the focus of providing better data independence? A. Relational B. Hierarchical C. Semantic D. Network D 24. 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 B 25. 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. What data storage method is the most optimal solution for the company? A. Text files B. Comma delimited data files C. Spreadsheets D. Database D 26. Which of the following options will perform an offline table space recovery? A. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) OFFLINE FROM /tbspbkp B. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) FROM /tbspbkp C. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) ONLINE FROM /tbspbkp D. There is no option to restore a table space in DB2 C 27. 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> </addr> <phone type="work">963-289-4136</phone> </customerinfo> Consider the following UPDATE expression: update xmlcustomer set info = xmlquery( 'transform copy $new := $i modify ( do insert <phone type="cell">777-555-3333</phone> after $new/customerinfo/addr,

for $j in $new/customerinfo/addr/phone return 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> <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> C 28. In embedded SQL code, which of the following is true about delimiters? A. Used by the OS to delimit system variable declaration. B. Used by the database to indicate the end of a column. C. Used by compiler to indicate the end of the program. D. Used by PRECOMPILER to identify SQL statements to be translated. D 29. Given the following UPDATE statement: UPDATE employees SET workdept = (SELECT deptno FROM department WHERE deptno = 'A01') WHERE workdept IS NULL 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 records C. 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 B 30. 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 B 31. You were assigned the task of importing a large amount of data into a DB2 database. Considering you must have logged information about the rows imported and that you want to perform the load as fast as possible, which of the tools would you be the best choice for the job? A. DB2 INSERT B. DB2 IMPORT C. DB2 LOAD D. DB2 CLP 32. Given the following two tables NAMES -------------------------------STUDENT_NAME STUDENT_NUMBER ------------ ---------------Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Mario Lemieux 66 MARKS -------------------------------NAME Marks -------------Wayne Gretzky 80 Bobby Orr 94 Brett Hull 77 Mario 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. 6 D 33. Assume a table which contains the following columns: EMP_ID EMP_NAME PHONE EMAIL SALARY 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. 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 user

34. Which of the following properties is related to the fact that a committed transaction guarantees that all of the operations are completed and in a roll backed transaction the effect of all operations are reverted? A. Consistency B. Atomicity C. Isolation D. Durability C 35. Which of the following is NOT true about columns? A. Each column consists of one or more fields 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 A 36. 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. D 37. 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 38. 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. C 39. If TAB1 is created using the following statement CREATE TABLE tab1 ( col1 INTEGER NOT NULL, col2 CHAR(3), CONSTRAINT cst1 CHECK (col1 in (1, 2, 3, 4))) Which of the following statements will successfully insert a record into table TAB1? A. INSERT INTO tab1 VALUES (0, 'a') B. INSERT INTO tab1 VALUES (NULL, 'abc') C. INSERT INTO tab1 VALUES (4, 'a') D. INSERT INTO tab1 VALUES (4, 'abcdefhijklmnopq' C 40. 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 C 41. When attempting to establish a connection to a database residing on your local machine, which command can help you determine why the following message was displayed: SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE=42705 A. list database directory B. list admin node directory C. list node directory D. list dcs directory D 42. 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 43. Given the options below, which of the following statements can add records to a table? A. ADDREC B. ADDRECORD C. INSERT D. ADD 44. 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. D. It is a type of container in a table space that allows faster I/O operations 45. Given the following two tables: NAMES --------------------------NAME NUMBER ---------------Wayne Gretzky 99 Jaromir Jagr 68 Bobby Orr 4 Bobby Hull 23 Mario Lemieux 66 POINTS ---------------------------NAME POINTS ---------------Wayne Gretzky 244 Bobby Orr 129 Brett Hull 121 Mario Lemieux 189 Joe Sakic 94 How many rows would be returned using the following statement? SELECT * FROM names, points A.. 0 B. 5 C. 10 D. 25 46. 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 A 47. 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. D 48. 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 49. Given the following table: TAB1 ------------------COL1 COL2 --------A 10 B 20 C 30 A 10 D 40 C 30 Assuming the following results are desired: TAB1 ------------------COL1 COL2 --------A 10 B 20 C 30 D 40 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 B 50. Which of the following programming languages can be used to develop UDFs? A. Java, Javascript, SQL B. C/C++, Java, .Net languages C. SQL, C# .Net, Perl D. Perl, C/C++, SQL C 51. Which of the following is FALSE about views? A. Do not contain real data 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 table D. Can be used interchangeably with tables when retrieving data 52. A Dirty Read occurs when? 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. 53. 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 deta 54. When using a Relational Database, which of the following does NOT apply?

A. B. C. D.

Accesses data using Data Manipulation Language (DML) such as SQL. Define your database schema using a Data Definition Language (DDL). Data is stored in a hierarchical model. You can use normalization to avoid redundant data in your tables.

C 55. 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 DB2INST1.table_1 56. 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. <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. <Name Gender=FEMALE> <FirstName>Jaya</FirstName> <LastName>Patel</LastName> </Name> A 57. 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. D. SQL/XML is an extension to SQL standard and provides various publishing functions to transform XML data into relational form and vice versa C 58. 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 D. USE Which of the following is NOT true about the Information Model? A. Abstract management of objects at a conceptual level. B. Defines relationships between managed objects. C. Group of descriptions explaining objects of a data model. D. Data models can be used to map an Information Model to a software implementation 60. Which of the following is an XML-based language for transforming XML documents? A. XHTML B. XSLT C. HTML D. Java

You might also like