Information Systems (Informationssysteme)
Jens Teubner, TU Dortmund jens.teubner@cs.tu-dortmund.de Summer 2019
c Jens Teubner · Information Systems · Summer 2019 1
Information Systems (Informationssysteme) Jens Teubner, TU Dortmund - - PowerPoint PPT Presentation
Information Systems (Informationssysteme) Jens Teubner, TU Dortmund jens.teubner@cs.tu-dortmund.de Summer 2019 Jens Teubner Information Systems Summer 2019 c 1 Part VII Schema Normalization Jens Teubner Information Systems
c Jens Teubner · Information Systems · Summer 2019 1
c Jens Teubner · Information Systems · Summer 2019 211
c Jens Teubner · Information Systems · Summer 2019 212
c Jens Teubner · Information Systems · Summer 2019 213
c Jens Teubner · Information Systems · Summer 2019 214
c Jens Teubner · Information Systems · Summer 2019 215
c Jens Teubner · Information Systems · Summer 2019 216
c Jens Teubner · Information Systems · Summer 2019 217
c Jens Teubner · Information Systems · Summer 2019 218
11If the set is also minimal, A1, . . . , An is a key (ր slide 53). c Jens Teubner · Information Systems · Summer 2019 219
c Jens Teubner · Information Systems · Summer 2019 220
c Jens Teubner · Information Systems · Summer 2019 221
c Jens Teubner · Information Systems · Summer 2019 222
1 = F+ 2
?
12Let α, β, . . . denote sets of attributes. c Jens Teubner · Information Systems · Summer 2019 223
c Jens Teubner · Information Systems · Summer 2019 224
F:
F =
?
?
F.
c Jens Teubner · Information Systems · Summer 2019 225
F can be computed as follows: 1 Algorithm: AttributeClosure
F (all attributes functionally determined by α in F+) 2 x ← α; 3 repeat 4
5
6
7
8 until x′ = x; 9 return x;
c Jens Teubner · Information Systems · Summer 2019 226
c Jens Teubner · Information Systems · Summer 2019 227
1 F− ≡ F, i.e., (F−)+ = F+. 2 All functional dependencies in F− have the form α → X
3 In α → X ∈ F−, no attributes in α are redundant:
4 No rule α → X is redundant in F−:
c Jens Teubner · Information Systems · Summer 2019 228
1 F− ← F where all functional dependencies are converted to have
2 Remove redundant attributes from the left-hand sides of
1 foreach α → X ∈ F− do 2
3
F− then A redundant in α? Remove
4
3 Remove redundant functional dependencies from F−: 1 foreach α → X ∈ F− do 2
3
c Jens Teubner · Information Systems · Summer 2019 229
c Jens Teubner · Information Systems · Summer 2019 230
c Jens Teubner · Information Systems · Summer 2019 231
c Jens Teubner · Information Systems · Summer 2019 232
c Jens Teubner · Information Systems · Summer 2019 233
c Jens Teubner · Information Systems · Summer 2019 234
c Jens Teubner · Information Systems · Summer 2019 235
1 There is none. 3NF was discovered “accidentally” in the search for
2 As we shall see, relational schemas can always be converted into
c Jens Teubner · Information Systems · Summer 2019 236
c Jens Teubner · Information Systems · Summer 2019 237
c Jens Teubner · Information Systems · Summer 2019 238
c Jens Teubner · Information Systems · Summer 2019 239
c Jens Teubner · Information Systems · Summer 2019 240
c Jens Teubner · Information Systems · Summer 2019 241
1 Algorithm: BCNFDecomposition
2 Decomposed ←
3 while ∃ (sch(S), FS) ∈ Decomposed that is not in BCNF do 4
5
6 return Decomposed;
c Jens Teubner · Information Systems · Summer 2019 242
c Jens Teubner · Information Systems · Summer 2019 243
c Jens Teubner · Information Systems · Summer 2019 244
1 Compute the minimal cover F− of the given set of FDs F. 2 Merge rules in F− that have the same left-hand side (→ G). 3 For each α → β ∈ G create a table Rα(αβ) and associate
4 If none of the constructed tables from step 3 contains a key of
c Jens Teubner · Information Systems · Summer 2019 245
c Jens Teubner · Information Systems · Summer 2019 246
c Jens Teubner · Information Systems · Summer 2019 247
c Jens Teubner · Information Systems · Summer 2019 248
1 Establish 3NF schema (through synthesis; dependency preservation
2 Decompose resulting schema to obtain BCNF.
c Jens Teubner · Information Systems · Summer 2019 249
c Jens Teubner · Information Systems · Summer 2019 250
c Jens Teubner · Information Systems · Summer 2019 251
c Jens Teubner · Information Systems · Summer 2019 252
c Jens Teubner · Information Systems · Summer 2019 253
c Jens Teubner · Information Systems · Summer 2019 254