Click to See Complete Forum and Search --> : to null or not to null!


bennystylee
02-16-2009, 07:28 AM
so I have a table which is going to potentially contain quite a few empty or "null" values. (a comments table) This is due to several items being optional.

I am also looking into my table design (splitting the table into three and reducing entries rather than putting null entries in)

So what I am wondering is should i just leave colums blank? or put "null" into the coloums? What takes up more space and considering i wont be querying for "null" values I have no need for anything to be in there. - if it contains no value its not used.


Thanks

p.s im myisam and innodb

felgall
02-16-2009, 01:43 PM
Whether to use null or not depends on what value you have to store. Blank and null have completely different meanings and so one can't substitute for the other.Blank means that the value of the field is known to be blank. Numm means that the value of the field has not yet been specified and is unknown.

chazzy
02-16-2009, 07:31 PM
you're going to have to be a bit clearer about your table structure. based on the information that you've given it's hard to really come up w/ a good conclusion about if you should split it. though, you did allude to one thing that could be a design flaw, which is that the comments table is actually serving the purpose of 3 tables.