Question: What are the max. & min. no. of partitions allowed in a partition tablespace?
Answer : minimum is 4.maximum is 64.

Question: What is the maximum number of tables that can be joined ?

Question: What technique is used to retrieve data from more than one table in a single SQL statement?
Answer : The Join statement combines data from more that two tables

Question: What is a foreign key?
Answer : It identifies a releated row in another table and establishes a logical relationship between rows in two tables.

Question: Explain the use of the WHERE clause.

Answer : It directs DB2 to extract data from rows where the value of the column is the same as the current value of the host variable.

How would you find out the total number of rows in a table?

How do you eliminate duplicate values in SELECT?

How do you select a row using indexes?

Answer : Specify the indexed columns in the WHERE clause

What are aggregate functions?

Answer : Built-in mathematical functions for use in SELECT clause

How do you find the maximum value in a column?

Can you use MAX on a CHAR column?

My SQL statement SELECT AVG(SALARY) FROM EMP yields inaccurate results Why?
Answer : Because SALARY is not declared to have NULLs and the employees for whom the salary is not known are also counted

How do you retrieve the first 5 characters of FIRSTNAME column of EMP table?

Answer : SELECT SUBSTR(FIRSTNAME,1,5) FROM EMP;

How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a complete name?

Answer : SELECT FIRSTNAME ' ‘ LASTNAME FROM EMP;

What is the use of VALUE function?

Answer : Avoid -ve SQL CODE by handling nulls and zeroes in computations Substitute a numeric value for any nulls used in computation

What is UNION,UNION ALL?

Answer : 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?

What is the restriction on using UNION in embedded SQL?

Answer : It has to be in a CURSOR

In the WHERE clause what is BETWEEN and IN?

Answer : BETWEEN supplies a range of values while IN supplies a list of values

Is BETWEEN inclusive of the range values specified?

What is 'LIKE' used for in WHERE clause?What are the wildcard characters?

Answer : LIKE is used for partial string matches '%' ( for a string of any character ) and '_' (for any single character ) are the two wild card characters

When do you use a LIKE statement?

Answer : To do partial search eg to search employee by name, you need not specify the complete name; using LIKE, you can search for partial string matches

What is the meaning of underscore ( '_' ) in the LIKE statement?

Answer : Match for any single character

What do you accomplish by GROUP BY HAVING clause?

Answer : GROUP BY partitions the selected rows on the distinct values of the column on which you group by HAVING selects GROUPs which match the criteria specified. 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; What is the result of this uery if no rows are selected: SELECT SUM(SALARY) FROM EMP WHERE UAL='MSC'; NULL

Why SELECT * is not preferred in embedded SQL programs?

Answer : For three reasons: If the table structure is changed ( a field is added ), the program will have to be modified Program might retrieve the columns which it might not use, leading on I/O over head The chance of an index only scan is lost

What are correlated sub queries?

Answer : A sub-query in which the inner ( nested ) query refers back to the table in the outer query Correlated Sub queries must be evaluated for each qualified row of the outer query that is referred to.

What is a CURSOR?why should it be used?

Answer : Cursor is a programming device that allows the SELECT to find a set of Rows but return them one at a time Cursor should be used because the host language can deal with only one row at a time.

 CICS Interview Questions JCL Interview Questions DB2 Interview Questions COBOL Interview Questions VSAM Interview Questions IDMS Interview Questions IMS Interview Questions MVS Interview Questions
Related Posts