Friday, December 25, 2009

The various cases where use of a null value would be appropriate.

When there is an entity that has no value for its attribute, then we use a null value. A null value is not 0, but it is nothing value. One example is most Korean names have no middle name. If there is a name attribute with first name, middle and last name, a special value null should be given. Another example is, asylum applicant’s has no nationality. When they fill an immigration form for the particular country when they visit there, they do not write country’s name. So, in that situation their country attribute should be null. Another example is, when a student does not attempt an exam of a particular subject, his/her obtained marks of that subject should be null. If s/he attends the exam and all the answers are wrong then only s/he scores 0 marks.

No comments: