NULL is not empty!


If you have ever been worried about “what is NULL” in programming world, then here is a very good definition.
The best and shortest definition for NULL is “undefined.” In your Department table, only DepartmentID and Name are required, so Description is optional—meaning that you are allowed to add a new department without supplying a description for it. If you add a new row of data without supplying a value for columns that allow nulls, NULL is automatically supplied for them. Especially for character data, a subtle difference exists between the NULL value and an “empty” value. If you add a product with an empty string for its description, this means that
you actually set a value for its description; it’s an empty string, not an undefined (NULL) value.
The primary key field never allows NULL values. For the other columns, it’s up to you to decide which fields are required and which are not.

This definition has been taken from:
Beginning ASP.NET 2.0
E-Commerce in C# 2005
From Novice to Professional
Cristian Darie and Karli Watson

I’d always like to share the solutions of the problems I faced in my life. I, too, at times was confused about what is NULL values?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s