List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:July 5 2005 9:51pm
Subject:Re: null data in table question
View as plain text  
Hi Scott,

> I have created a web-based simple application, and used mysql for data
storage. All has worked well. But I do have a simple question I would like
to ask the group.
>
> I have some web-based forms that match table structure. Most of the
important fields have validation, and I ensure good data into the table. But
I have a few columns in the table such as "middleInitial" where I do not
validate the data. And in the database is shows a null when I do a select *
from.
>
> Is a null acceptable in the database, or is there something I should do on
columns that the user may not put in data?

Given that NULL means "unknown" and there's no value/state for "non
applicable", NULLs don't belong in places where you actually want to fill in
"nothing" or "empty".

An empty string is an empty string. Why not insert that instead?

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com

Thread
null data in table questionScott Purcell5 Jul
  • Re: null data in table questionSGreen5 Jul
  • Re: null data in table questionMartijn Tonies5 Jul
    • Re: null data in table questionmfatene6 Jul