Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null vs. Zero for Primary Key
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01496573
Message ID:
01496664
Views:
55
I thought the issue was zero vs. null. If it was just in the context of a FK, my averaging example was not applicable. Null is still the correct value for the FK.

>What it has to do with zero in FK?
>
>>You don't? I am not badgering you but that is not the kind of thing I would expect a SQL expert (which you are) to say. Zero is a value. Null means unknown. One area where the distinction is crucial is in group computations. Let's say you want average sales last month for all the salespeople. If one of them sold zero, that should be part of the computation. If for whatever reason one of them has a null value for sales, that should not be included.
>>
>>Maybe there is something I am missing. I have a good understanding of relational databases as conventionally taught but do not claim to be an expert. There are always things I can learn.
Previous
Reply
Map
View

Click here to load this message in the networking platform