Bonjour,
![Citation](https://forum.developpez.be/images/misc/quote_icon.png)
Envoyé par
escartefigue
Il ne faut JAMAIS stocker une liste de valeurs dans une même colonne d'une même ligne !
C'est un viol de première forme normale qui compromet l'intégrité de la base de données, rend les requêtes comple(xe)s, les performances désastreuses, la fiabilité également... Bref tout ce qu'il ne faut pas faire.
Capitaine, tu as parfaitement raison, à ceci près que si la liste de valeurs est du type qui convient (encapsulée dans du varchar par exemple), alors stricto sensu la 1NF est respectée. ![:D](https://www.developpez.net/forums/images/smilies/icon_biggrin.gif)
Je rappelle ce que dit le Maître (Chris Date) à ce sujet dans Database Design and Relational Theory, Second Edition) (page 66) :
Definition (first normal form): Let
relation r have attributes
A1, ...,
An of types
T1, ...,
Tn, respectively. Then
r is in first normal form (1NF) if and only if, for all tuples
t appearing in
r, the value of attribute
Ai in
t is of type
Ti.
To say it in different words, 1NF just means that each tuple in the relation in question contains exactly one value, of the appropriate type, for each attribute.
Observe in particular, therefore, that 1NF places absolutely no limitation on what those attribute types are allowed to be. They can even be relation types! That is, relations with relation valued attributes─RVAs for short─are legal (you might be surprised to hear this, but it’s true). An example is given in Figure 4-1 below.
![](https://www.fsmwarden.com/developpez/RVA_image70.png)
Et il ajoute (page 67) :
Normalized and first normal form mean exactly the same thing─all normalized relations are in 1NF, all 1NF relations are normalized. The reason for this slightly strange state of affairs is that normalized was the original (historical) term; the term 1NF wasn’t introduced until people started talking about 2NF and higher levels of normalization, when a term was needed to describe relations that weren’t in one of those higher normal forms.
Capitaine, tu sais que le nombre de définitions folkloriques est particulièrement élevé.
Par exemple, et pour la petite histoire, à la page 167 de son ouvrage, Chris Date écrit :
... a colleague recently drew my intention to the following excerpt from one of IBM’s reference manuals for its DBMS product DB2:
First normal form: A relational entity satisfies the requirement of first normal form if every instance of an entity contains only one value, never multiple repeating attributes. Repeating attributes, often called a repeating group, are different attributes that are inherently the same. In an entity that satisfies the requirement of first normal form, each attribute is independent and unique in its meaning and its name.
Example: Assume that an entity contains the following attributes:
EMPLOYEE_NUMBER
JANUARY_SALARY_AMOUNT
FEBRUARY_SALARY_AMOUNT
MARCH_SALARY_AMOUNT
This situation violates the requirement of first normal form, because JANUARY_SALARY_AMOUNT, FEBRUARY_SALARY_AMOUNT, and MARCH_SALARY_AMOUNT are essentially the same attribute, EMPLOYEE MONTHLY_SALARY_AMOUNT.
─DB2 for z/OS Administration Guide IBM Form No SC27-8844-2
Je te laisse deviner quel est le collègue qui attira l’attention de Chris...![:P](https://www.developpez.net/forums/images/smilies/icon_razz.gif)
Paradoxalement, n’en déplaise à IBM, sa table (appelons-la EMPLOYEE) respecte la cinquième forme normale ! En effet, cette table a pour seule clé candidate {EMPLOYEE_NUMBER}, et chaque dépendance de jointure à laquelle elle satisfait est une conséquence de cette clé.
Fermez le ban.
Partager