YouTube Icon

Interview Questions.

Top DB2 Interview Questions and Answers - Dec 30, 2020

fluid

Top DB2 Interview Questions and Answers

This DB2 Interview Questions blog has a rundown of all the main DB2 addresses that you may experience during the meeting. Here, you will go over both essential and progressed level ideas and questions identified with these ideas. Also, from this DB2 Interview Questions blog, you will improve information and comprehension of DB2. In this way, dominate in your profession by setting up the accompanying DB2 inquiries questions: 

Q1. How to locate the quantity of lines in a DB2 table? 

Q2. In what capacity can the copy esteems be wiped out from DB2 SELECT? 

Q3. What is Aggregate? 

Q4. Is it conceivable utilizing MAX on a CHAR section? 

Q5. Why SELECT isn't favored in Embedded SQL programs? 

Q6. When is the LIKE explanation utilized? 

Q7. How is the worth capacity utilized? 

Q8. What are UNION and UNION ALL? 

Q9. Is there any limitation on the utilization of UNION in Embedded SQL? 

Q10. I'm not catching your meaning by BETWEEN and IN? Is BETWEEN comprehensive of indicated range esteems? 

1. How to locate the quantity of columns in a DB2 table? 

To locate the quantity of columns in a DB2 table, the client needs to utilize SELECT COUNT (*) on the DB2 inquiry. 

2. By what means can the copy esteems be wiped out from DB2 SELECT? 

To dispense with the copy esteems from DB2 SELECT, the client needs to utilize SELECT DISTINCT in the DB2 question. 

3. What is Aggregate? 

'Total' capacities are inherent numerical apparatuses that are utilized in the DB2 SELECT provision. 

4. Is it conceivable utilizing MAX on a CHAR section? 

Truly! It is conceivable utilizing MAX on a CHAR segment. 

5. Why SELECT isn't favored in Embedded SQL programs? 

SELECT isn't favored in Embedded SQL programs for three reasons. To start with, if the table structure is changed by the expansion or erasure of a field and the program is adjusted, at that point utilizing SELECT may recover the segments that the client may not utilize. This would prompt Input-Output overhead and the odds of file just sweep are additionally dispensed with. 

6. When is the LIKE proclamation utilized? 

The LIKE articulation is utilized to lead incomplete hunts, for example, the inquiry of workers by name. It isn't important to show the total name, fractional string matches would do. 

7. How is the worth capacity utilized? 

We can perform two assignments utilizing the 'esteem' work: 

To begin with, to evade −ve SQLCODEs by taking care of NULLs and 0s in the calculation 

Second, to substitute numeric qualities for NULLs utilized in the calculation 

8. What are UNION and UNION ALL? 

Both UNION and UNION ALL are utilized to consolidate the outcomes produced by numerous SELECT articulations. 

Association is the capacity that kills copies in the table 

Association ALL holds the copies 

9. Is there any limitation on the utilization of UNION in Embedded SQL? 

While utilizing UNION in Embedded SQL, it must be in a CURSOR. 

10. I'm not catching your meaning by BETWEEN and IN? Is BETWEEN comprehensive of determined reach esteems? 

BETWEEN would supply a scope of qualities, though IN would give a rundown of qualities. BETWEEN is consistently comprehensive of the reach esteems determined. 

11. In what capacity can the FIRSTNAME and the LASTNAME from the EMP table be connected to produce total names? 

The following is the explanation that can be utilized to connect the first and last names to show complete names: 

FIRSTNAME II ** II LASTNAME FROM EMP

12. What could be the explanation that the MySQL articulation 'SELECT AVG (SALARY) FROM EMP' creates an erroneous yield? 

The explanation behind the assertion producing a mistaken result is that SALARY has not been announced to have NULL qualities and, simultaneously, the workers whose compensation isn't known are likewise checked. 

13. What is a CURSOR and what is its utilization? 

A CURSOR is a programming gadget that helps the SELECT proclamation discover a bunch of columns yet shows them each in turn. This is on the grounds that the host language can manage just each line in turn. 

14. How to recover columns from a DB2 table in Embedded SQL? 

Lines from a DB2 table in Embedded SQL can be recovered utilizing the single-column SELECT explanation. Another path is by utilizing the CURSOR explanation. Be that as it may, the principal cycle is the favored one. 

15. What is the aftereffect of the OPEN CURSOR proclamation? 

In the straightforward OPEN CURSOR explanation, the CURSOR is set on the primary column of a table. Then again, when the ORDER BY provision is added, columns would be brought, arranged, and would be accessible for the FETCH articulation. 

16. Could there be more than one cursor open for any program? 

Indeed! The client can have more than one cursor open for any program. 

17. How might the VARCHAR segment REMARKS be characterized? 

The VARCHAR segment REMARKS would be characterized as follows: 

10 REMARKS 

49 REMARKS-LEN PIC S9(4) USAGE COMP 

49 REMARKS-TEXT PIC X(1920) 

18. What is the actual stockpiling length of every one of the information types, DATE, TIME, and TIMESTAMP? 

The actual stockpiling length of DATE is 4 bytes, TIME is 3 bytes, and TIMESTAMP is 10 bytes. 

19. What is implied by DCLGEN? 

DCLGEN alludes to Declaration Generator that is utilized to make the host language duplicate books for the table definitions. It additionally makes the DECLARE table. 

20. What are the substance of DCLGEN? 

DCLGEN has the EXEC SQL DECLARE TABLE proclamation that gives the format of a table/see as far as DB2 information types. It can likewise be characterized as the host language duplicate book giving the host variable definitions for section names. 

21. What are a portion of the fundamental fields in SQLCA? 

Significant fields in SQLCA are SQLCODE, SQLERRM, and SQLERRD. 

22. What is implied by EXPLAIN? 

Clarify is utilized for showing the entrance way as controlled by the enhancer for SQL explanations. It can likewise be utilized on account of SPUFI for single SQL explanations or in the Sticky situation venture for Embedded SQL. 

23. How to perform EXPLAIN for any Dynamic SQL proclamation? 

Clients can utilize SPUFI or QMF proclamations to perform EXPLAIN for Dynamic SQL explanations. They can likewise incorporate the EXPLAIN order in the Embedded Dynamic SQL explanations. 

24. What are the seclusion levels conceivable? 

Two disconnection levels are conceivable: One is Cursor Stability and the other is Repeatable Read indicated as CS and RR, separately. 

25. What is the distinction among CS and RR confinement levels? 

CS would deliver the lock on the page after its utilization. RR would hold all the locks procured till the finish of an exchange. 

26. What is implied by Lock Escalation? 

Lock acceleration is the way toward elevating page lock sizes to table or table space lock size when the exchange has gained a bigger number of locks than the ones determined in NUMLKTS. Locks must be taken on articles in a solitary table space for accelerations to happen. 

27. What are the different sorts of Locks? 

There are three unique kinds of locks: SHARE, EXCLUSIVE, and UPDATE. 

28. What is ALTER? 

Modify is the SQL order used to change the meaning of DB2 objects. 

29. What do you comprehend by DBRM and PLAN? 

DBRM means Database Request Module. It has the SQL proclamations that are extricated from the host language program got by the pre-compiler. 

PLAN is the consequence of the BIND cycle and has executable code for SQL explanations in DBRM. 

30. What is implied by ACQUIRE/RELEASE stuck Tough situation? 

Obtain/RELEASE in Scrape decides where DB2 either procures or delivers locks against the table and the table spaces. This incorporates the aim locks. 

31. What is implied by PACKAGES? 

Bundles contain executable codes for SQL proclamations in regard of one DBRM. 

32. What are the upsides of utilizing PACKAGES? 

At the point when utilized, PACKAGES help try not to tie of enormous quantities of DBRM individuals in a single arrangement. They additionally get rid of the expense of enormous BIND and dodge the whole exchanges making them inaccessible during BIND and programmed REBIND of the arrangement. Another preferred position is that they limit the fallback complexities when changes bring about a mistake. 

33. What is an assortment? 

An assortment is a client characterized name that functions as the anchor for bundles however has no actual presence. It is utilized for the gathering of bundles. 

34. What is Dynamic SQL? 

Dynamic SQL is the SQL explanation made at the hour of the execution of a program.




CFG