Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 The Logic, Mathematics, and Utility of NULLs Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, August 17, 2010 9:09 AM
 SSChasing Mays Group: General Forum Members Last Login: Friday, January 22, 2016 2:15 PM Points: 600, Visits: 3,852
Post #970493
 Posted Tuesday, August 17, 2010 1:49 PM
 SSCrazy Eights Group: General Forum Members Last Login: Today @ 2:14 PM Points: 9,833, Visits: 11,907
 Various parts of mathematics use a NULL-like concept. The ones which to me seem to be the closest to the NULL of relational databases crop up in Chris Strachey and Dana Scott's denotational semantics for programmes where one can have values like "bottom of D" for each domain D, and of course "bottom" for "bottom of everything". Basically "bottom of D" is a value in D of which we know nothing but that it is in D, while "bottom" is a value of which we know nothing, not even what domain it is a member of. Essentially all values exist in a lattice, and each domain is a sublattice, with the < relation in the lattice meaning "is less well defined". There is also a top value, which is overdefined (ie is contradictory), and potentially "top of D" values which are also overdefined but slightly less so (non-contradictory information on which domain they are in is available). Of course bottom and top occur naturally in lattice theory, even before it is applied to the denotational semantics of programmmes. But if one considers the natural topology of the lattices used in denotational semantics you see that the meaning of a recursive programme is the limit of the meanings of its partial evaluations (eg the meaning of a programme that computes factorials is the limit of the series of meanings of the programmes F(N) that produce factorials for numbers up to N but don't deliver a result for numbers > N, as N increases), which is quite a strong constraint on the lattices. Despite the closeness of the NULLs of RDBMS with the bottoms of Scott-Strachey semantics, and the fact that both indicate an absence of knowledge about a value, they are conceptually quite different.edit:correct the English Tom
Post #970696
 Posted Tuesday, August 17, 2010 4:46 PM
 SSC Eights! Group: General Forum Members Last Login: Tuesday, November 22, 2016 10:24 AM Points: 894, Visits: 8,581
 WOW, over my head on the first post. OK, I'll just grab the popcorn and sit back and absorb.Carry on. And then again, I might be wrong ...David Webb
Post #970803
 Posted Tuesday, August 17, 2010 8:13 PM
 SSC-Forever Group: General Forum Members Last Login: Today @ 2:41 PM Points: 42,081, Visits: 39,473
 David Webb-200187 (8/17/2010)WOW, over my head on the first post. OK, I'll just grab the popcorn and sit back and absorb.Carry on.Heh... I'll summarize. In fact, it's already on a T-Shirt... "NULLs don't mean 'Nothing'". At least not in an RDBMS. --Jeff Moden"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column." Helpful Links:How to post code problemsHow to post performance problems
Post #970836
 Posted Tuesday, August 17, 2010 9:23 PM
 SSC Eights! Group: General Forum Members Last Login: Tuesday, November 22, 2016 10:24 AM Points: 894, Visits: 8,581
 Yep, that pretty well sums it up. I've been reading Hugh Darwen for a couple of days and working through Tutorial D and the Rel implementation. 6th normal form brings its own bag of headaches, and while I tend to avoid NULLs if I can help it, I'm not sure which set of headaches I'd prefer to deal with, if given an either-or choice.I'm a little surprised that this thread hasn't generated more traffic. It could be that everyone has already staked out their positions and they feel no need to re-defend them. And then again, I might be wrong ...David Webb
Post #970856
 Posted Wednesday, August 18, 2010 6:47 AM
 SSC-Dedicated Group: Administrators Last Login: Today @ 1:04 PM Points: 34,375, Visits: 18,596
 NULL seems like a variable to me, in an equation that can't be currently solved. Or maybe like "i". We know that it has some value, but we cannot pick a value to state, so we use a placeholder. Follow me on Twitter: @way0utwestForum Etiquette: How to post data/code on a forum to get the best help
Post #971083
 Posted Wednesday, August 18, 2010 8:25 AM
 SSChasing Mays Group: General Forum Members Last Login: Friday, January 22, 2016 2:15 PM Points: 600, Visits: 3,852
 Steve Jones - Editor (8/18/2010)NULL seems like a variable to me, in an equation that can't be currently solved. Or maybe like "i". We know that it has some value, but we cannot pick a value to state, so we use a placeholder.I like this thought Steve, but I would also add that a NULL can represent an "N/A." For instance, if we have a table listing car models, then we might have a column for MPG. But what if the model is an electric car? What would we put in the column for MPG? Would it be wrong to use a NULL there since there really is no quantity that applies? We can't use "N/A" since it is a numeric field. ______________________________________________________________________The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
Post #971175
 Posted Wednesday, August 18, 2010 8:57 AM
 SSC-Dedicated Group: Administrators Last Login: Today @ 1:04 PM Points: 34,375, Visits: 18,596
 It could be N/A, but that implies a specific meaning. Using NULL there as a placeholder works, but you are assigning a value to NULL. I prefer to keep it as "unknown" as in there will be a ship date, but right now it's unknown. Follow me on Twitter: @way0utwestForum Etiquette: How to post data/code on a forum to get the best help
Post #971201
 Posted Wednesday, August 18, 2010 9:06 AM
 SSChasing Mays Group: General Forum Members Last Login: Friday, January 22, 2016 2:15 PM Points: 600, Visits: 3,852
 Steve Jones - Editor (8/18/2010)It could be N/A, but that implies a specific meaning. Using NULL there as a placeholder works, but you are assigning a value to NULL. I prefer to keep it as "unknown" as in there will be a ship date, but right now it's unknown.Good point - if we use NULL for miles per gallon for an electric car, it doesn't really mean "unknown" in that case, but "N/A" since the MPG doesn't even apply in this case. We're already seeing inconsistencies here. So what would all of you say to do in this case? Use a NULL anyway since it "works?" I would probably use the NULL there if it was a numeric field and couldn't change the field's type easily. But aren't we already bending the rules of NULLs? We can redefine a NULL on a whim? ______________________________________________________________________The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
Post #971210
 Posted Wednesday, August 18, 2010 9:10 AM
 SSC-Dedicated Group: Administrators Last Login: Today @ 1:04 PM Points: 34,375, Visits: 18,596
 If you can be sure that it will always mean N/A, you could use it. Alternatively, you could use a code, something like 99989 to mean electric car.It's how you define it, and how you handle it in the application. However, be sure it's documented somehow. Follow me on Twitter: @way0utwestForum Etiquette: How to post data/code on a forum to get the best help
Post #971213

 Permissions