What is the use of VALUE function?

1. Avoid -ve SQLCODEs by handling nulls and zeroes in computations

2. Substitute a numeric value for any nulls used in computation


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?  Once.

 What is the restriction on using UNION in embedded SQL?

It has to be in a CURSOR.

 In the WHERE clause what is BETWEEN and IN? –

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? –

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?

To do partial search e.g. to search employee by name, you need not specify the complete name; using LIKE, you can search for partial string matches.