amar on web

Creating table with null and not null columns

You are in need of creating a new table which has both null and not null columns in it. What in your opinion should be the key factor(s) to be considered when dealing with null and not null columns.

   create table am50
   (col1   varchar2(10) not null,
    col2   number(15, 3),
    col3   number(15,3),
    col4   number(15, 3) not null,
    col5   varchar2(4000)); 

  1. Nulls are stored in the database if they fall between columns with data values. In these cases they require one byte to store the length of the column (zero). Trailing nulls in a row require no storage because a new row header signals that the remaining columns in the previous row are null. So Place null columns at the bottom.
  2. Provide Default value for not null columns, if possible.
  3. If a column serves as an indicator like, actind, carinvind, ftnsta etc., make it not null mandatory. This prevents bugs not visible while coding.
  4. As nulls are not stored in indexes, this should be considered while creating columns which will be indexed.

Best viewed in medium text size. Please refresh this page (F5) to view the latest information.
This page was create on 15-dec-2000 and last updated on 15-dec-2000.
please forward all queries to amar_padhi@fastmail.fm