Why is job preparation easier with Wisdomjobs interview questions page? Preparing for a job is now more easy and simple with our interview questions better on wisdom jobs? Because wisdom jobs gives you all information plus all the jobs in one place. When you're interviewing for a new position, you should come prepared to answer the interview questions to win in first attempt. Having expertise in Database concepts will place you a good career. DB2 SQL Programming is the query language used to query the DB2. Sql (Structured Query Language) is a language for defining and to manipulate the data in RDBMS using queries. Look into the below DB2 SQL Programming interview questions and answers page for quick win in job hunt.
Answer :
DB2 is a Database Management System for the MVS Operating System where, DB2 is a subsystem of MVS Operating System.
Question 2. What Is The Purpose Of Using Commit?
Answer :
The data changes can be made permanent by using COMMIT. It also permits data to be accessed by other applications who can reference the committed data.
Question 3. List Out The Data Types Available?
Answer :
The Data types available here are:
Question 4. What Are The Uses Of Db2 Optimizer?
Answer :
Answer :
SQL Communication Area is a structure of variables, which are updated after every execution of SQL statements. For an application that contains executable SQL statements, only one SQLCA is needed. FORTRAN need more than one SQLCA to be provided .For Java, SQLCA is not applicable.
Question 6. Define Check Constraint?
Answer :
It is specified as a condition or criteria to ensure data integrity. A value to be inserted or updated to a table is tested by CHECK constraint. The CHECK constraints are created during the creation of the table.
Question 7. What Is Sqlca’s Maximum Length?
Answer :
136 is the maximum length of the SQLCA.
Question 8. Discuss About Db2 Bind?
Answer :
The process that builds access paths to the DB2 table is known as bind. The bind uses Database Request Modules from the DB2 pre-compile step as input and produces an application plan. It checks for user authentication and validates SQL statements in the DBRM(s).
Question 9. List Out The Three Types Of Page Locks That Can Be Held?
Answer :
Question 10. Define Buffer Pool?
Answer :
The buffer pool is a reserved main storage, which is to satisfy the buffering requirements for one or more table spaces or indexes. It can be made up of either 4K or 32K pages.
Question 11. Explain The Function Of Data Manager?
Answer :
The physical database is managed by the DB2 component called Data manager. It invokes other system components to perform logging, locking etc.
Question 12. What Is A Storage Group (stogroup)?
Answer :
STOGROUP is a named collection of DASD volumes, which is to be used by index spaces and table spaces of the database.
Question 13. Define Predicate?
Answer :
Predicate is an element of a search condition. It expresses or implies a search condition.
Question 14. Define Declaration Generator (dclgen)?
Answer :
Declaration Generator is a facility that is used to form SQL statements that describes a table or view. At pre-compile time, the table or view descriptions are then used to check the validity of SQL statements.
Question 15. List Out The Buffer Pools In Db2?
Answer :
There are four buffer pools in DB2 and they are:
Question 16. Define Clustering Index?
Answer :
Clustering index is a type of index, which locates the table rows and determines how to group the rows together in the tablespace.
Question 17. What Is Concurrency?
Answer :
More than one DB2 application process can access the same data at the same time, is known as concurrency. However, problems can happen such as, lost updates access to unrepeatable reads and uncommitted data.
Question 18. Explain The Function Done By Data Manager?
Answer :
Data manager can be considered as a component that is capable of managing the databases that are physically present and is capable of invoking other components associated with the system for performing functionalities like logging, locking and in performing other I/O operations.
Question 19. Explain About Dbrm?
Answer :
DBRM stands for Database Request Module and is a component inside DB2, which is created by the pre compiler of DB2. This is a module that consists of SQL source statements that get extracted out of the application program. DBRMs form inputs that are helpful in the binding process.
Question 20. Define Data Page?
Answer :
Data page can be considered as a unit that is capable of retrieving data from the database. The database from which the data can be retrieved is in the form of 4 kilobytes or 32 kilobytes. The form in which data is retrieved depends on the way the table is defined inside the database. Data page also contains information regarding the catalog or user that are part of the database.
Question 21. Explain About Rct?
Answer :
RCT is expanded as Resource – Control Table and is defined in the DB2/CICS region. This is the component that comprises of features that are gathered through macros of DSNCRCT. RCT matches with the transaction ID that of CICS, with the authorization ID that of DB2. This should also be matched with plan ID.
Answer :
Tablespace that you are using is allocated only to STOGROUP, then you can enter the command ALTER STOGROUP for adding as well as deleting volume.
REORG TABLESPACE and RECOVER TABLESPACE are statements that are helpful in creating new STOGROUP that can point towards the new volume.
ALTER tablespace and REORG and RECOVER are statements used for altering and recovering the tablespace allocated in the memory.
Question 23. What Is The Information Associated With Sysibm.syslinks Table?
Answer :
This is the table that contains information on the links that exists between the tables created through referential constraints.
Question 24. Explain In Detail About Buffer Manager And Its Functionalities?
Answer :
Buffer manager can be considered as the component inside DB2 that helps in transferring data between virtual as well as external medium. The buffer manager reduces the quantity of physical input as well as output operations that are actually performed by making use of buffering techniques that are highly sophisticated.
Question 25. Explain About Cursor Stability?
Answer :
Cursor stability is the property that tells the DB2 that the values of database that are read by making use of this application gets protected while the data is used.
Answer :
There are primarily three reasons why SELECT* is never given preference in an embedded SQL program. These are:–
Question 27. Explain Correlated Sub-queries?
Answer :
Correlated sub-queries are those queries wherein the nester query on the inner side refers directly back to outer query’s table. For each and every row that is qualified, the evaluation of correlated sub-query is a must.
Question 28. Comment Whether The Cursor Is Closed During Commit Or Not.?
Answer :
Yes. The cursor is closed during COMMIT.
Answer :
Either you can use SELECT statements of single rows or an alternative way is to use CURSOR.
Question 30. Mention The Way Of Highlighting As Well As Putting A Cursor To Use In A Cobol Program.?
Answer :
The best way of putting a CURSOR to use in a COBOL program is to make use of DECLARE CURSOR, which can be used either in procedure division operation or in working storage. This is being done basically to highlight the SELECT statement. Once DECLARE CURSOR is used, this is followed by OPEN, FETCH and finally CLOSE.
Answer :
Inside DECLARE CURSOR, there is a WITH HOLD option, which will come useful in this case. Although, one should note the point that WITH HOLD function has absolutely no effect if considered for CICS pseudo-conventional programs.
Question 32. Explain Packages?
Answer :
PACKAGES are units, which consist of executable codes that are meant for SQL statements for one respective DBRM.
Question 33. Highlight All The Advantages That Are Attached To A Package?
Answer :
Following are the advantages attached to a PACKAGE.
Answer :
PIC S9 (9) V99 COMP – 3
In the expression DECIMAL (11, 2) 2 happens to be the precision whereas 11 is the data type size.
Answer :
DCLGEN basically refers to DeCLarations GENerator whose primary purpose is to generate copy books of the host language for the tables. It is also used to create the DECLARE table.
Question 36. Mention Some Fields That Are A Part Of Sqlca?
Answer :
SQLERRM, SQLCODE, SQLERRD.
Question 37. Explain The Contents That Are A Part Of Dclgen?
Answer :
There are primarily two components of DCLGEN. These are:
Question 38. Comment Whether Dclgen Is Mandatorily Used. If Not, Then What Is The Point Of Using It?
Answer :
It is not exactly mandatory to bring DCLGEN into use. The primary use of DCLGEN comes during the pre-compilation phase where it helps in detecting the misspelt column names. Since DCLGEN is just a tool, it will only generate variable definitions for the host and reduces the chances of errors.
Answer :
Even if DB2 is down at some point of time, even then it will not impact the pre-compilation process of DB2-COBOL program. The reason for the same is that the pre-compiler never refers to the catalogue tables of DB2.
Answer :
All you have to do is check the value that has been stored in SQLERRD (3).
Question 41. What Is Meant By Explain?
Answer :
EXPLAIN is basically used to show the path of access by the optimizer basically for an SQL statement. Furthermore, EXPLAIN can also be brought to use in SPUFI or even in BIND step.
Question 42. Before You Give The Explain Statement, What Are The Prerogatives?
Answer :
Before giving the EXPLAIN statement, we need to make sure that PLAN_TABLE has already been created under AUTHID.
Question 43. Mention The Location Where The Output Received From Explain Statement Is Stored?
Answer :
The output from EXPLAIN is stored in userid.PLAN_TABLE
Question 44. Outputs Of Explain Are With Matchcols = 0. What Does This Signify?
Answer :
This signifies a non-matching scan of index provided that ACCESSTYPE = I
Question 45. Mention The Various Locks That Are Available In Db2?
Answer :
EXCLUSIVE, SHARE and UPDATE
Question 46. What Is Release/acquire In Bind?
Answer :
There is a certain point in a program at which DB2 acquires or perhaps releases the locks against tables as well as table-spaces. These include intent locks.
Question 47. Mention The Different Locking Levels That Are Available In Db2?
Answer :
TABLE, PAGE and TABLESPACE
Question 48. Mention The Downsides Of Page Level Lock?
Answer :
In case if there are large updates to be done, then the resource utilization is high accordingly.
DB2 SQL Programming Related Tutorials |
|
---|---|
IBM DB2 Tutorial | COBOL Tutorial |
MySQL Tutorial | DB2 Using SQL Tutorial |
IBM Mainframe Tutorial | IMS/DB Tutorial |
Db2 Sql Programming Practice Test
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.