Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null vs. Zero for Primary Key
Message
 
 
À
19/01/2011 17:15:56
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
01496573
Message ID:
01496659
Vues:
70
>I want to thank all of you for your input. I meant Foreign Keys, as most of you realized. My coworkers and I unanimously preferred zeroes over nulls, and we decided to post this to get further thought on the matter.
>
>
>Unless you're storing an "unused" value in your master/dimension tables, then I don't understand the "zero vs null" issue.

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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform