SlideShare a Scribd company logo
4
Most read
6
Most read
8
Most read
由 NordriDesign™ 提供
www.nordridesign.com
www.rekruitin.com
DB2 Interview Questions Part - 1
Page  2
LOGO
1. What is UNION, UNION ALL?
UNION: eliminates duplicates, UNION ALL: retains duplicates . Both
these are used to combine the results of different SELECT statements.
Suppose I have five SQL SELECT statements connected by
UNION/UNION ALL, how many times should I specify UNION to eliminate
the duplicate rows?
2. What is the restriction on using UNION in embedded SQL?
It has to be in a CURSOR.
Page  3
LOGO
3. In the WHERE clause what is BETWEEN and IN?
 BETWEEN supplies a range of values while IN supplies a list of values.
4. What is 'LIKE' used for in WHERE clause? What are the wildcard
characters?
LIKE is used for partial string matches. ‘%’ (for a string of any
character ) and ‘_’ (for any single character ) are the two wild card
characters.
6. Is BETWEEN inclusive of the range values specified?
Yes.
Page  4
LOGO
7. Consider the employee table with column PROJECT nullable. How can
you get a list of employees who are not assigned to any project?
SELECT EMPNO
FROM EMP
WHERE PROJECT IS NULL;
8. What is the result of this query if no rows are selected?
SELECT SUM(SALARY)
FROM EMP
WHERE QUAL=‘MSC’;
NULL
9. How do you retrieve the data from a nullable column?
Use null indicators. Syntax ... INTO :HOSTVAR:NULLIND
Page  5
LOGO
10. How do you insert a record with a nullable column?
To insert a NULL, move -1 to the null indicator
To insert a valid value, move 0 to the null indicator
11. What is RUNSTATS?
A DB2 utility used to collect statistics about the data values in tables
which can be used by the optimizer to decide the access path. It also
collects statistics used for space management. These statistics are stored
in DB2 catalog tables.
Page  6
LOGO
12. Give some example of statistics collected during RUNSTATS?
# of rows in the table
Percent of rows in clustering sequence
# of distinct values of indexed column
# of rows moved to a nearby/farway page due to row length increase
13. What is REORG? When is it used?
REORG reorganizes data on physical storage to reclutser rows,
positioning oveflowed rows in their proper sequence, to reclaim space, to
restore free space. It is used after heavy updates, inserts and delete
activity and after segments of a segmented tablespace have become
fragemented.
Page  7
LOGO
26. Give the COBOL definition of a VARCHAR field.
A VARCHAR column REMARKS would be defined as follows:
10 REMARKS.
49 REMARKS-LEN PIC S9(4) USAGE COMP.
49 REMARKS-TEXT PIC X(1920).
27. What is the physical storage length of each of the following DB2
data types:
DATE, TIME, TIMESTAMP?
DATE: 4bytes
TIME: 3bytes
TIMESTAMP: 10bytes
Page  8
LOGO
31. What are the contents of a DCLGEN?
EXEC SQL DECLARE TABLE statement which gives the layout of the
table/view in terms of DB2 datatypes.
A host language copy book that gives the host variable definitions for the
column names.
32. Is it mandatory to use DCLGEN? If not, why would you use it at
all?
It is not mandatory to use DCLGEN.
Using DCLGEN, helps detect wrongly spelt column names etc. during the
pre-compile stage itself ( because of the DECLARE TABLE ).
DCLGEN being a tool, would generate accurate host variable definitions
for the table reducing chances of error.
Page  9
LOGO
33. How do you specify and use a cursor in a COBOL program?
Use DECLARE CURSOR statement either in working storage or in
procedure division(before open cursor), to specify the SELECT statement.
Then use OPEN, FETCH rows in a loop and finally CLOSE.
34. What happens when you say OPEN CURSOR?
If there is an ORDER BY clause, rows are fetched, sorted and made
available for the FETCH statement. Other wise simply the cursor is placed
on the first row.
Page  10
LOGO
Contact Us :
For more details, Please log on to www.rekruitin.com
Customer Care: 8855041500
Career Guidance : 9823205144
Tech Support : 7758806112
Human Resource: 9823204144
You can also Find us on:
11

More Related Content

What's hot (20)

DOC
Jcl interview questions
ganjigirish
 
PDF
Ibm db2 interview questions and answers
Sweta Singh
 
PPT
Db2
yboren
 
PPTX
Z OS IBM Utilities
kapa rohit
 
PPT
JCL MAINFRAMES
kamaljune
 
PPTX
Job Control Language
kapa rohit
 
PPT
Introduction of ISPF
Anil Bharti
 
PDF
DB2 for z/OS Architecture in Nutshell
Cuneyt Goksu
 
PPTX
Ibm db2
aditi212
 
ODT
Jcl tutor
shivas
 
PPTX
Mainframe JCL Part - 1
janaki ram
 
PDF
ALL ABOUT DB2 DSNZPARM
IBM
 
PPTX
DB2 Basic Commands - UDB
Srinimf-Slides
 
PPT
Database Objects
Salman Memon
 
PPTX
Mainframe jcl exec and dd statements part - 3
janaki ram
 
PPT
CICS basics overview session-1
Srinimf-Slides
 
PPT
2 db2 instance creation
Ravikumar Nandigam
 
PDF
Best practices for DB2 for z/OS log based recovery
Florence Dubois
 
Jcl interview questions
ganjigirish
 
Ibm db2 interview questions and answers
Sweta Singh
 
Db2
yboren
 
Z OS IBM Utilities
kapa rohit
 
JCL MAINFRAMES
kamaljune
 
Job Control Language
kapa rohit
 
Introduction of ISPF
Anil Bharti
 
DB2 for z/OS Architecture in Nutshell
Cuneyt Goksu
 
Ibm db2
aditi212
 
Jcl tutor
shivas
 
Mainframe JCL Part - 1
janaki ram
 
ALL ABOUT DB2 DSNZPARM
IBM
 
DB2 Basic Commands - UDB
Srinimf-Slides
 
Database Objects
Salman Memon
 
Mainframe jcl exec and dd statements part - 3
janaki ram
 
CICS basics overview session-1
Srinimf-Slides
 
2 db2 instance creation
Ravikumar Nandigam
 
Best practices for DB2 for z/OS log based recovery
Florence Dubois
 

Viewers also liked (12)

DOC
online training for IBM DB2 LUW UDB DBA
Ravikumar Nandigam
 
PPT
DB2UDB_the_Basics Day 4
Pranav Prakash
 
PPT
IMSBufferpool Tuning concept AMS presentation v01
Manoj Kaveri
 
DOC
Top 9 db2 interview questions answers
Jobinterviews
 
PPT
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
Ravikumar Nandigam
 
PPTX
Presentation db2 best practices for optimal performance
solarisyougood
 
PDF
Tso and ispf
satish090909
 
PDF
Mvs commands
Maintec Technologies Inc.
 
PDF
Jcl
shivas
 
PPTX
Skillwise JCL
Skillwise Group
 
PDF
Mainframe refresher-part-1
vishwas17
 
PPTX
Understanding DB2 Optimizer
terraborealis
 
online training for IBM DB2 LUW UDB DBA
Ravikumar Nandigam
 
DB2UDB_the_Basics Day 4
Pranav Prakash
 
IMSBufferpool Tuning concept AMS presentation v01
Manoj Kaveri
 
Top 9 db2 interview questions answers
Jobinterviews
 
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
Ravikumar Nandigam
 
Presentation db2 best practices for optimal performance
solarisyougood
 
Tso and ispf
satish090909
 
Jcl
shivas
 
Skillwise JCL
Skillwise Group
 
Mainframe refresher-part-1
vishwas17
 
Understanding DB2 Optimizer
terraborealis
 
Ad

Similar to DB2 Interview Questions - Part 1 (20)

RTF
Db2考试测试题
fm2008
 
PPT
MDI Training DB2 Course
Marcus Davage
 
DOCX
Top MNC'S Interview questions and answers
Madhu Dhare
 
DOCX
Dbms question
Ricky Dky
 
PPTX
PL_SQL - II.pptx
priyaprakash11
 
PDF
Advanced plsql mock_assessment
Saurabh K. Gupta
 
PPTX
STRUCTURE OF SQL QUERIES
VENNILAV6
 
PDF
WORKSHEET SQL SOLVED FOR CLASS XII FINAL
RishuKaul2
 
PDF
Plsql pdf
Jatin Srivastava
 
DOC
Db2 faqs
kapa rohit
 
DOCX
Top 50 oracle interview questions and answers
NIKUL GOYAL
 
PDF
284566820 1 z0-061(1)
panagara
 
PPT
Preparing for BIT – IT2301 Database Management Systems 2001f
Gihan Wikramanayake
 
DOCX
Oracle 11g SQL Overview
Prathap Narayanappa
 
PDF
dbms final.pdf
RaKesh3868
 
PDF
quiz1.pdf
AbhinavKhandelwal16
 
PPTX
Crime record management system project.pptx
shindegls59
 
PDF
Good sql server interview_questions
Mahesh Gupta (DBATAG) - SQL Server Consultant
 
DOC
SQLQueries
karunakar81987
 
PPTX
Spufi
Anil Bharti
 
Db2考试测试题
fm2008
 
MDI Training DB2 Course
Marcus Davage
 
Top MNC'S Interview questions and answers
Madhu Dhare
 
Dbms question
Ricky Dky
 
PL_SQL - II.pptx
priyaprakash11
 
Advanced plsql mock_assessment
Saurabh K. Gupta
 
STRUCTURE OF SQL QUERIES
VENNILAV6
 
WORKSHEET SQL SOLVED FOR CLASS XII FINAL
RishuKaul2
 
Plsql pdf
Jatin Srivastava
 
Db2 faqs
kapa rohit
 
Top 50 oracle interview questions and answers
NIKUL GOYAL
 
284566820 1 z0-061(1)
panagara
 
Preparing for BIT – IT2301 Database Management Systems 2001f
Gihan Wikramanayake
 
Oracle 11g SQL Overview
Prathap Narayanappa
 
dbms final.pdf
RaKesh3868
 
Crime record management system project.pptx
shindegls59
 
Good sql server interview_questions
Mahesh Gupta (DBATAG) - SQL Server Consultant
 
SQLQueries
karunakar81987
 
Ad

More from ReKruiTIn.com (16)

PPTX
Tips On Telephonic Interview Round
ReKruiTIn.com
 
PPTX
What not to Include in your Resume.
ReKruiTIn.com
 
PPTX
Tips for Salary Negotiation
ReKruiTIn.com
 
PPTX
Tips on Group Discussion
ReKruiTIn.com
 
PPTX
Team management
ReKruiTIn.com
 
PPTX
Importance of Cover Letter
ReKruiTIn.com
 
PPTX
Mistakes to avoid in Job Interview
ReKruiTIn.com
 
PPT
C, C++ Interview Questions Part - 1
ReKruiTIn.com
 
PPT
Sap Interview Questions - Part 1
ReKruiTIn.com
 
PPT
Dot Net Interview Questions - Part 1
ReKruiTIn.com
 
PPT
PeopleSoft Interview Questions - Part 1
ReKruiTIn.com
 
PPTX
Resume Writing Skills
ReKruiTIn.com
 
PPT
Interview Process
ReKruiTIn.com
 
PPTX
Recruitment skills
ReKruiTIn.com
 
PPT
Basic Interview Questions
ReKruiTIn.com
 
PPT
Career Development Tips
ReKruiTIn.com
 
Tips On Telephonic Interview Round
ReKruiTIn.com
 
What not to Include in your Resume.
ReKruiTIn.com
 
Tips for Salary Negotiation
ReKruiTIn.com
 
Tips on Group Discussion
ReKruiTIn.com
 
Team management
ReKruiTIn.com
 
Importance of Cover Letter
ReKruiTIn.com
 
Mistakes to avoid in Job Interview
ReKruiTIn.com
 
C, C++ Interview Questions Part - 1
ReKruiTIn.com
 
Sap Interview Questions - Part 1
ReKruiTIn.com
 
Dot Net Interview Questions - Part 1
ReKruiTIn.com
 
PeopleSoft Interview Questions - Part 1
ReKruiTIn.com
 
Resume Writing Skills
ReKruiTIn.com
 
Interview Process
ReKruiTIn.com
 
Recruitment skills
ReKruiTIn.com
 
Basic Interview Questions
ReKruiTIn.com
 
Career Development Tips
ReKruiTIn.com
 

Recently uploaded (20)

PPTX
Plant Growth and Development-Part I, ppt.pptx
7300511143
 
PDF
Convex optimization analysis in todays world scenario.pdf
mahizxy
 
PDF
The Rising Prominence of Podcasts Today
Raj Kumble
 
PPTX
The Future of Sustainable Cities.ppppptx
sahatanmay391
 
PDF
NotificationForTheTeachingPositionsAdvt012025.pdf
sunitsaathi
 
PPTX
Adaptive Leadership Model 2025 – AI-Generated PowerPoint by Presentify.ai
presentifyai
 
PPTX
Student_Support_Services_Presentation.pptx
Muhammad439928
 
PDF
Web Developer Jobs in Jaipur Your Gateway to a Thriving Tech Career in Rajast...
vinay salarite
 
PDF
Find the Latest Government Jobs in One Click – Stay Updated with Daily Notifi...
Reeshna Prajeesh
 
PPTX
原版英国牛津大学毕业证(Oxon毕业证书)如何办理
Taqyea
 
PPTX
Ganesh Mahajan Digital marketing Portfolio.pptx
ganeshmahajan786
 
PPTX
CLASSROOM OFFICERS COMPOSITION FOR THE S.Y. 2025-2026
JuffyMastelero
 
PDF
Buy Twitter Accounts_ Boost Your Brand and Reach in 2025 - Copy - Copy.pdf
Buy Old Twitter Accounts-100% Secure Aged With Followers
 
PPTX
A Guide for a Winning Interview July 2025
Bruce Bennett
 
PDF
Smarter Private Job Search Starts with Formwalaa
Reeshna Prajeesh
 
PDF
165. Reviewer Certificate in Physical Science
Manu Mitra
 
PPTX
5G Model Site PPT WBA179_ROB_Ghorai (1).pptx
kousikmaity15
 
PPTX
Using the translanguaging to enhance RES
ssuserb7fdac
 
PPTX
Learn AI in Software Testing - Venkatesh (Rahul Shetty)
Venkatesh (Rahul Shetty)
 
DOCX
PMCF -Performance Monitoring and Coaching Form
ROSALIESOMBILON
 
Plant Growth and Development-Part I, ppt.pptx
7300511143
 
Convex optimization analysis in todays world scenario.pdf
mahizxy
 
The Rising Prominence of Podcasts Today
Raj Kumble
 
The Future of Sustainable Cities.ppppptx
sahatanmay391
 
NotificationForTheTeachingPositionsAdvt012025.pdf
sunitsaathi
 
Adaptive Leadership Model 2025 – AI-Generated PowerPoint by Presentify.ai
presentifyai
 
Student_Support_Services_Presentation.pptx
Muhammad439928
 
Web Developer Jobs in Jaipur Your Gateway to a Thriving Tech Career in Rajast...
vinay salarite
 
Find the Latest Government Jobs in One Click – Stay Updated with Daily Notifi...
Reeshna Prajeesh
 
原版英国牛津大学毕业证(Oxon毕业证书)如何办理
Taqyea
 
Ganesh Mahajan Digital marketing Portfolio.pptx
ganeshmahajan786
 
CLASSROOM OFFICERS COMPOSITION FOR THE S.Y. 2025-2026
JuffyMastelero
 
Buy Twitter Accounts_ Boost Your Brand and Reach in 2025 - Copy - Copy.pdf
Buy Old Twitter Accounts-100% Secure Aged With Followers
 
A Guide for a Winning Interview July 2025
Bruce Bennett
 
Smarter Private Job Search Starts with Formwalaa
Reeshna Prajeesh
 
165. Reviewer Certificate in Physical Science
Manu Mitra
 
5G Model Site PPT WBA179_ROB_Ghorai (1).pptx
kousikmaity15
 
Using the translanguaging to enhance RES
ssuserb7fdac
 
Learn AI in Software Testing - Venkatesh (Rahul Shetty)
Venkatesh (Rahul Shetty)
 
PMCF -Performance Monitoring and Coaching Form
ROSALIESOMBILON
 

DB2 Interview Questions - Part 1

  • 2. Page  2 LOGO 1. What is UNION, UNION ALL? UNION: eliminates duplicates, UNION ALL: retains duplicates . Both these are used to combine the results of different SELECT statements. Suppose I have five SQL SELECT statements connected by UNION/UNION ALL, how many times should I specify UNION to eliminate the duplicate rows? 2. What is the restriction on using UNION in embedded SQL? It has to be in a CURSOR.
  • 3. Page  3 LOGO 3. In the WHERE clause what is BETWEEN and IN?  BETWEEN supplies a range of values while IN supplies a list of values. 4. What is 'LIKE' used for in WHERE clause? What are the wildcard characters? LIKE is used for partial string matches. ‘%’ (for a string of any character ) and ‘_’ (for any single character ) are the two wild card characters. 6. Is BETWEEN inclusive of the range values specified? Yes.
  • 4. Page  4 LOGO 7. Consider the employee table with column PROJECT nullable. How can you get a list of employees who are not assigned to any project? SELECT EMPNO FROM EMP WHERE PROJECT IS NULL; 8. What is the result of this query if no rows are selected? SELECT SUM(SALARY) FROM EMP WHERE QUAL=‘MSC’; NULL 9. How do you retrieve the data from a nullable column? Use null indicators. Syntax ... INTO :HOSTVAR:NULLIND
  • 5. Page  5 LOGO 10. How do you insert a record with a nullable column? To insert a NULL, move -1 to the null indicator To insert a valid value, move 0 to the null indicator 11. What is RUNSTATS? A DB2 utility used to collect statistics about the data values in tables which can be used by the optimizer to decide the access path. It also collects statistics used for space management. These statistics are stored in DB2 catalog tables.
  • 6. Page  6 LOGO 12. Give some example of statistics collected during RUNSTATS? # of rows in the table Percent of rows in clustering sequence # of distinct values of indexed column # of rows moved to a nearby/farway page due to row length increase 13. What is REORG? When is it used? REORG reorganizes data on physical storage to reclutser rows, positioning oveflowed rows in their proper sequence, to reclaim space, to restore free space. It is used after heavy updates, inserts and delete activity and after segments of a segmented tablespace have become fragemented.
  • 7. Page  7 LOGO 26. Give the COBOL definition of a VARCHAR field. A VARCHAR column REMARKS would be defined as follows: 10 REMARKS. 49 REMARKS-LEN PIC S9(4) USAGE COMP. 49 REMARKS-TEXT PIC X(1920). 27. What is the physical storage length of each of the following DB2 data types: DATE, TIME, TIMESTAMP? DATE: 4bytes TIME: 3bytes TIMESTAMP: 10bytes
  • 8. Page  8 LOGO 31. What are the contents of a DCLGEN? EXEC SQL DECLARE TABLE statement which gives the layout of the table/view in terms of DB2 datatypes. A host language copy book that gives the host variable definitions for the column names. 32. Is it mandatory to use DCLGEN? If not, why would you use it at all? It is not mandatory to use DCLGEN. Using DCLGEN, helps detect wrongly spelt column names etc. during the pre-compile stage itself ( because of the DECLARE TABLE ). DCLGEN being a tool, would generate accurate host variable definitions for the table reducing chances of error.
  • 9. Page  9 LOGO 33. How do you specify and use a cursor in a COBOL program? Use DECLARE CURSOR statement either in working storage or in procedure division(before open cursor), to specify the SELECT statement. Then use OPEN, FETCH rows in a loop and finally CLOSE. 34. What happens when you say OPEN CURSOR? If there is an ORDER BY clause, rows are fetched, sorted and made available for the FETCH statement. Other wise simply the cursor is placed on the first row.
  • 10. Page  10 LOGO Contact Us : For more details, Please log on to www.rekruitin.com Customer Care: 8855041500 Career Guidance : 9823205144 Tech Support : 7758806112 Human Resource: 9823204144 You can also Find us on:
  • 11. 11