First normal form: Difference between revisions

Content deleted Content added
Make introduction more readable
Added a precise definition of 1NF as a separate section
Line 12:
 
Most relational database management systems do not support nested records, so tables are in first normal form by default. In particular, [[SQL]] does not have any facilities for creating or exploiting nested tables. Normalization to first normal form would therefore be a necessary step when moving data from a hierarchical database to a relational database.
 
== Definition ==
A [[relation (database)|relation]] is in first normal form when no [[attribute ___domain]] has relations as elements.<ref>Codd, E.F (1972). "Further Normalization of the Data Base Relational Model". p. 27</ref>
 
In a [[finitary relation|relation]], each attribute has a [[data ___domain|___domain]] which is the set of possible values. (For example the set of integers in a given range.) But a ___domain can be any set, hence it might also contain relations as elements.
 
A tuple contains exactly one element from the attribute ___domain per attribute, but if the ___domain contains relations, this value would be a relation which in turn may contain multiple tuples and attributes.
 
A ___domain which contains relations is called a [[finitary relation|nonsimple ___domain]], while a ___domain which does not contain relations is called a simple ___domain. Normalization to 1NF is thus a process of eliminating nonsimple domains from all relations.
 
E. F. Codd uses the terms ''atomic'' and ''nondecomposable'' for elements of simple domains<ref>Codd, E.F (1970). "A Relational Model of Data for Large Shared Data Banks". Communications of the ACM. Classics. 13 (6): 377–87. p. 380</ref>. Thus an atomic value is any value which is not a relation. Such values vannot be decomposed using just [[relational algebra]] operators like selection or projection.
 
== Rationale ==