0
$\begingroup$

From Database System Concepts, by Silberschatz, Korth and Sudarshan :

A domain is atomic if elements of the domain are considered to be indivisible units. We say that a relation schema R is in first normal form (1NF) if the domains of all attributes of R are atomic.

A functional dependency A →B is called a partial dependency if there is a proper subset C of A such that C → B. We say that B is partially dependent on A. A relation schema R is in second normal form (2NF) if each attribute X in R meets one of the following criteria:

• It appears in a candidate key.

• It is not partially dependent on a candidate key.

If I am correct, the definition of 1NF in the book is the same as in Wikipedia which says

A relation is in first normal form if and only if the domain of each attribute contains only atomic (indivisible) values, and the value of each attribute contains only a single value from that domain.

Is the definition of 2NF in the book the same as in Wikipedia which says

a relation is in 2NF if it is in 1NF and no non-prime attribute is dependent on any proper subset of any candidate key of the relation.

?

Specifically:

  1. I don't think the definition of 2NF in the book requires a relation schema being in 1NF, and I wonder if I am wrong and why?
  2. While 2NF is related to functional dependency, is 1NF related to functional dependency between attributes in a relation schema? (I don't see the definition of 1NF involves functional dependency.)

  3. Does the definition of 2NF in Wikipedia require that there can't be duplicate rows?

    Does the definition of 2NF in Wikipedia rely on a different definition of 1NF? For example, see Does 1NF require that there can be no duplicate rows?

Thanks.

$\endgroup$
3
$\begingroup$

I will focus on questions 2 and 3, mainly by recalling a little bit of history of the Relational Data Model.

The first foundamental paper on the Relational Model was published in 1970 by the Turing Award Edgar F. Codd, Codd, E. F. “A Relational Model of Data for Large Shared Data Banks.” Communications of the ACM 13, no. 6 (June 1, 1970): 377–87. (bibliographic description, search pdf).

In that paper it is expressed clearly that relations are sets:

The term relation is used here in its accepted mathematical sense. Given sets S1, S2, ... , Sn, (not necessarily distinct), R is a relation on these n sets if it is a set of n-tuples each of which has its first element from S1, its second element from S2 , and so on ...

So, the requirement of the unicity of the tuples precedes each possible definition of normal form.

Noting that the Codd’s definition leaves open the possibility that the elements of the domains (the Si) can be complex, for instance repeated, Codd introduced the first normal form (1NF) in a 1972 paper: “E. F. Codd (Oct 1972), Further normalization of the database relational model, Courant Institute: Prentice-Hall, ISBN 013196741X,”. In such paper it is said that:

A relation is in first normal form if it has the property that none of its domains has elements which are themselves sets.

As you have noted, this has nothing to do with functional dependencies, neither with other forms of dependencies (multivalued, join, etc.), and for this reason, it has been considered an essential requirement of the “normal” Relational Data Model. Other data models, the so called non-1NF model, abandon this requirement, and constitute a sort of bridge towards late object-oriented data model (but this is another subject...)

Only later, C.J. Date, a collaborator of Codd, wrote in the paper: “What First Normal Form Really Means,” in “Date on Database: Writings 2000-2006. Berkeley, Calif., Apress (2006)”:

A table is in first normal form if and only if it is "isomorphic to some relation" ... There are no duplicate rows...."

The emphasis is mine, note that he’s talking about tables, not relations, specifying what are the characteristics that tables should have to be considered relations.

So, to summarize:

  1. The relational model is based on the mathematical concept of relation, which is a set.

  2. The 1NF has nothing to do with functional dependencies, and in the original definition has only to do with complex values (i.e. relations) inside tuples.

  3. The other normal forms are defined ony in the context of the relational data model, in which relations are set.

  4. Relational Database Management Systems (RDBMS) manage “tables”, which are loosely modeled on the mathematical concept of relation as defined in the Relational Data Model, but the normalization theory (functional dependencies, other kind of dependencies, normal forms, etc.) is only partially applicable to them, since it is defined only on the Relational Data Model.

$\endgroup$
2
$\begingroup$

You have asked multiple questions and it becomes very difficult to focus on each questions.

So, I will concentrate on your original questions: Does 2NF require 1NF?

Theoretically, when you translate your ER-Diagram to Relational model you normally achieve 1NF because you are required to have separate table(s) for every multivalued table(s).

Functional dependency play a active part in 2NF (and beyond) because it dictates that there should be no partial dependency. That is, if proper subset of candidate key determines non-prime attribute, it is called partial dependency.

Now, can you tell me that how you will resolve for 2NF if values of your attributes are not atomic? How will you check value(s) of some column A to value(s) of some column B for dependency if you have multivalued or composite attribute in it? In functional dependency, we should be able to map each single value of attribute X to each single value of attribute Y.

1NF is not only necessary for 2NF, but 3NF, BCNF and beyond.

So, yes it does required for 2NF to hold it should be in 1NF and partial dependency should be eliminated.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.