List:General Discussion« Previous MessageNext Message »
From:mfatene Date:July 6 2005 7:18am
Subject:Re: null data in table question
View as plain text  
Hi,
don't forget to apply the correct changes to your queries. Having NULLs or not,
let you write for example :

select ...  from ... where midinials is NULL;

And be aware about NULL indexation in some storages. Those values are not
indexed for example in oracle. I'm not sure about innodb, but this sould be.

In all the cases, you can't have a unique index on such columns.

Mathias

Selon Martijn Tonies <m.tonies@stripped>:

> 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
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>


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