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));
- 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.
- Provide Default value for not null columns, if possible.
- If a column serves as an indicator like, actind, carinvind, ftnsta etc., make it not null mandatory. This prevents bugs not visible while coding.
- As nulls are not stored in indexes, this should be considered while creating columns which will be indexed.
This page was create on 15-dec-2000 and last updated on 15-dec-2000.
please forward all queries to amar_padhi@fastmail.fm