The Database Design Resource Center

The real question is where do you want to handle your NULL?

by jozeph
(England)

NULL, that is an unknown value, _will_ appear in the business logic at some point. Generally, the further you get from the factual disiplines (Comp Sci, Finance), the more accepting the department is of unknowns and they will force you, the database designer, to deal with unknowns, and potentially store the fact that you don't know, or even worse what you don't know.

My specific example stems from the world of marketing. A business rule emerged that it would be 'nice to know' how long a customer had been trading. Some customers would refuse to give this information, and so, somewhere, it had to be stored that we don't know when they started trading.

This raised all the problems addressed in this article. Specific grief came from the grouping of customers into decade brackets, which (quite obviously to a programmer) did not add up to the total of customers. However, once this conceptual hurdle had been overcome, the question becomes, where do you handle the NULL?

Do you store a field in your row of customer information, named 'trading_since' and alow it to be null, handing nulls at DB level?

Do you store a key/ value pair table of non-essential information, and have the applications 'know' what they are looking for, and handle the unknown information at application level?

Consider your overheads....

Click here to post comments

Join in and write your own page! It's easy to do. How? Simply click here to return to On NULL values.


Exclusive interviews with:
Steven Feuerstein, PLSQL expert
Donald Burleson, Top IT consultant


Free eBook

Subscribe to my newsletter and get my ebook on Entity Relationship Modeling Principles as a free gift:


What visitors say...

"I just stumbled accross your site looking for some normalization theory and I have to say it is fantastic.

I have been in the database field for 10+ years and I have never before come across such a useful site. Thank you for taking the time to put this site together."

Mike, USA

Read more Testimonials

Database Normalization eBook:


Database Normalization eBook



Copyright © www.databasedesign-resource.com / Alf A. Pedersen
All rights reserved.
All information contained on this website is for informational purposes only.
Disclaimer: www.databasedesign-resource.com does not warrant any company, product, service or any content contained herein.

Return to top

Copyright acknowledgement note:

The name Oracle is a trademark of Oracle Corporation.
The names MS Access/MS SQL Server are trademarks of Microsoft Corporation.
Any other names used on this website may be trademarks of their respective owners, which I fully respect.