34

In SQL and Relational Theory (C.J. Date, 2009) chapter 4 advocates avoiding duplicate rows, and also to avoid NULL attributes in the data we store. While I have no troubles avoiding duplicate rows, I am struggling to see how I can model data without making use of NULL. Take the following, for example - which is a bit from work.

We have an artist table, which has, amongst other columns, a gender column. This is a foreign key to the gender table. However, for some artists, we don't know their gender - for example we've been given a list of new music which has no descriptions of the artist. How, without using NULL is one meant to represent this data? The only solution I see is to add a new gender, "unknown", to the gender table.

While I am thoroughly enjoying this book, I was really disappointed when the chapter concluded with:

Of course, if nulls are prohibited, then missing information will have to be handled by some other means. Unfortunately, those other means are much too complex to be discussed in detail here.

Which is a real shame - because this was the solution I was waiting to read about! There is a reference to read the appendix which has lots of publications to read, but I was hoping for a little bit more of a down to earth summary before I dived into reading these.


I'm getting a few people commenting that they don't understand why I wish to avoid 'NULL' so I will quote the book again. Take the following query:

SELECT s.sno, p.pno
  FROM s, p
 WHERE s.city <> p.city
    OR p.city <> 'Paris'

Now, take the example that s.city is London, and p.city is Paris. In this case, London <> Paris, so the query is true. Now take the case that p.city is not Paris, and is infact xyz. In this case, (London <> xyz) OR (xyz <> Paris) is also True. So, given any data - this query is true. However, if xyz is 'NULL' the scenario changes. In this case both of these expressions are neither True nor False, they are in fact, Unknown. And in this case because the result is unknown you will not get any rows returned.

The move from 2 value logic to 3 value logic can easily introduce bugs like this. Infact, I just introduced one at work which motivated this very post. I wanted all rows where the type != 0 However, this actually ends up matching type == 0 OR type IS NULL - confusing behavior.

Whether or not I model my data with or without NULL in the future is unclear, but I'm very curious what the other solutions are. (I too have always been of the argument that if you don't know, you should use NULL).

ocharles
  • 6,172
  • 2
  • 35
  • 46

8 Answers8

48

Good on you, for eliminating Nulls. I have never allowed Nulls in any of my databases.

Of course, if nulls are prohibited, then missing information will have to be handled by some other means. Unfortunately, those other means are much too complex to be discussed in detail here.

Actually it is not so hard at all. There are three alternatives.

  1. Here's a paper on How To Handle Missing Information Without Using NULL by H Darwen, that may help to get your head around the problem.

    1.1. Sixth Normal Form is the answer. But you do not have to normalise your entire database to 6NF. For each column that is optional, you need a child table off the main table, with just the PK, which is also the FK, because it is a 1::0-1 relation. Other than the PK, the only column is the optional column.

    Look at this Data Model; AssetSerial on page 4 is a classic case: not allAssets have SerialNumbers; but when they do, I want them to store them; more important I want to ensure that they are Unique.

    (For the OO people out there, incidentally, that is a three level class diagram in Relational notation, a "Concrete Table Inheritance", no big deal, we've had it fro 30 years.)

    1.2. For each such table, use a View to provide the 5NF form of the table. Sure, use Null (or any value that is appropriate for the column) to identify the absence of the column for any row. But do not update via the view.

    1.3 Do not use straight joins to grab the 6NF column. Do not use outer joins, either (and have the server fill in a Null for the missing rows). Use a subquery to populate the column, and specify the value that you want returned for a missing value (except if you have Oracle, because its Subquery processing is even worse than its set processing). Eg. and just an eg. you can convert a numeric column to string, and use "Missing" for the missing rows.

When you do not want to go that far (6NF), you have two more options.

  1. You can use Null substitutes. I use CHAR(0) for character colomns and 0 for numeric. But I do not allow that for FKs. Obviously you need a value that is outside the normal range of data. This does not allow Three Valued Logic.

  2. In addition to (2), for each Nullable column, you need a boolean Indicator. For the example of the Sex column, the Indicator would be something like SexIsMissing or SexLess (sorry). This allows very tight Three Valued Logic. Many people in that 5% like it because the db remains at 5NF (and less tables); the columns with missing info are loaded with values that are never used; they are only used if the Indicator is false. If you have an enterprise db, you can wrap that in a Function, and always use the UDF, not the raw column.

Of course, in all cases, you can never get away from writing code that is required to handle the missing info. Whether it is ISNULL(), or a subquery for the 6NF column, or an Indicator to check before using the value, or an UDF.

If Null has a specific meaning ... then it is not a Null! By definition, Null is the Unknown Value.

Dale K
  • 25,246
  • 15
  • 42
  • 71
PerformanceDBA
  • 32,198
  • 10
  • 64
  • 90
  • 1
    +1 for the link to H Darwen's paper. However it seems to me that he starts with a case study of a table in which no one in this discussion would have allowed NULLs in the first place. It would be nice if there was an example in which all opinions are divided, let's say 50-50. – Damir Sudarevic Dec 05 '10 at 16:03
  • @Damir: 1) I can't see a "+1". 2) Hugh did not write the paper in aswer to this Question, the example is merely an example for the purpose of the paper: showing how 6NF provides optional columns and therefore eliminates Nulls. – PerformanceDBA Dec 05 '10 at 23:27
  • 1
    @PerformancDBA, 1) well, I see it from here. 2) How rude of him (Hugh). – Damir Sudarevic Dec 06 '10 at 13:12
  • 2
    Thanks for the answer! Yes, sadly a lot of people didn't really seem to get my point and just assumed I didn't "get" NULLs - which simply isn't true; I just don't see anything as the final approach, and like to keep my options open. Thanks again! – ocharles Dec 06 '10 at 13:29
  • @Damir. 1) Ok, now I see it! 2) Yeah, Hugh is not very considerate of the needs of others, believe me, I speak from personal experience 8-P – PerformanceDBA Dec 06 '10 at 16:29
  • 1
    Null, by definition, is the missing value. That sometimes means the unknown value. But not always. – Walter Mitty Jan 06 '13 at 09:09
  • 4
    Where this kind of "solution" always leaves me feeling cheated is here: "specify the value that you want returned for a missing value". If you are going to have a "sentinel value", then either you have to reserve such a value in some type (e.g. `0`, `''`), or you need to union your type with something which is not part of the domain. Which is what `null` is there for in the first place. So you seem to be back where you started. – IMSoP Sep 15 '13 at 21:10
  • 2
    @IMSoP. Er, no. I don't have null, so I don't have the problem. You have null, and the problem. You are used to running around in circles, and seeing the starting point over and over again, hence you think others do the same. I don't. In any case, I wasn't answering a question from you. Do not use my solution, use your "solution", and don't worry about how the other half lives. If you speculate about them, you will certainly crash, and cheat yourself. If you genuinely do not understand, ask a question, instead of making statements. – PerformanceDBA Apr 20 '15 at 12:40
  • 2
    @PerformanceDBA Wow, so defensive! I think (reading my own comment back), I was trying to say that *at the time you add a sentinel value*, you have to recreate in your view / logic something very similar to NULL, just with different implementation details. e.g. filling in values with the string "unknown" and ensuring that that value is handled specially throughout the application. In some cases, you will actually want 3VL (to avoid the "unknown" in two different rows evaluating as equal), so AFAICS, it's more a case of "doing NULL better" than "doing without NULL". – IMSoP Apr 20 '15 at 13:58
  • @IMSoP. (2) I can't understand what you are trying to say, and I am not going to cheat myself out of the time to work it out. I don't "fill-in" anything, this is not a garden or a spreadsheet. Telling me what I *will* and *will not* have is stupid and offensive, because I don't have any of your speculations. AFAIC, it is definitely doing without Null (no single or double quotes required, it is a bald-faced fact). **And** it is doing The Null Problem better. I repeat, you really should ask a question instead of making statements. You are cheating yourself out of knowledge. – PerformanceDBA Apr 20 '15 at 15:33
  • 3
    @PerformanceDBA I'm not sure why you're taking this personally. I'm sorry if anything I said offended you in any way. I did not mean that I "feel cheated" by *you*, but by the claim that "NULLs are unnecessary", when in reality it seems to boil down to "NULLs could be implemented better". My question is this: when you introduce a sentinel value (e.g. in point 1.3 or point 2), does that not require reimplementing 3VL in certain cases, e.g. to answer the question "is salary > $5000?" for an item with "salary = 'Unknown'"? And if so, how is this different from using NULLs carefully? – IMSoP Apr 20 '15 at 15:47
  • @IMSoP. (1) Sure, sure, 'Where this **kind of "solution" always leaves me feeling cheated** is doesn't mean *me*, oh, no, no, it means the post box in High Street. Sheesh. The only thing worse than an insult, is an apology that is for something else, and not for the insult. (2) You keep missing the point: OP has not asked "why are nulls unnecessary", he had already decided they are, he asked "how to implement". I answered his question, not your statement/question in the comments. – PerformanceDBA Apr 20 '15 at 18:26
  • (3) I thank you from the bottom of my used socks, for finally asking a question rather that continuing to make hilarious statements. You have no idea how grateful I am that you have progressed to this point. Now, the problem is, that is a good question, but it can't be answered in the comments. However, God is merciful. SO has this facility, where you can open an new question. And millions of people who know diddly squat about databases will answer it, if they don't close it first. Not to worry, I have promised that I will answer it. Could you please try that ? – PerformanceDBA Apr 20 '15 at 18:32
  • @PerformanceDB So your name is "solution" is it? If not, I fail to see how I have insulted you. Nonetheless, my apology is genuine, and I won't waste any more of your time trying to explain my point. Thanks for engaging. :) – IMSoP Apr 20 '15 at 20:17
  • @IMSop. Yes, my name is in-deed **Solution**, the one you referred to feeling cheated about. It didn't exist until I wrote it. Thank you very much for the apology for something else, instead of for the insultit is very kind of you. If you don't mind, I won't explain your confusion, I will only feel cheated. And thanks so much for the engagement, perhaps a chat sometime. – PerformanceDBA Apr 21 '15 at 23:53
  • @PerformanceDBA the problem with Dwarden's approach is that is not possible to be implemented. – rlartiga Aug 07 '15 at 00:01
  • 2
    The answers to https://stackoverflow.com/questions/6638291/standard-use-of-z-instead-of-null-to-represent-missing-data suggests that option 2: null substitutes isn't really any better than null. – mic Apr 09 '20 at 16:12
  • 1
    what if 0 in my numeric column has a meaning? what else can be used as null substitute for numeric? I find this really hard without building a (not necessarily good enough) secondary database to store all the possible numeric values. – stucash Jun 16 '20 at 18:13
21

So how do you design without NULLS? That was the original question.

It's actually quite easy. You design such that whenever you have to leave some data missing, you can do so by leaving a whole row missing. If a row isn't there, it isn't a row full of NULLs. It just plain isn't there.

So, in the case of "DateOfDeath", we have a table with two columns, namely, PersonId and DateOfDeath. PersonId references Id in the Persons table. If there is no DateOfDeath to be stored, we don't store the row. End of discussion.

If you do an OUTER JOIN between this and the Persons table, you'll get a NULL for the DateOfDeath wherever there was no row. And if you use this in a where clause, you'll get the usual perplexing behavior concerning 3-value logic. If you do an INNER JOIN, the rows for which there is no DateOfDeath will simply disappear from the join.

A design that permits every column to be NOT NULL enforced has been called sixth normal form.

Having said all that, I often allow NULLs in non critical columns. And I don't have a succinct way of telling you how I determine that a column is critical.

Walter Mitty
  • 18,205
  • 2
  • 28
  • 58
7

Quite simply by storing only the known information - in other words the Closed World Assumption. Aim to be in at least Boyce Codd / Fifth Normal Form and you won't go far wrong.

nvogel
  • 24,981
  • 1
  • 44
  • 82
  • 1
    Do you have any recommended reading on the Closed World Assumption? I need to go and do some extra reading past 3NF too it seems. Thanks! – ocharles Dec 02 '10 at 15:51
5

nulls are a consequence of theory meeting reality and having to be adjusted to be usable. In my opinion attempting to avoid all null values will ultimately lead to uglier and less maintainable code than just using null where appropriate.

Donnie
  • 45,732
  • 10
  • 64
  • 86
  • 2
    I agree. Theory is practical, but this truth has its limits. In theory, there is no difference between theory and practice. In practice, there is. The problems often come from a failure to explicity state in the database documentation, what a given NULL actually means, beyond "no data here". – Walter Mitty Dec 03 '10 at 14:20
  • `null` is a valid value. The database places no meaning on it. Application documentation should document what it means if it is beyond "no data". – Donnie Dec 03 '10 at 14:48
1

NULLs are required - theres no need to replace them

The enitre definition of NULL is that its unknown - simply replacing this with arbitrary type is doing the same thing, so why?

For the comments below:

Just tried this - neither is true:

declare @x char
set @x = null

if @x = @x
begin
select 'true'
end

if @x <> @x
begin
select 'false'
end

I can only take this to mean that because null is unknown then it can't be said that it equals or does not equal - hence both statements are false

m.edmondson
  • 30,382
  • 27
  • 123
  • 206
  • 2
    Agreed. Can't fathom why OP wants to skip `NULL` – Sathyajith Bhat Dec 02 '10 at 15:41
  • Please read my updated question which explains this. Also, my comment on the original question. – ocharles Dec 02 '10 at 15:50
  • 8
    The misconception that nulls mean unknown is a common one but is demonstrably untrue (at least in SQL). SQL does NOT use nulls that way. Think about the expression x=x. If x was unknown then the result of that expression would be TRUE. That's not the case if x is null however. Therefore null does not mean "unknown". – nvogel Dec 02 '10 at 15:53
  • dportas has hit the nail on the head, in considerably less text than I have explained it in :) But I'm curious - what *are* the acceptable cases of using NULL? – ocharles Dec 02 '10 at 15:55
  • 1
    @aCiD2 - See my answer for acceptable uses of `NULL`. There **are** business reasons that can only be satisfied by using `NULL`. – JNK Dec 02 '10 at 16:05
  • 2
    I don't understand what your updated answer proves. To illustrate my problems with NULLs, all you need to do is query: `SELECT 1 WHERE 'Hello' = NULL` and `SELECT 1 WHERE 'Hello' <> NULL` and notice that neither of the queries will return rows. In the real world one of them would be true, however. – ocharles Dec 02 '10 at 16:06
  • 6
    @ m.edmondson : Your example demonstrates the problem but your conclusion is certainly wrong. In maths, logic and in the real world x = x is TRUE if x is unknown. If it were not then algebra and most of science would be impossible. Null is not the same as something being "unknown" and if you pretend that it is then you will certainly get the wrong results from your SQL - such as the one you demonstrated here. – nvogel Dec 02 '10 at 16:07
  • 3
    aCiD2 - This simply isn't true. If I had two fruit but didn't tell you which ones, you couldn't be sure that they were both the same OR both different because you have an unknown – m.edmondson Dec 02 '10 at 16:08
  • 2
    @dportas - I understand about math and science, but whats the conclusion with SQL then? If I don't 'pretend' that null is unknown then what does it stand for? – m.edmondson Dec 02 '10 at 16:10
  • @ m.edmondson, Excellent question! Null in SQL is unfortunately used for lots of different and contradictory things. It's just part of the SQL specification but it isn't very logical and doesn't make much sense in the real world. This is why it's best to avoid or minimise the use of nulls. – nvogel Dec 02 '10 at 16:16
  • 2
    Even if you restructure your data so you don't actually store `NULL` s you will reintroduce them as soon as you do an `OUTER JOIN`. Three Valued Logic really isn't very complicated. My advice would be just to get to grips with it and move on. – Martin Smith Dec 02 '10 at 16:41
  • 3
    There are two assumptions behind the assertion that x=x is TRUE. The first assumption is that both instances of "x" refer to the same thing. The second assumption is that, while the value of x is unknown, it can still be asserted that x has a value. These are both reasonable assumptions, but it's worth making them explicit somehow, if NULL is going to be used to communicate a message. I prefer to think of NULL as the non communication of a message. That is not the same thing as the communicaton of some kind of default message. – Walter Mitty Dec 03 '10 at 14:28
  • @dportas I think you clearly demonstrate why NULL shouldn't be considered "unknown". I have never thought of it like that, but instead, it simply means that "there is no value". So, a question like "x=x" is in fact NULL because, there is no value to x, and so there is no value to that question. – Turing Nov 09 '11 at 19:35
  • @mangoDrunk if null really only means "there is no value" then you can just as easily achieve the same thing without it. If I have no value and no null either then that means "there is no value". QED – nvogel Nov 09 '11 at 20:10
  • 1
    @dportas How will you signal to the caller that there is no value? That is what null is. – Turing Nov 10 '11 at 15:36
  • Neither statement is true. Neither statement is false. – Walter Mitty May 23 '20 at 00:43
1

NULL could/should be used as long as:

A) You have a business reason. For example, in a table of payments, a NULL payment value would mean it was never paid. A 0.00 payment value would mean we intentionally paid nothing. For medical charts, a NULL value for a blood pressure reading would mean you didn't take a BP, a 0 value would mean the patient is dead. This is a significant distinction, and necessary in certain applications.

B) Your queries account for it. If you understand the affect of NULL on IN, EXISTS, inequality operators (like you specified in OP), etc. then it shouldn't be an issue. If you have NULL now in your tables and don't want the value for certain applications, you can employ views and either COALESCE or ISNULL to populate different values if the source table has a NULL.

EDIT:

To address OP's questions about "real world" inequalities/equalities using NULL, this is a great example I use sometimes.

You are at a party with 3 other people. You know that one person is named "John" but don't know the others.

Logically, the answer for "How many people are named Joe" is unknown or NULL. In SQL, this would be something like

SELECT name FROM party where NAME = 'Joe' You would get no rows since you don't know their names. They may or may not be Joe.

Your inequality would be:

SELECT name from party where NAME <> 'Joe' You would only get a return value for "John" since John's name is all you know. The other people may or may not be Joe, but you have no way to know.

JNK
  • 63,321
  • 15
  • 122
  • 138
  • Great answer, thank you. So you're saying, as has been mentioned elsewhere here that `NULL` is acceptable when you have a specific meaning for what `NULL` means - and that also when you operate on data that could be `NULL` you should try and handle that case at the same time? – ocharles Dec 02 '10 at 16:07
  • @aCiD2 - Basically, yes. I work with medical data and there are a lot of reasons to have fields be `NULL`. Some of our data we convert to `''` or `0` depending on the application, but certain instances (like those in my answer) you **NEED** to know if the value is `NULL` or `''` or `0`, because it is a big difference. `DateOfDeath` being `NULL` means you are alive. If you put a default value, it implies you are dead :) – JNK Dec 02 '10 at 16:11
  • A) Why would you want to create a null for payment that was never made or a blood pressure reading that wasn't taken? What you are suggesting is quite different to what others have said - that nulls mean something which is "unknown". If you *know* a payment wasn't made then the payment value clearly isn't unknown. This demonstrates that there is no general agreement on what nulls mean or how they should be used - which is another good reason to avoid them. B) If you don't use them then you don't generally need to account for them. – nvogel Dec 02 '10 at 16:12
  • @dportas - In the medical billing world, a payment of "0" means "We saw this claim and didn't pay it for contract or insurance reasons" and it has been dealt with. A payment of `NULL` means this payment has not been dealt with. The BP field is in our client data. If it is `NULL` it means a BP wasn't taken. There **ARE** good business/logical reasons for using `NULL`, whether you agree with them or not. – JNK Dec 02 '10 at 16:15
  • 1
    @dportas : if you know a payment wasn't made, using `NULL` is much easier than adding a column saying "payment not made". – Valentin Rocher Dec 02 '10 at 16:19
  • @Valentin - I avoid that "easier" argument in just about all programming practices. There is a large difference between taking the easy route and doing it the correct way. The latter usually seems harder at first, but often avoids all the problems the "easier" way subtly introduces. I don't think in database design it is ever sensible to take the easy option. – ocharles Dec 02 '10 at 16:22
  • @JNK But you could have represented the same information without using a null. You haven't explained why your database designer chose to use a null rather than not. No properly stated business requirement ever requires a null because null is just a symbol used by database developers. – nvogel Dec 02 '10 at 16:22
  • @dportas - We use `NULL` for a variety of reasons. One of these is this is the way that we receive client data. We receive billions of records every month, many of which include `NULL`s. Some of these we set to default values, but others we leave as `NULL` again for business reasons. The processing of this data is very time sensitive, and breaking out multiple-Terrabyte tables into a 5NF or 6NF structure is beyond impractical - it's stupid and unnecessary. – JNK Dec 02 '10 at 16:31
  • The point I wanted to make is that you could have met the same business requirement either with or without nulls. You chose to use nulls. To say as you did in another comment that "There are business reasons that can only be satisfied by using NULL" seems like you are disowning the database designer's responsibility for the decision to use nulls. I've worked with plenty of multi-terabyte databases and most of them were in 5NF or something close to it. In general, the larger the database, the more important important normalization is. Denormalization costs extra storage and processor cycles. – nvogel Dec 02 '10 at 18:59
  • @dportas - I think you are correct **in theory**. In **practice**, there are business needs that are **best satisfied** by `NULL`. I was incorrect in saying there was no alternative. However, saying "Denormalization costs extra storage and processor cycles" is like saying "New tires always make your car faster". It depends a lot on the car, the road, and the tires. – JNK Dec 02 '10 at 19:19
  • @JNK - Fair comment on "it depends". But my comment was fairer and closer to the truth than you describing 5NF as "impractical, stupid and unnecessary". I don't think anyone can afford to dismiss sound database design practice so lightly. Also you need to bear in mind that nulls will cause some queries to return incorrect results - especially in your example when you use null to represent known information (that no payment was made) rather than just missing information. So using nulls actually compromises the business requirement rather than meets it. – nvogel Dec 02 '10 at 19:32
  • @dportas - My comment about 5nf being stupid and unnecessary was referring specifically to breaking out the very large data sets that we get from our clients that are mostly denormalized. We need to turn around this data very quickly, and it needs to **run** very quickly as well once it's in the field. Our business needs are best met by our current model. As for `NULL` giving incorrect results, this is only a factor if you don't factor it into your queries. If you expect `NULL` in a field you can account for it in your query logic. – JNK Dec 02 '10 at 19:48
  • 1
    Assigning meaning to NULLS is like assigning a meaning to the failure of the dog to bark in the night. It can be very clever, but it can be very risky. For example, a NULL in the date of death can mean that the person is still alive, but it can also mean that a death certificate was entered where the date of death was left blank. – Walter Mitty Dec 03 '10 at 13:57
  • 1
    @Valentin -- not saying that a payment was made is not the same thing as saying that a payment was not made. – Walter Mitty Dec 03 '10 at 20:41
  • 1
    @JNK. Wow. That's an awful lot of character info that you pack into a numeric column. Or are all your columns VARCHARS. The way you talk about the business is about people, not about appropriate business decisions, on known facts. – PerformanceDBA Dec 05 '10 at 12:06
  • 1
    @JNK: Sure. Read my answers, and the comments left by people. – PerformanceDBA Dec 06 '10 at 16:36
0

I disagree with the author and would claim that NULL is actually the CORRECT way to handle missing data for optional fields. In fact, it's the reason that NULL exists at all...

For your specific problem regarding gender:

  • Are you sure you want a gender table and incur the cost of an extra join for every query? For simple enumerated types it's not unreasonable to make the field an int and define 1=male, 2=female, NULL=unknown.
jtdubs
  • 13,585
  • 1
  • 17
  • 12
  • 5
    You disagree with Codd & Date, I love it !!! You've written the successor to the Relational Model, have you ? ENUM is not ISO/IEC/ANSI standard SQL; it is a non-standard extension in the freeware end of town. Joins are nothing to be scared of. – PerformanceDBA Dec 05 '10 at 13:56
0

Do not allow a column to be defined as NULL if at all possible. For me it does not have anything to do with the business rule of what you want NULL to mean it has to do with disk I\O.

In SQL Server a nullable column, say a character 10, will take one bit in a bitmap when null and 10 bytes when not nullable. So how does having a null hurt disk I/O. The way it hurts is when a value is inserted into a column where a null used to be. Since SQL did not reserve space there is not room in the row to just put the value so SQL Server has to shift data around to make room. Page splits, fragmentation, updating the RID if this is a HEAP, etc all hurt disk I/O.

BTW if there is a gender table we could add another row for "Unable to determine the true sexual origin or state of the individual".

RC_Cleland
  • 2,274
  • 14
  • 16
  • Suppose you were to have a "perfect computer" -- limitless memory (ram + disk), super-fast. Would you still design this way? If yes, so be it. But, if not, than you are designing around hardware limitations, not around business requirements. In the last ~15 years disk space of an average PC increased more than 1000 times, memory at least 250 times. – Damir Sudarevic Dec 05 '10 at 16:11
  • 1
    @Damir Sudarevic : Most certainly you ought to design the database without nulls even if you have a "perfect computer". The reasons are to ensure correctness, not to optimise of hardware. Nulls cause incorrect results and don't accurately model reality therefore as a rule they should be avoided. – nvogel Dec 06 '10 at 12:39