• da-zero (8/24/2010)


    Carlo Romagnano (8/24/2010)


    One way to avoid worrying about NULLs is never to use them, always declaring columns as not allowing NULLs and designating default values for "empty" or "unknown". This will save you keystrokes, especially when you want to check whether a column does not have a certain value. However, you will anyway probably have to write logic for when columns have the designated default values.

    TERRIBLE!

    VERY TERRIBLE!

    Constructive feedback, lalalalala.

    Please elaborate why this is so terrible, that way we can all learn something.

    First: problem for storage

    Second: how can you determine if a value of a column has been specified? (e.g. a price of an article: 0 means it's free or the price has not been established?).

    Third:

    One way to avoid worrying about NULLs is never to use them, always declaring columns as not allowing NULLs

    that's not true. Think OUTTER JOIN, the column could be null, although is declared NOT NULLable!