Escolar Documentos
Profissional Documentos
Cultura Documentos
Cognizant Academy
DB2 <Pre-Test/ Post-Test> Module Name Topics Covered Database & RDBMS concepts DB2 Overview DB2 objects and Data types Introduction to SQL INTRODUCTION TO DB2 Tools - QMF and SPUFI SQL - DDL SQL - DCL SQL - DML (Simple Select) Functions Sorting & Grouping records QUERYING DATABASE AND Joins & Subqueries OTHER DB2 OBJECTS Correlated Subquery & Union SQL - DML (Update & Delete) Indexes View, Alias & Synonyms Coding the Application Pre-compilation Compiling & Linking Binding APPLICATION PROGRAMMING Execution Application Development Guidelines DB2 Utilities DB2 Security, Catalog Tables and Optimizer
Q. No Question
3 Entity-Relationship model is a logical representation of 4 The row that contains an entry for each attribute is called 5 The value of Null is
6 DB2 is a
11 Hierarchical Database handles Column or combination of columns which has unique values but not selected as primary key and is not 12 part of primary key is 13 Column of a table used to establish relationship with other table and present itself in all the tables is 14 How many normalization are possible?
15 Normalization is done to remove Every foreign key in the first table must either match a primary key in the second table or wholly null is
16 called
17 Rule that states no column that is part of primary key can have a null value is
The Subsystem which controls connections to other MVS subsystems and handles system start-up, 23 shutdown and operator communication is
24 The sub components which does the definition, retrieval and update of DB2 data
25 Part of MVS subsystem and general purpose lock manager that aids in Data integrity
27 When the Program executes first time the control goes to the This component does all the operations such as search, retrieval, update index maintenance and
28 Physical database
29 Component responsible for the physical transfer of data between external storage and Virtual Memory
33 Database is a collection of
39 A Simple tablespace
41 Segmented tablespace
49 SQL is composed of 50 Which of the following is a example of DDL 51 Which of the following is a example of DCL 52 Which of the following is a example of DML 53 Foreign key constraints are specified using
57 What happens when a column is omitted in the INSERT statement and the Column is not NULL?
58 Single row select is possible using which one of the following in the WHERE clause
59 Multi row select is possible using which one of the following in the WHERE clause
60 Which of the Clauses can be used in conjunction with WHERE clause?
"SELECT * FROM EMP WHERE EMPNO BETWEEN '150' AND '200'". Above query selects 61 employees with EMPNO
"SELECT * FROM EMP WHERE EMPNO IN ('150' , '200')". Above query selects employees with
62 EMPNO
63 Which of the following special characters are used along with LIKE clause
75 The difference between Having and Where clause For one or more tables being joined, both matching and non matching rows are returned. This type of
76 join is called
77 All rows from the 1rst table plus matching rows in the 2nd table are retrieved in
78 All rows from the 2nd table plus matching rows in the 1st table are retrieved in
80 The inner query can return more than one value when the outer query uses
82 The nested select statement refers back to the columns in Previous Select statements in
85 UNION can be replaced by following logical operator if the selects are from only one table
86 For selecting data from multiples tables the following is used
It combines 2 sets of rows into a single set composed of all the rows in either or both of original sets 87 without duplicates
88 Which one of the following is the Index parameters?
89 This command is used to give another name for the table, which is private to the uses who created it
90 It is the local name provided for the remote tables.
91 In Dynamic SQL
92 Host variables is a 93 Host variables are used in embedded SQL prefixed wih 94 Which of the following is used to produce Host variables
100 SQLCA is
102 SQLCODE = 0 is
109 Indicator variable < 0 indicates 110 Failure to code or check null values gives SQLCODE
Following command is used to return data from result table one row at a time and assigns the value to 115 Host variable
116 This command releases all the resources used by the cursor
117 The cursor should be defined with which of the following clause for Updation?
118 Update cursors cannot be used if Select statement contains
119 Following command registers the current unit of work The SQL statements and DB2 related INCLUDE members are commented out and it is replaced by
120 CALL statement in
121 DBRM is created afterbetween the Timestamp in modified source code and DBRM, it gives runtime If there is a mismatch 122 error of
127 Package is
131 The Page lock is released as soon as another page is accessed in which of the following Isolation?
132 All page locks are released only when COMMIT is executed in which of following Isolation
Retrieved row or page is locked until the end of Unit of work. No other program can modify the data 133 but new rows can be inserted. This type of locking is called
134 These parameters specifies when to Acquire and Release Tablespace locks
135 Which of the following Acquire and Release parameter is most preferred for DB2 batch program?
136 VALIDATE parameter refers to the method of checking 137 Which one of the following is NOT a Binding parameter?
140 The Integrity of DB2 data structures are checked using which of the DB2 utility?
Every successful execution of COPY utility places atlease one row that indicates the status of Image 143 copy, in which table?
144 The Utility to restore the Db2 Tablespaces and indexes to a specific instance is
145 The bulk inserts into DB2 table are accomplished using this Utility.
This utility is used to collect statistical information about DB2 tables, tablespaces, partitions, indexes 147 and columns Using this utility, we can obtain the details of the access path chosen by Db2 optimizer for SQL 148 statements When EXPLAIN is requested, the access path that DB2 chooses are put in coded format into the 149 following table
151 Locking services are provided by which of the MVS subsystem 152 Db2 contains how many catalogued tables?
153 Optimizer
Optimizer gets the information pertaining to the state of tables that will be accessed by SQL 155 statements from
Option 1
Correct Answer
Child Tables It supports were many to allowed to many have more relationshi than one ps parent Composite Alternate Key Key Tables Data Tuple Domain
Represent ed in terms of Entities A single and table acts attributes as a root Primary Key Records Entity Foreign Key Entities Relation None of the above None of the above
option 3
Zero Unknown Space Relational Hierarchic database al Network As a set of Group of tables records Data redundanc Single y View
Data Concurren dependen option 1 & option cy cy option 3 Child may only have one parent but a parent can have multiple option 1 & option children 2 None of the above option 2
Child tables were allowed to have more than one parent Network
1-M M-1 M-M 1-1 relationshi Relationsh Relationsh Relationsh p ip ip ip Foreign Composite Unique Alternate Key Key Key Key Composite Unique Foreign Alternate Key Key Key Key 3 5 4 2
Partial Multi functional Transitive valued dependen dependen dependen All of the cies cies cies above Entity integrity Entity integrity Entity integrity Data manager System service. System services Tablespac e Referential Domain Integrity integrity Referential Domain Integrity integrity Referential Domain Integrity integrity Buffer manager Locking service Database services Database services None of the above None of the above None of the above
option 4
option 2
option 1
option 3 option 3
Distributed data facility option 2 Data option 1 & option manager 2 Storage Group option 4 Distributed data facility Distributed data facility
option 3
option 2
Runtime Database Buffer supervisor manager manager IMS Resource Lock Manager Inter Resource Location Manager Inter resource Locking Manager File manager File manager File manager
IRLM
option 4
option 1
Runtime Buffer supervisor Manager Runtime Data supervisor manager DiskMana Buffer ger manager accessible by SQL statement s
option 1
option 2
option 2
not accessible accessible by by SQL application statement None of program s the above
option 1
STOGRO UP, RECORD S, TABLESP None of ACES the above Tables BUFFERP OOL, TABLESP ACES Entities STOGRO UP, BUFFERP OOL
option 1 option 3
option 4
More than More than one disk one disk space and space but disk disk spaces spaces need not should be be in in same same only one STOGRO STOGRO disk space UP UP Indexspac Tablespac e Dataspace e Multiple 1 table only Segmente d Simple 2 table only
option 3
Decreases Increases the the Increases Decreases Concurren Concurren Redundan redundanc cy cy cy y Rows from Rows from Rows from only 1 only 2 many None of table tables tables the above Decreases the Increases Concurren Redundan cy cy Small tables Increases the Decreases Concurren redundanc cy y
option 1
option 1
option 3
option 2
PAGE
All of the above INDEX None of the above None of the above
LOCKSIZ E PCTFREE ERASE Records Record Active set View Page Byte
It allows end users to enter SQL Used for queries to developer produce a s to check variety of SQL reports It is an statement and MVS- and s or view graphs as VM- based table a result of query tool details this query Embedde Query d SQL SPUFI Manager
It supports the online execution of SQL statement s from a TSO option 1 & option terminal 3 All of the above option 2 All of the DDL DCL DML above option 4 option 2 & option GRANT ALTER REVOKE CREATE 4 REVOKE UPDATE DROP DELETE option 1 CREATE GRANT DELETE DROP option 3 None of DCL DDL DML the above option 2 Primary and Foreign key cannot change the width of a column Grant & Drop Space is inserted Primary Key Primary Key IN >150 & <=200
Primary key
Foreign key
option 3
can can change change the width datatype of a of the column column Privilege & Grant & Revoke Revoke INSERT Zero is fails inserted Foreign Alternate Key Key Foreign Alternate Key Key BETWEE N IS NULL > 150 & < >=150 & 200 <=200
cannot change datatype of the option 3 & option column 4 None of the above option 2 None of the above option 1 Option 1 & option 2 & option 3 3 Option 1 & 2 option 1 All of the above option 4 >=150 & <200 option 2
in the range 150 150 & 200 to 200 * NULL values only
in the range 151 None of to 199 the above option 3 & option option 1 % _ 4
All of the above All of the Aggregate Scalar Arithmetic above TIMESTA AVG DECIMAL HEX MP COUNT LENGTH SUM MIN NO DUPLICA TES UNIQUE ORDER GROUP BY BY None of DISTINCT the above ARRANG SORT BY E BY
option 3 option 1
Only Column Only number in Column the Select name can column list be can be specified specified along with along with ORDER ORDER BY BY ORDER GROUP BY BY WHERE WITH clause clause
GROUP BY cannot HAVING is appear used on without aggregate HAVING d data clause
option 2
GROUP BY cannot be used if there is no aggregate function in Select list Having is used on aggregate data and Where is used on column
GROUP BY cannot be used if the column on which grouping is done, is not in Select list Having is used on column and Where is used on aggregate d data
No other Table column apart from Grouping column can appear in the Select All of the list above
option 4
option 1
Right All of the Inner Join Outer join Outer Join above Left outer Right Full Outer join Outer Join Inner Join join Left outer Right Full Outer join Outer Join Inner Join join Left outer Right Full Outer join Outer Join Inner Join join NonComparati Equality equality ve None of operators operators operators the above Noncorrelated Correlated Option 1 & None of subquery subquery 2 the above Noncorrelated Correlated Option 1 & None of subquery subquery 2 the above there is a need to check only the existence of matching criteria
option 2
option 1
option 2
option 3
option 4
option 1
option 2
Column value returned by nested query do Option 1 & None of not matter 2 the above
option 3
Each column of the first result set must be either same data type as The two correspon result set ding should column in contain the It retrieves same no. second or distinct All of the columns convertible record above None of AND OR NOT the above UNION All of the UNION JOIN ALL above UNION None of UNION ALL JOIN the above FREEPAG All of the CLUSTER ERASE E above SYNONY None of M ALIAS VIEWS the above SYNONY None of M ALIAS VIEWS the above Statement s can Access Hard change Path is not coded in throughout determine the the d before application program Option 1 & execution program execution 3 Defined in SQL Columns statement in Table s : DCLGEN QMF INTO clause of SELECT input of SET clause of UPDATE Single table in the Column list of SELECT input of VALUES clause of INSERT Multiple table Working Storage variable ^ SPUFI in the WHERE clause of SELECT INTO clause of FETCH Single view
option 4
Option 1&3
option 4
option 4 option 1
Host structure
Host variable
option 4
COPY INCLUDE ADD None of statement statement Statement the above DB2 Contains Communic Host ation area variables after each after the SQL execution statement of program execution
option 2
Executabl None of e SQL the above after each update statement execution after each insert statement execution
option 1
option 2
Successful execution Execution with was not Successful Data not warning successful execution found Successful execution Execution with was not Successful Data not warning successful execution found Successful execution Execution with was not Successful Data not warning successful execution found Successful execution Execution with was not warning successful SQLWAR SQLCOD N E
option 3
option 4
option 1
option 2 option 4
Checking successful Checking completion how many Checking of SQL records null values statement updated Numeric variable Alphanum eric COMP variable variable
option 1
option 3
Valid Null value Spaces value is is are Zero is retrieved retrieved retrieved retrieved -305 -811 -805 -818 Column Row level Set level level None of processing processing processing the above DECLARE DEFINE InputProcedure Output division section InputOutput section Get Working Storage Section Fetch OPEN Working Storage Section File section Retrieve ASSIGN File section Procedure division Select
option 2 option 1
option 2 option 1
option 3
Close Release Where current of Set ORDER BY UNION Rollback Linking Step Commit
Deallocate Free For None of update of the above All of the JOIN above None of Update the above
option 3
Precompil Compilatio Binding Linking ation step n step step Step -913 -805 -818 -811 Object module Applicatio n Plan Modified source code Load module None of the above None of the above
option 1 option 3
option 2 option 1
option 4
Access Path
option 2
option 3
Remote data access is Increases Versioning not None of Bind time is possible possible the above Mode of creating How to Mode of the use the Page application DB2 locking Plan resource Cursor Repeatabl Read Stability e Read Stability Repeatabl Read Cursor e Read Stability Stability Read Repeatabl Cursor Stability e Read Stability Read Repeatabl Cursor Stability e Read Stability ACQUIRE AND RELEASE parameter s ACQUIRE AND VALIDATE parameter s ACTION How the rows should be retrieved All of the above Uncommit ed Read Uncommit ed Read Uncommit ed Read
option 2
option 1
ALLOCAT USE & ALLOCAT E& DEALLOC E & USE & DEALLOC ATE COMMIT COMMIT ATE Existence of the Validity of table table FLAG AUTHID Plan & Object module CHECK Plan & Load module RECOVE R DB2 access authorizati All of the on above DEGREE ACTION DBRM & Load module LOAD Only load module All of the above
option 3
option 4 option 2
option 2 option 4
EXPLAIN
option 3
Delete invalid rows and Referential copies integrity Consisten them to between cy of DB2 exception All of the two tables indexes table above RECOVE COPY LOAD REORG R SYSIBM.S SYSIBM.S YSPROC SYSIBM.S YSROUTI EDURES YSCOPY NES RECOVE RESTORE REORG R COPY LOAD INSERT SYSIBM.S YSUTILITI ES LOAD None of the above
option 4 option 1
LOAD utility The table automatic space ally takes needs to care of be Restoratio reorganize n of table d space RUNSTAT RECOVE S R
EXPLAIN CHECK
SYSPRO CEDURE PLAN_TA SYSTABL S BLE ES SYSPLAN Type of access of particular tables Order in which Whether tables are SORT is joined required
option 2
option 4
Buffer manager 48 38
option 3 option 1
determine s most efficient optimizes way to the SQL access code data
estimates the cost of physically retrieving and writing None of option 2 & option the data the above 3 Db2 catalog statistics All of the above
option 4
IRLM
option 3
Category Application Knowledge + Difficult Comprehension + Difficult Comprehension + Average Others Knowledge Average Marks Qs 1 1 1 1 1 1 7(5) Comprehension Easy Average Marks Qs Marks Qs 0 2 1 0 2 1 0 0 13(5)
T1 T2 T3 Total
Difficult Marks Qs 2 1 2 1
18
Weigtage 3 2 3 2 1 Application Easy Average Marks Qs Marks Qs 0 0 0 3 1 0 0 6(2) Application Average Marks Qs 0 3 1 3 1 6(2)
Difficult Marks Qs 3 1 3 1 3 1
Difficult Marks Qs 0 0 3 1
Easy Marks Qs 0 0 0
Total Marks
50(20)