Thursday, February 18, 2010

What to do with Black Pepper...Indexes

Indexes:
A table has got unique index of which all participating column being foreign keys.
This table has got one more index which also has those foreign keys columns along with other columns of index.

It is perfectly normal as per TLMR.

Tuesday, February 16, 2010

not in & NOT EXISTS... SUGAR and SUGAR CANE

NOT EXISTS can yield different results from NOT IN.
---------------------------------------------------------------
NOT IN implies that data exists in the column. A predicate testing a
column containing a NULL value will not satisfy the NOT IN condition.
(verified on UDB LUW 8.1)

A null value in a code will satisfy the NOT EXISTS clause in your second
example. This is true even if t2 has a row containing a null value in eid!