For functional dependency, the second normal form 2NF which was introduced by E.F.. In this paper, we give a new necessary and sufficient condition for an arbitrary relation scheme is in
Trang 1T,!-p chi Tin hoc va Dieu khien hqc, T.16, S 2 (2000), 1-4
LUONG CAO SON, VU DUC THI
Abstract For functional dependency, the second normal form (2NF) which was introduced by
E.F Codd has been widely investigated both theoretically and practically In this paper, we give
a new necessary and sufficient condition for an arbitrary relation scheme is in 2NF and its set of minimal keys is a given Sperner system
Now we start with some necessary definitions, and in the next section we formulate our results Definition 1 Let r = {hI, ,hn} be a relation over R, and A, B ~ R. Then we say that B
functionally depends on A in r (denoted A L; B) iff
r
Let F; = {(A, B) : A, B ~ R, A .L, B} F; is called the full family of functional dependencies
r
ofr Where we write (A, B) or A - > B for A ~ B when r ,I are clear from the next context
r
Definition 2 A functional dependency (FD) over R is a statement of the form A - > B, where
A, B ~ R The FD A - > B holds in a relation r if A ~ B. We also say that r satisfies the FD
r
A B •
Definition 3 Let R be a finite set, and denotes P(R) its power set Let Y ~ P (R) X P(R). We say that Y is an I-family over R iff for all A, B, C, D ~ R
(1) ( A, A ) E Y,
(2) (A,B) E Y, (B,C) E Y = (A,C) E Y,
(3) (A, B) EY, A ~ C, D ~ B => (C, D) E Y,
Clearly, F; is an I-family over R
It. is known [1 ]that if Y is an arbitrary I-family, then there is a relation rover R such that
F ; =Y
Definition 4 A relation scheme s is a pair (R , F ) , where Ris a set of attributes, and F is a set of FDs over R Let F+ be a set of all FDs that can be derived from F by the rules in Definition 3.
Clearly, in [ 1 ] if s = (R, F) is a relation scheme, then there is a relation rover R such that F; = F Such a relation iscalled an Armstrong relation ofs.
Definitio 5 Let r be a relation, s = ( R, F ) be a relation scheme, Y be an I-family over R, and
A ~ R Then A is a key of r (a key of s, a key of Y) if A ~ B (A R • E F+, (A, R) E Y) A is
r
a minimal key of r(s, Y) if A is a key of r(s, Y) and an proper subs t of A is not a key of r(s, Y).
Den te K r, (K., Ky) the set of all minimal keys of r(s, Y)
Clearly, K n K •• Ky are Sperner systems over R
Trang 2Definition 6 Let K be a Sperner system over R. We define the set of antikeys ofK, denote by
K- I, as follows:
K- I = {A cR : (B E K) = (B rt A) and (A C C) => ( :lBEK)(B ~ Cn
It is easy to see that K-I is also a Sperner system over R.
It isknown [4]that ifK is an arbitrary Sperner system plays the role of the set of minimal keys
Definitions 7 Let I ~ P(R) " REI, and A, BEl => An BEl Let M ~ P (R). Denote
n t in M, since it is the intersection of the empty collection of sets
In [6]it is proved that N is the unique minimal generator of I Thus, for any generator N' of I
we obtain N ~ N'.
Definition 8 Let r be a relation over R, and E; the equality set of r, i.e E; = {Eij : 1 ~ i<j ~
iR \ } , where E i) = {a ER : hda) = hj(an Let TR = {A E P(R) : :lEij = A , no ::lEpq : A C Epq}.
The T R is c lled the maximal equality system of r
Definition 9 Let r be a relation, and K a Sperner system over R We say that r represents 'K if
K , = K
The following theorem is known in [10]
Theorem 1 Let K b e a relation , a nd K a Sperner s ystem o v er R r pres ents K iff K- I = TrJ
w here T; is the maximal equality sy s tem of r.
From Theorem 1 we obtain the following corollary
s i K; =K Then r represents s iff K; I=Tr, where T; is the maximal equality system of r
In [9]we proved the following theorem
Theorem 2 Let r = {hI, ,h m} be a relation, and F and f-family over R T hen F; = F iff for
every A E P(R)
HF(A) _ { _ A~Eng s,
R
if : :lE g: A ~ e;
o therwi s e ,
w h e r e HF(A) ={A E R: (A, {a}) E F} and E; is the equality set of r.
Definition 10 Let s = ( R, F ) be a relation scheme overR We say that an attributet a is prime if
b long to a minimal key of s, and nonprime otherwise Then s=: ;(R,F ) is in 2NF if K' -> { a } f/ : F +
for each K E K., K' cK , and a is nonprime
If arelation scheme is changed to a relation we have the definition of 2NF for relation
Definition 11 [5] Let P be a set of all f-families over R. An ordering over P is defined as follows:
For F, F' E P let F ~ F' iff for all A ~ R, HF,(A) ~ HF(A) , where HF(A) = {a E R :
( A, {a}) E F}.
Theorem 3 [9]Let K be a Sperner syst e m over R Let :
{ n B if:: l B : A ~ B, L(A ) = A ~ B
Trang 3SOME OBSERVATIONS ON THE SECOND NORMAL FORM 3
such Kpl =K t h en F ::; F ' hol ds
Now we present a new necessary and sufficient con ition for an arbitrary relation scheme is in 2NF and its set of minimal keys is a given Sperner system
Let s = ( R, F) be a relation scheme over R From s we construct Z(s) = {X+ : X ~ R}, and
compute the minimal generator N of Z(s) We put
It is know [1] that for a given relation scheme s there is a relation r such that r is an Armstrong relation of s On the other hand, by Corollary 1 and Theorem 2 the following proposition is clear:
Proposition 1 Let s=( R , F) b e a r el a t on sc h e me over R Then:
« ;» =T•.
Let K be a Sperner system over R Denote T(K- 1) = {A: : :3B E K - 1, A ~ B} and K n ={a E
R :no : :3AE K, a EA} tc; is called the set of nonprime attributes of K
Theorem 4 Let s= ( R, S) be a relation scheme and K a Sperner system over R Denote M(K) =
w he re K n is t h e se t of n onpri me a t r i b t es of K.
1 we obtain Z( s ) ~ {R} UT(K- 1) It is easy to see that if tc; = 0 then {R} UK - 1 UI ~ Z( s ).
Assume that K n i - 0. According to Proposition 1, K = K and by definition of Z( s) we have
According to definition of closure we obtain (B - a)+ = C+ = B Hence, a E C+ holds Thus,
C - + {a} E F+, a ¢C hold This conflicts with the fact that s is in 2NF Consequently, we obtain
{R} UK-1 u I ~ Z(s)
Now, assume that we have (*). By definitions of Z(s) , K- 1, T(K-l) , and by Proposition 1 we
obtain K. =K If K n =0 then s is in 2FN Assume that K n i - 0 Suppose that there is a D c A
B - a C C+ =( B - a ) l. This conflicts with the fact that I ~ Z(s) Thus, s is in 2NF The proof is
[1] Armstrong W.W., Dependen c Structures of Databa s e Relationship s, Information Processing
74, Holland Publ Co., 1974,p.580-583
[2] Beeri C., Bernstein P.A., Computational problems related to the design of normal form r ela-tional schemes, ACM T ran s on D at ab as e Sy s t 4 (1) (1979) 30-59
[3] Beeri C., Dowd M., Fagin R., Staman R., On the structure of Armstrong relations for functional dependencies, J ACM31(1) (1984) 30-46
Trang 4[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[1 ]
[15]
[16]
[17]
[18]
[19]
[20]
[21]
[22]
[23]
LUONG CAO SON, VU DUC THI
Bernstein P A., Synthesizin third normal form relations from functional dependencies, ACM
Trans o n Database Synt. 1 (1976) 277-298
Burosch G , Demetrovics J Katona G.0., The poset of closures as a model of changing
Demetrovic J , On the equivalence of candidate keys with Sperner system, Acta Cybernetica 4 (1979) 247-252
Demetrovics J , Logical and structural investigation of relational datamodel, MTA - SZTAKI
Demetrovics J Hencsey G., Libkin L 0., Muchik I.B., Normal form relation scheme: a new
characterization, Manuscript
Demetrovics J., Thi V.D., Some results about functional dependencies, Acta Cybernetica
Hun-g ar y 8 (3) (1988) 273-278
Demetrovics J., Thi V.D., Relatons and minimal keys, Acta Cybern e tica Hungary 8 (3) (1998)
279-285
Demetrovics J , Thi V D., On keys in the relation datamodel, Inform Process Cybern ElK
24 (10) (1988) 515-519
Demetrovics J , Thi V.D Normal form and minimal keys in the relational datamodel, Acta
Demetrovics J , Thi V D., Some results about normal forms for functionla dependency in the ralational datamodel, Discrete Applied Mathematics 69 (1996) 61-74
Gottlo G , Libkin L., Investigations on Armstrong relations, dependency inference, and
ex-clused functional dependencies, Acta Cyb e rnical Hungary 7 (4) (1990) 385-402
Lucchesi C L., Osbors S.L., Candidate keys for relations, J C omput Syst Scien. 17 (2)
(1978) 270-279
Maier D., Minimum cover in the relational database model, JA C M 27 (4) (1980) 664-674
Mannila H., Raika K.J , Design by example: an application of Armstrong relations, J Comput.
Mannila H., Raiha K.J., Practical algorithms for finding prime attributes and testing normal
Osborn S.1 Testing for existence of a covering Boyce Codd normal form, Infor Proc Lett
8 (1) (1979) 11-14
Thi V D., Investigation on Combinatorial Characterzation Related to Functional Dependency
in the Re l a ti ona l D a ta mod el (in Hungarian), MTA-SZTAKI Tanulmanyok, 191 (1986) 1-157,
Ph.S Dissertatio
Thi V.D., Minimal keys and antikeys, Acta Cyberni c a Hungary 7 (4) (1986) 361-37l.
Thi V D., On antikeys in the relational datamodel (in Hungarian), Alkalmazott Matematika i Lapo k 12 (1986) 111-124
Tsou D.M., Fischer P C., Decomposition of a relation scheme into Boyce-Codd normal form,
SI G A C T NEW S 14 (1982) 23-29.
Received December 14, 1998