When using integer columns is it better to have 0
or NULL
to indicate no value.
For example, if a table had a parent_id
field and a particular entry had no parent, would you use 0
or NULL
?
I have in the past always used 0
, because I come from a Java world were (prior to 1.5) integers always had to have a value.
I am asking mainly in relation to performance, I am not too worried about which is the "more correct" option.