• GSquared (11/18/2009)


    Interesting problem, but easily solved by adding a foreign key constraint to the Orders table, referencing the OrdersItems table (a join table between Orders and Items).

    Then how would you insert a new Order or populate the OrderItems table?

    Null does not (accurately) represent the property of being unknown. That's just your assumption or convention, not anything actual or implied by standard SQL. That is demonstrable by the straightforward fact that x = x is True in mathematics and reality if x is unknown but is NOT true in SQL.

    If you are seriously going to use quantum mechanics as a criteria for the design of database systems then I have nothing much more to say! If you are really going to be that silly then you would have to disallow ALL deterministic results of any kind from the database wouldn't you? No, don't bother to answer that... :crying:

    I didn't say null equals nothing. What I meant was that SQL wrongly returns a null as the sum of an empty set, instead of the mathematical and real world answer of zero.