Beruflich Dokumente
Kultur Dokumente
For 0 – 2 Years
1) What does SQL stand for? Is SQL is related with particular Database?
A. A table can have any number of foreign keys defined. It can have
only one primary key defined.
7) What is Trigger?
A. Trigger will execute a block of procedural code against the database
when a table event occurs.
A. WHERE PerDiemExpenses = ‘’
B. WHERE PerDiemExpenses IS NULL
C. WHERE PerDiemExpenses = NULL
D. WHERE PerDiemExpenses in (Select null from table)
Only B.
9). You issue the following query: SELECT FirstName FROM
StaffList WHERE FirstName LIKE '_A%' Which names would be
returned by this query? Choose all that apply.
A. Allen
B. CLARK
C. JACKSON
D. David
Only C.
11). Write a query that can eliminate duplicate rows. (Does not use
Distinct Clause)
A). Select all columns names group by all columns name having count(*)
> 1
12). Write a query that find How many alphabets occur in a particular
string.
A. CALL Function.
For 2 – 5 Years
3) If I have a view which is a join of two or more tables, can this view be
updateable?
No.
4) What do you mean by NOT NULL WITH DEFAULT? When will you use it?
A) This column cannot have nulls and while insertion, if no value is supplied then it wil
have zeroes, spaces or date/time depending on whether it is numeric, character or
date/time.
5). What is the difference between VARCHAR and CHAR data type
A). When a column which contains long text, e.g. remarks, notes, may have in most cases
less than 50% of the maximum length. In this case VARCHAR is used.
A). Create new procedure of Function with same name but parameter should be different.
A). COALESCE
9). What is the main difference between the IN and EXISTS clause in
subqueries?
A). The main difference between the IN and EXISTS predicate in subquery is the way in which
the query gets executed.
IN -- The inner query is executed first and the list of values obtained as its result is used by the
outer query.The inner query is executed for only once.
EXISTS -- The first row from the outer query is selected ,then the inner query is executed and ,
the outer query output uses this result for checking.This process of inner query execution repeats
as many no.of times as there are outer query rows. That is, if there are ten rows that can result
from outer query, the inner query is executed that many no.of times.
A). YES.
For 5 – 5 + Years
A). EXPLAIN is used to display the access path as determined by the optimizer for a
SQL statement. It can be used in SPUFI (for single SQL statement ) or in BIND step (for
embedded SQL ).
3). How many columns maximum can be created in a table of a inner table of
the subquerry.
A). 15
A). as an extra-byte prefix to the column value. physically, the nul prefix is Hex ’00’
if the value is present and Hex ‘FF’ if it is not.
7) What is QUIESCE?
A) QUIESCE flushes all DB2 buffers on to the disk. This gives a correct snapshot of the
database and should be used before and after any IMAGECOPY to maintain consistency.
8) 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.
9) What are the 2 SQL codes that are returned?
A). 100 ( for successful completion of the query ), 0 (for successful COMMIT if
AUTOCOMMIT is set to Yes).
A). They contain executable code for SQL statements for one DBRM.
A). CS: Cursor Stability (Releases the lock on a page after use)
RR: Repeatable Read (Retains all locks acquired till end of transaction)
A). INDEX is generally used to make query access faster.It also takes less time for
execution b'use it will not go for searching all the data's in the table.It will search only by
using that INDEX.INSEX is created on the column of a table. Then a condition has also
given in WHERE clause which will make it also more faster.
14) What is the physical storage length of each of the following DB2 data type?
TIME: 3bytes
TIMESTAMP: 10bytes
15) What do you mean by NOT NULL WITH DEFAULT? When will you use it?
A) This column cannot have nulls and while insertion, if no value is supplied then it wil
have zeroes, spaces or date/time depending on whether it is numeric, character or
date/time.