This presentation is the property of its rightful owner.
Sponsored Links
1 / 91

第五章 RDB ( 关系数据库) 5.1 函数依赖 FD 5.2 闭包及其运算 5.3 关系模式分解 5.4 关系模式规范化 NF PowerPoint PPT Presentation


  • 71 Views
  • Uploaded on
  • Presentation posted in: General

第五章 RDB ( 关系数据库) 5.1 函数依赖 FD 5.2 闭包及其运算 5.3 关系模式分解 5.4 关系模式规范化 NF. 问题 R ( Sh,Sn,Sex,Ch,Grade ) Sh Sn Sex Ch Grade S1 丁一 m c1 90 S1 丁一 m c2 89 S1 丁一 m c3 88 S1 丁一 m c4 87 S1 丁一 m c5 95.

Download Presentation

第五章 RDB ( 关系数据库) 5.1 函数依赖 FD 5.2 闭包及其运算 5.3 关系模式分解 5.4 关系模式规范化 NF

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Rdb 5 1 fd 5 2 5 3 5 4 nf

RDB (

5.1 FD

5.2

5.3

5.4 NF

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R ( Sh,Sn,Sex,Ch,Grade )

Sh Sn Sex Ch Grade

S1 m c1 90

S1 m c2 89

S1 m c3 88

S1 m c4 87

S1 m c5 95

PK: ( Sh,Ch )

insert,update,delete ,

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R1 ( Sh,Sn,Sex ) PK:Sh

Sh Sn Sex

S1 m

R2 ( Sh,Ch,Grade ) PK: (Sh,Ch)

Sh Ch Grade

S1 c1 90

S1 c2 89

S1 c3 88

S1 c4 87

S1 c5 95

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

  • D

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

X>Y

X1

X2

X3

X4

Xn

Y1

Y2

Y3

Yn

XY,YX

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R(Sh,Sn,Sex,Ch,Grade)

PK: (Sh,Ch)

(Sh,Ch) Sn / Sex / Grade

Sh Sn / Sex

Sn/Sex(Sh,Ch) Pfd

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R(Sh,Sn,Sex,Ch,Grade)

PK: (Sh,Ch)

(Sh,Ch) Sn / Sex / Grade

(sh,ch) Grade

Grade(Sh,Ch) Ffd

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

Ex. S (Sh , Bj , Bad)

ShBj , BjBad

Sh Bad

Sh Bj Bad

BadSh tfd

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R (U,F) Relation

U Property Set

F FD Set

Pk: Primary Key

Fk: Foreign Key

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

W ( D GNABCEF )

PkPrimary Key

fFD

pFD

tFD

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

(D,G) C

fFD

A B

tFD

EF

W( D GN

ABC

EF )

FD

PK: (D,G)

(D,G)N/A/B/C/E/F

pFD

G N/A/ E

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

f

(D,G)

C

FD

W( D GN

ABC

EF )

PK: (D,G)

p

N/A/E

(D,G)

t

G N/A/ E

B

G

AB

FD

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

1R1

E F G

1200

1200

800

800

R1EFG

1 R1

2

3

4R1

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2. RABCDEF

1 R

2

3

4R

P1

P1

P1

P2

P2

11

12

13

11

14

4

6

15

6

18

9805

9805 9805 9811 9811

9902

9902 9902 9912 9912

250

200

180

250

150

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2a. RABCDEF

1R1NF

2 R

3

4

5R

*6

P1

P1

P1

P2

P2

11

12

13

11

14

4

6

15

6

18

9805

9805 9805 9811 9811

9902

9902 9902 9912 9912

250

200

180

250

150

YES

AB

ABD AD B F

A D D E A E

YES

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

3.R(Sh,Ch,Grade,Tname,Taddr),

1) R

3)

4)

5)R

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

3a. R(Sh,Ch,Grade,Tname,Taddr),

1)R1NF

2) R

3)

4)

5)R

*6)

YES

sh,ch

shch Tn ch Tn

ch Tn TnTa

YES

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

4.RA,B,C,D,EA B C D E 1101 01 1500 Li 1102 01 1000 Li 1103 01 2000 Li 1101 02 1800 Wu

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

(1) R1NF(2) R(3) (4) (5)R*(6)

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

4a.RABCDEABCDE(1) R1NF

(2) R

(3) (4) (5)R*(6),

Yes

PK:AB

ABD BD pFD

ABE DE tFD

Yes

R1(A,B,C) R2(B,D) R3(D,E) 3NF ABE DE tFD

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

FD Armstrong

R( U )

xy

xy

xzyz

xy

yz

xz

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

FD Armstrong

R(U)

xy

xz

xyz

xy

xz

xyz

xy

ywz

xwz

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

5.2 X+

X

86

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

5.2 X+

R ( U,F )

U={A,B,C,D,E,I}

F={AD,ABE,BIE,CDI,EC}

? (AE)+

AD

CDI

EC

AEACDEI

AEAE

AEAC E

D

(AE)+=ACDEI

86

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R ( U,F )

U={A,B,C,D,E,I}

F={AD,ABE,BIE,CDI,EC}

? (AE)+

AEAE (AD, EC) AEACDE

(CDI) AEACDEI

AE

(AE)+

(AE)+=ACDEI

86

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

?

AE

. : (AE)+

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

R(U,F)

U={A,B,C,D,E,P}

F={AB,CP,EA,CED}

? (CE)+ , C+, E+

CECE (CP, EA,CED) CEACDEP

(AB) CEABCDEP=U

CC (CP) CCP

EE (EA) EAE (AB) EABE

(CE)+=U (C+!=U, E+ !=U) (C,E):CK

(only)

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

CK

[Candidate Key]

;

.

CK

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

?CK

F Fmin

1. FD(only)CK

2. FD,CK

3. FFDCK

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

1. R(U,F) U={C,G,N,S,T}

F={CT,CSG, SN} ? Candidate Key

2. U={A,B,C,D,E,G}

F={AB,CA,CDE,DG} ? Candidate Key

3. R(U,F) U={A,B,C,D,E}

F={AD,ED,DB,BCD,DCA}

? Candidate Key

4. R(U,F) U={A,B,C,D,E}

F={ABC,CDE,BD,EA}? Candidate Key

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

1. R(U,F) U={C,G,N,S,T}

F={CT,CSG, SN}

? Candidate Key

(only) S

S

(only)

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

1. R(U,F) U={C,G,N,S,T}

F={CT,CSG, SN}

? Candidate Key (CS)+

CSCS(CSG) (CT) (SN)CSU

CSCSGTN

CS+=U; C+=CT; S+=SN

CK: CS

(only)

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2. R(U,F) U={A,B,C,D,E,G}

F={AB,CA,CDE,DG}

? Candidate Key

(only)

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2. R(U,F) U={A,B,C,D,E,G}

F={AB,CA,CDE,DG}

? Candidate Key C+,(CD)+,D+

AA (AB) AAB

CC (CA) CCA( AB) CCAB

CDCD (CDE)(CA) (DG) CDCDEAG

( AB)CDABCDEG=U

DD (DG) DDG

CK: CD

CD+=U; C+=CAB; D+=DG

(only)

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

3. R(U,F) U={A,B,C,D,E} F={AD

,ED,DB,BCD,DCA} ? Candidate Key

(only) (CE)+=U

CK29

(only)

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

4. R(U,F) U={A,B,C,D,E} F={ABC,CDE,BD,EA} ? Candidate Key

(only) .

,

,

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

4. R(U,F) U={A,B,C,D,E}

F={ABC,CDE,BD,EA} ? Candidate Key

A+,(CD)+ , B+, E+, (BC)+

BCBC (BD) BCBCD

AA (ABC) AABC ( BD)

AABCD (CDE) AABCDE=U

CDCD (CDE)CDCDE (EA)

CDCDEA (ABC) CDABCDE=U

BB (BD) BBD

EE (EA)EEA (ABC)EEABC

(BD) EABCDE=U

CK: A, CD, E , BC

,

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

?CK

F Fmin

1. FD(only)CK

2. FD,CK

3. FFDCK

CK29

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

(FD) Fmin

1 R(U,F)

U={A,B,C,D,E,G}

F={ABC,CA,BCD,

ACDB,DEG

BE C,CG BD,

CE AG}? Fmin

Min FD

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

F={ABC,CA,BCD,ACDB,DEGBE CCG BDCE AG}

1.FFD

F1={ ABC,CA,BCD,ACDB,

DEG

BE C

CG BD

CE AG }

CA

A

DED G

CG B CG D

CE A CE G }

CE A

2.F1F2

CE A

ACDA

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2.F1F2 F2={ABC,CA,BCD, CDB,DE,D G,

BE C,CG B, CG D,CE G}

CG D

CG B

3F2FD

CGD CG)+= CGBADE = U

CG D

CG B CG)+= CGDABE=U

CG->B

CGDCG->BF3

F3F2

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2 F={ABC , EP A D H

AB E CDE P D G ABC G

GP B HB P ABC PA C }

? Fmin

ABC

C

AB G

AB P

A C

C

F1= FD

F2: ABC

AB P

AB G

ABC P

ABC G

F3:AB->PAB->G(AB)+

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

Fmin

1F FD

2FD

X A XY A ,Y

X->Y XYZ A Y

3FD

X YX+

X+Y X Y

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

F={E G G E F EG

H EG FH E}

? Fmin

FH E

  • F1

  • F2

  • FDF3

Fmin ={E G G E F E H G}

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

FD Fmin

1FFD

2FFDX A

F-{X A}F

(FDF)

3FFDX AZX F-{X A} {Z A}F

Z XX AZ A

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

1F={A BCB ACC A} Fmin

1 F={A BA CB A

B CC A}2FD

G=F-{A B} A+G=AC

G=F-{A C} A+G=ABC

A C

G=F-{B A} B+G =ABC

B A

G=F-{B C} B+G =B

G=F-{C A} C+G =C

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

2

F={BE G BD GCDE AB

CD A CE GBC A

B D C D }

Fmin

CEA CE

B

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

CK

1,3U={A,B,C,D,E} 2U={A,B,C,D,E,G}

1 F={AD,ED,DB,BCD,DCA}

2F={AB C ,D EG,C ABD C }

3F={E ACD EB DA BC}

Fmin?

1 F={ABD AC,C BE,AD BF,B E}

2F={A BCB CA BAB C}

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

5.3

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

:

SL

Sno Sdept Sloc

95001 CS A

95002 IS B

95003 MA C

95004 IS B

95005 PH B

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

  • 1. SL

  • SN(Sno) SD(Sdept) SO(Sloc)

SN SD SO

Sno Sdept Sloc

95001 CS A

95002 IS B

95003 MA C

95004 PH

95005

:

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

  • 2SL

  • NL(Sno, Sloc)

  • DL(Sdept, Sloc)

  • NL DL

  • Sno Sloc Sdept Sloc

  • 95001 A CS A

  • 95002 B IS B

  • 95003 C MA C

  • 95004 B PH B

  • 95005 B

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

NL DL

Sno Sloc Sdept

95001 A CS

95002 B IS

95002 B PH

95003 C MA

95004 B IS

95004 B PH

95005 B IS

95005 B PH

5


Rdb 5 1 fd 5 2 5 3 5 4 nf

  • 3. SL

  • ND(Sno, Sdept)

  • NL(Sno, Sloc)

    • ND NL

    • Sno Sdept Sno Sloc

    • 95001 CS 95001 A

    • 95002 IS 95002 B

    • 95003 MA 95003 C

    • 95004 IS 95004 B

    • 95005 PH 95005 B

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    ND NL

    Sno Sdept Sloc

    95001 CS A

    95002 IS B

    95003 MA C

    95004 CS A

    95005 PH B

    SL,

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A

    B

    C

    A

    B

    A

    C

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    c1

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    a1

    a2

    a3

    a4

    c1

    c1

    c2

    c1

    R1(A,B)

    A,B(R)

    R2(A,C)

    A,C(R)

    R (A,B,C)

    F={A BB C}

    95

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A

    B

    C

    A

    B

    A

    C

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    c1

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    a1

    a2

    a3

    a4

    c1

    c1

    c2

    c1

    1

    R1R2

    R2(A,C)

    R1(A,B)

    R (A,B,C)

    F1={A B}

    1

    2 =

    95

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A

    B

    A

    B

    C

    B

    C

    b1

    b2

    b3

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    c1

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    R1(A,B)

    A,B(R)

    R3(B,C)

    B,C(R)

    R (A,B,C)

    F={A BB C}

    95

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A

    B

    A

    B

    C

    B

    C

    2

    b1

    b2

    b3

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    c1

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    R1R3

    R1(A,B)

    R3(B,C)

    R (A,B,C)

    F2={A BB C}

    1=

    2 =

    95

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A

    B

    C

    B

    A

    C

    C

    b1

    b2

    b3

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    b1

    b1

    b2

    b3

    c1

    c1

    c2

    c1

    a1

    a2

    a3

    a4

    c1

    c1

    c2

    c1

    R2(A,C)

    A,C(R)

    R3(B,C)

    B,C(R)

    R (A,B,C)

    F={A BB C}

    95

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A

    B

    C

    B

    A

    C

    C

    b1

    b2

    b3

    c1

    c2

    c1

    a1

    a1

    a2

    a2

    a3

    a4

    a4

    b1

    b3

    b1

    b3

    b2

    b1

    b3

    c1

    c1

    c1

    c1

    c2

    c1

    c1

    a1

    a2

    a3

    a4

    c1

    c1

    c2

    c1

    R2R3

    R2(A,C)

    R3(B,C)

    F3={B C}

    R (A,B,C)

    1

    2

    95

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    R(U ,F) ,

    ={R1,R2,,Rk}

    r =r1r2rk

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    • 3.

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    1.

    A1 A2.

    R1 a1 A1R1 a

    R2 b21 A1R 2 b

    FFD,a,

    2. ={R1,R2}

    R1 R2R1 R2 R2 R1 FD

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    1

    A B C

    AB a1 a2

    AC a1 a3

    b13

    a2

    b22

    F: AB

    a,

    R1 R2=A

    R1 R2=B A B

    R2 R1=C

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    a,

    2

    A B C

    AB a1 a2

    BC a2 a3

    b13

    a3

    b21

    F: B C

    R1 R3=B B C

    R1- R3 =A

    R3 R1 =C

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    3

    A B C

    AC a1 b12 a3

    BC b21 a2 a3

    a

    R2 R3=C

    R2 - R3 =A

    R3 R2 =B

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    2 R(C ,S ,Z )

    F={ (C,S)Z, Z C }

    R R1(S ,Z) R2 (C,Z)

    C S Z

    SZ a2 a3

    CZ a1 a3

    b11

    a1

    ZC

    b22

    a,

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    Sh Sn Dept Daddr

    S1 AB CS D1

    S2 CD CS D1

    S3 EF MA D2

    S4 EF PHY D3

    F={Sh->Sn ,Sh->Dept ,Dept->Daddr}

    1={ R1(Sh ,Sn) , R2(Dept ,Daddr) }

    2={ R3(Sh ,Sn ,Dept) , R2(Dept ,Daddr) }

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    3R(Sh,Sn,Dept,Daddr)

    2

    Sh Sn Dept Da

    Sh Sn Dept a1 a2 a3

    Dept Da b21 b22 a3 a4

    b14

    a4

    F: Dept Da

    a,

    R2 R3= Dept R2 R3 =Daddr

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    5.4

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    5.4

    36.00 120.00

    45.00 240.00

    36.00 120.00

    45.00 240.00

    RR1NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    R(Sh,Sn,Sex,Ch,Grade) PK: (Sh,Ch)

    (Sh,Ch) Sn / Sex / Grade

    (sh,ch) Grade

    Sh Sn / Sex

    R1(Sh,Sn,Sex R2Sh,Ch,Grade)

    RRRR2NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    R 2NF

    )

    RRR

    R 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    R(C ,S ,Z ) F={ (C,S)->Z, Z->C }

    CK CS

    Z>C Z

    ZCZCSZSZ

    RR

    R

    BCNF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    R

    1NF

    2NF

    3NF

    BCNF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    W(D,G,N,A,B,C,E,F) PK: (D,G)

    W1DGC

    W2GNAE

    W3AB

    W4EF

    ,3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    D G C N A E B F

    DGC a1 a2 a3

    GNAE a2 a4 a5 a6

    AB a5 a7

    EF a6 a8

    a6

    a4

    a5

    a7

    a8

    G E

    G N

    E F

    G A

    AB

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    RUF

    F={B G,CE B,CA,CE G,B D ,CD}

    1. FD,3NF

    FFmin

    FFD,().

    R1: U1=BDG R2: U2=ACD R3: U3=BCEG

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    1 RUF

    U ={CTHRSG}

    F={CS G,C TTH R,HR CHS R}

    FD3NF

    FXi Ai

    ={ R1( C , S , G ),R2(C ,T ),R3( T , H, R),R4(H , R, C),R5( H, S, R) }

    3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    32

    = {x}

    XR

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    DB

    Sh Ch G TN D

    1FDF

    2;

    33NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    1F={Sh ,Ch ) GChTN ,TN D}

    21NF

    Sh ,Ch), GTND

    Sh ,Ch) TN (Ch TN )

    Sh)

    Ch

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    3FFmin

    ={R1 ,RA}

    R1(Sh,Ch,G)

    RA( Ch ,Tn,D) 2NF

    ={R1,R2,R3}

    R1(Sh,Ch,G)

    R2(Ch ,TN)

    R3(TN,D) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    1.RABCDEA B C D E 1101 01 1500 Li 1102 01 1000 Li 1103 01 2000 Li 1101 02 1800 Wu

    3

    F={ABC BD DE }

    R1(A,B,C) R2(B,D) R3(D,E) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A B C D E

    ABC a1 a2 a3

    BD a2 a4

    DE a4 a5

    a4

    a5

    BD

    DE

    F={ABC BD DE }

    R1(A,B,C) R2(B,D) R3(D,E) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    2

    E F G

    1200

    1200

    800

    800

    3

    F={EF FG}

    R1(E,F) R2(F,G) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    3. RABCDEF

    3

    P1

    P1

    P1

    P2

    P2

    11

    12

    13

    11

    14

    4

    6

    15

    6

    18

    9805

    9805 9805 9811 9811

    9902

    9902 9902 9912 9912

    250

    200

    180

    250

    150

    R1(A,B,C) R2(A,D) R3(D,E) R4(B,F) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    A B C D E F

    ABC a1 a2 a3

    AD a1 a4

    DE a4 a5

    BF a2 a6

    a4

    a5

    a6

    BF

    AD

    DE

    F={ AD BF DE ABC}

    R1(A,B,C) R2(A,D) R3(D,E) R4(B,F) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    4.R(Sh,Ch,Grade,Tname,Taddr),

    3

    F={shchTn, chTn, TnTa ,shchGR}

    R1(Sh,Ch,Gr) R2(Ch,Tn) R3(Tn,Ta) 3NF

    5


    Rdb 5 1 fd 5 2 5 3 5 4 nf

    Sh Ch Gr Tn Ta

    ShChGr a1 a2 a3

    Ch Tn a2 a4

    Tn Tn a4 a5

    a4

    a5

    chTn

    TnTa

    F={shchTn, chTn, TnTa ,shchGr}

    R1(Sh,Ch,Gr) R2(Ch,Tn) R3(Tn,Ta) 3NF

    5


  • Login