The keys play important roles in the relational databases design theory.. The re ult~ of keys have been widely investigated, they can be seen in [4,5,6].. In [4] to find minimal keys of
Trang 1NGUYEN HOANG SON
Journ a l of Comput e r Sci e nce a nd Cybernetics , Vol 20 , No.4 (2004) , 368 - 372
SOME RELATED PROBLEMS
D epar t men t o j M at h e m a t ic s , C oll ege oj S ci ence s , Hue Univ e r ity
Abstract The keys play important roles in the relational databases design theory The re ult~ of keys have been widely investigated, they can be seen in [4,5,6] In [4] to find minimal keys of relation scheme S = (U, F), we translate relation s heme Sto relation scheme S,which has a less number of attributes and shorter functio al dependencies :n this translation relation s heme, finding minimal keys becomes much more siEIple The aim of this article is to investigate some propertie of the translation relation scheme S and some related problems.
Tom t~t Khoa dong vai tro quan trong trong ly thuyet thiet ke C(J so dir lieu quan he. Cac ket qui ve khoa da diroc nghien ciru kha nhieu, co the tirn thay cac ket qui nay tro g [4,5,6] Trong [4] de tirn khoa toi teu cua SO" d quan h~ S = ( U, F) , chung ta chuyen dich SO" do quan he S ve so do quan h~ S, Ia SO" do co it thuoc tfn h n va cac phu thuoc ham ng~ gon ho'n Trong so do quan he chuyen dich nay viec tim kh6a toi tieu to' nen don gian hon Muc dich cua bai bao nay la n hien ciu mot so tinh chat cua sO'do quan h~ chuyen dich S va mot so van ae lien quan
1. INTRODUCTION Let us give some ne essary defini o s and resuls that are used in the next section The concepts are given in this secton can be found in [1,2,3,5]
Definito 1.1. Let U = {al,"" an} be a n nempty finite set of attributes A functi nal dependency (FD) is a statement of form X -+ Y, where X, Y S;;; U The FD X -+ Y holds in
a relatio R = {hI, ,h m } over U if
(Vhi' hj E R)((Va E X)(hi(a) =h j(a)) =} (V b E Y ) hi ( b) =h j(b ) ))
We also say that R satisfies the FD X -+ Y
Let FR be a family of all FDs that h lds in R
Definition 1.2 Then F = FR satisfies
(F1) X -+ X E F ,
(F2) (X -+ Y E F, Y -+ Z E F) = } (X -+ Z E F),
(F3) (X -+ Y E F, X S;;; V, W S;;; Y) =} (V -+ W E F),
(F4) (X -+ Y E F, V -+ W E F) =} (X uV -+ Y uWE F)
A family of FDs satisfying (F1) -(F4) isc lled an J-famil over U
Trang 2TRANS L AT I ON O F RELATIO N SC H EMES AN D S O ME RELATED PROBLEMS 369
Clearly, F R is an f-family o er U. It is known [1] that if F is an arbitraryf-amily, then
there is a relation Rover U such that F =F
Given a family F of FDs over U, there exists a uniq e minimal ffamily F + that contains
F It can be seen that F+ contains all FDs which c n be derived from F by the rules (Fl)
(F4)
over U
Denote X + = {a EU : X -+ {a} E_Z '+} X+ is c lled the closure of X o er S
It is cle r that X -+ Y E F + if Y < ;;;; X +
Definition 1 3 Let S =(U, F) be a relatio scheme over U, K <; ; ;; U K is called a minimal
key of S , if it satisfies the following two conditions:
(1) K -+ U E F + ,
(2) jj K' c K such that K' -+ U E F +
The subset K which satisfies only (1) is called a key of S.
2 RESULTS
Let S = (U, F) be a relatio scheme, where U = {aI, a2, ,an} is a set of attributes, and F = {Li -+ R; : L R; < ;; ; U, L, nR ; = 0,i= 1,2, ,m} is a set of FDs over U.
L = U i.; R = U u;
The fo owing theorem is known [6]
Th e or e m 2 1 ([6]) L e t S = (U, F ) b e a r e lation schem e ov e r U and K b e a minimal k y of
S Th e n
(U - R ) <;;; ; K < ; ;; ; (U - R ) U (( L nR) - a( L , R)),
wh ere a( L , R ) = ( L n R ) n ( L - R)+.
D e finition 2.2 Let S = (U, F) be a relatio scheme over U Set U = (L nR) - (L - R) +,
called a translati n relation scheme of Saver U
Th e orem 2.3 L e t S = (U, F) be a r e lation s c h e m e ov e r U , S = (U, F) is a trans l a t ion
re l ati o n sc h e m e of S over U, and K < ;;; ; U. Th e n , K is a minimal k y o f S if a nd on l y if
K U (U - R ) is a minima l k y of S.
Den te Ks the set of all minimal keys of S. From Theorem 2.3 we obtain the following
Corollary 2 4 I f K E K S ' th en t h e r e e xists K ' E Ks su c h that K <; K '
Corollary 2.5 I f U - R =0 th en K S =Ks·
The following corollary is also clear
Trang 3L , -+ R E F , n ; -+ {a} EF + (2)
r Corollary 2 6 L e t S = ( U;F ) be a re l a tion sc h m e , w h re U = {K I, K2, ,K m} and
F = {K I -+ U , K2 -+ U , , K m -+ U} T h en, U = u , F = F and h e ce K s = K s ·
R e ma rk 1 For every L~ -+ R ~ E F , ( L D t = Uis not h ld, ie L isnot the key of5and so it is not the minimal key For example, we consider F = {{ a , b } -+ { c}, { d} -+ {a } , { } -+ {b , d}}
over U = {a,b , c, dl Then, we ha~e L = { a, b , c , d} , R = { a , b , c , d} , L nR = {a , b ,c, d} , L
-R = 0, and hence U = { a ,b , c , d} , F = {{ a ,b} -+ { c } , {d} -+ {a} , { c } -+ {b , d}} It isobvious
that, with a FD {d} -+ {a } E F we have {d} ± = { a, d} i - U.
F
In translation relatio schemes 5 = (U, F) , FDs and attributes have some rather intere
st-ing pro ertes as follows
Th e or e m 2.7 L e t 5 = (U , F ) b a t rans l a t o r e l a t ion sc h m e o f S = (U , F) tr e n U Th e
(i) I f a EUI t h n th e r e ex ists L ~ -+ R~E F su c h that a ER~.
(ii) I f a EU , t h n th er e e xis t s L j -+ Rj E F su c h that a ELj.
Proof. (i) Since a E U , it is obvio s that a E L nR. Thus there exists a FD L , -+ R F
such that a E R Therefore we have a E R n U , i.e R n U i - O. Furthermore, t ; nU i - O
In fact if L,n U = 0, then
or
On the other han , we have
From (1) and (2) we have L - R -+ { a } E F + , i.e a E (L - R) + , which contradicts the
hypothesis a EU Hence L ,n U i - O Set L = L ,n U , R ~ = R n U we have (i), i.e there
exists a FD L ~ - + R ~E F such that a E R ~
(i) Because a EU , we have a EL nR , i.e there exists a FD L j - + R j EF such that a EL
Therefore a E L j n U
Moreover, we have
In fact, according to the algorithm for finding the closure L 1 of L j with (L j ) ~ ) = L (L j n
U) - =L j nU , we have (L) ( O ) n U C(L · nU) ( O )
is trivial Assume that
( L j)~ ) n U ~ i n U )~). (4)
Then
-( L j)F nU - ((L j ) F U {b : t; -+ R E F,b E R , L i ~ (Lj) F }) nU
((L j ) F nU) U({b i ; -+ R E F, b E R, t; ~(Lj) F }nU)
-~ ( t ,nU) p U ({b. t ; -+ R E P , b E R , L i ~ (L j )F }nU).
Trang 4TRA NS LAT I O OF R E LAT I O SC H EMES A D S O ME R E LAT E D P R O BL EMS 371
On the other han , from assumption (4) and t : ~( t , )~) we have
L· nU C (L)(k) nU C ( L · nU)(k)
So
-( L j)F nU <;;; ( L j nU )p U ({b : t ; -+ n ; E F , b E t u i ; <;;; (Lj)F } nU)
<;;; u ,nU) ~+ 1 )
Hence, (3) has been proved, i.e
Moreo er t., -+ n , E F, th s R j <;; ; ( L j)t. Conseq ently
It shows that
-t., nU -+ u , nU E F
Set L j = L j n U, R j = R j n U, we have (ii), i.e there exists a FD Lj -+ R j E F such that
a EL j.
From Theorem 2.7, we have the fo owing coro aries
Corollary 2.8. For eac h L ~ -+ R ~E F , if a E R ~ then a EL j, w h ere L j -+ Rj EF.
Corollary 2 9 For each L ~ -+ R ~E F , if a E L ~ then a E R j, w h ere L j -+ R j E F.
Theorem 2.10 Le t S = C! !,F ) be a re l ation sc h eme over U a n S = (U, F) b e a t rans l a t on
re l a t ion scheme of S a ver U Then
(i) I f L i -+ R ; E F such th a t L , n U = 0 , t h en
-V a E U : a t/ R ; and henc L ,nU -+ R ; n U t/ F
(ii) I f L , -+ H i E F suc h t h at R ; n U = 0 , th en
V a E U: a t/ t ;and henc l « nU -+ t u r.o «F
P ro o ] (i) Since L , n U = 0, we have L , <;;; (L - R)+. Th s
L - R -+ L , E F +
Assume a E R s, i imples that R ; -+ { a } E F + On the other hand, we have L i -+ ~ E F
Hence, by (F2) in the Definito 1.2 we have
L - R -+ { a } E F +,
Trang 5The theorem is proved •
which contradicts the h p thesis a E U. Thus a rf Ri , and R ; n U =0 , i.e
t ; nU - * n ; nU rf F (ii) Suppose a E L i, which implies that a E L ,n U. With the similar pro ement like Theorem
2.7, we also obtain
which contradicts the hypothesis R ; n U = 0 So a r L i, and hence we have
t; n U - * n ; n U r F.
Note that, if an attrib te a E U appears only in eiher the left side or the rig t side or
then a rf U
REFERENCES
[1] Armstrong W W., D epend e ncy Structure of D atabas e R elationship , Information Process
-ing 74, North-Ho an Pub Co , 1974, 580-583
[2] Codd E F., A relatio al mo el for large shared data banks, Comm ACM 13 (1970)
337-387
Balanced relation schemes and the problem of key representation, J I nf P roc e ss Cyb e rn.
E l K 23 (1987) 81-97
[4] Son N.H Hung N.V S me result s ab ut keys of relatio schemes, J ourna l of Comput e r
S c ience an d C y b e rne tic s 18 (2002) 2 5-289
[5] Thi V D Minimal keys and Antikeys, A c t a C yb er n e t ic a 7 (1986) 36 -371
[6] Thuan H Bao L V., Some results about key of relatio al schemas, Ac t a Cy b e rneti c a
(1985) 99-113
R e ceive d on Au g us t 10 , 2 004
R evise d on D ece mb er 13, 2004