Chapter 28: Advanced Relational Database Design
Chapter 28: Advanced Relational Database Design
Design
Outline
Database System Concepts - 7th Edition 28.2 ©Silberschatz, Korth and Sudarshan
Theory of Multivalued Dependencies
Let D denote a set of functional and multivalued dependencies. The
closure D+ of D is the set of all functional and multivalued dependencies
logically implied by D.
Sound and complete inference rules for functional and multivalued
dependencies:
Reflexivity rule. If is a set of attributes and , then
holds.
Augmentation rule. If holds and is a set of attributes,
then holds.
Transitivity rule. If holds and holds, then holds.
Database System Concepts - 7th Edition 28.3 ©Silberschatz, Korth and Sudarshan
Theory of Multivalued Dependencies (Cont.)
Complementation rule. If holds, then R––
holds.
Multivalued augmentation rule. If holds and R and
, then holds.
Multivalued transitivity rule. If holds and holds,
then – holds.
Replication rule. If holds, then .
Coalescence rule. If holds and and there is a such
that R and = and , then holds.
Database System Concepts - 7th Edition 28.4 ©Silberschatz, Korth and Sudarshan
Simplification of the Computation of D+
Database System Concepts - 7th Edition 28.5 ©Silberschatz, Korth and Sudarshan
Example
R = (A, B, C, G, H, I)
D = {A B
B HI
CG H}
Database System Concepts - 7th Edition 28.6 ©Silberschatz, Korth and Sudarshan
Example (Cont.)
Database System Concepts - 7th Edition 28.7 ©Silberschatz, Korth and Sudarshan
Normalization Using Join Dependencies
Database System Concepts - 7th Edition 28.8 ©Silberschatz, Korth and Sudarshan
Project-Join Normal Form (PJNF)
Database System Concepts - 7th Edition 28.9 ©Silberschatz, Korth and Sudarshan
Example
Database System Concepts - 7th Edition 28.10 ©Silberschatz, Korth and Sudarshan
Domain-Key Normal Form (DKNY)
Domain declaration. Let A be an attribute, and let dom be a set of values.
The domain declaration A dom requires that the A value of all tuples be
values in dom.
Key declaration. Let R be a relation schema with K R. The key
declaration key (K) requires that K be a superkey for schema R (K R).
All key declarations are functional dependencies but not all functional
dependencies are key declarations.
General constraint. A general constraint is a predicate on the set of all
relations on a given schema.
Let D be a set of domain constraints and let K be a set of key constraints
for a relation schema R. Let G denote the general constraints for R.
Schema R is in DKNF if D K logically imply G.
Database System Concepts - 7th Edition 28.11 ©Silberschatz, Korth and Sudarshan
Example
Accounts whose account-number begins with the digit 9 are special high-
interest accounts with a minimum balance of 2500.
General constraint:
``If the first digit of t [account-number] is 9, then t [balance] 2500.''
DKNF design:
Regular-acct-schema = (branch-name, account-number, balance)
Special-acct-schema = (branch-name, account-number, balance)
Domain constraints for {Special-acct-schema} require that for each
account:
The account number begins with 9.
The balance is greater than 2500.
Database System Concepts - 7th Edition 28.12 ©Silberschatz, Korth and Sudarshan
DKNF rephrasing of PJNF Definition
Let R = (A1 , A2 ,..., An) be a relation schema. Let dom(Ai ) denote the
domain of attribute Ai, and let all these domains be infinite. Then all
domain constraints D are of the form Ai dom (Ai ).
Let the general constraints be a set G of functional, multivalued, or join
dependencies. If F is the set of functional dependencies in G, let the set
K of key constraints be those nontrivial functional dependencies in F+ of
the form R.
Schema R is in PJNF if and only if it is in DKNF with respect to D, K,
and G.
Database System Concepts - 7th Edition 28.13 ©Silberschatz, Korth and Sudarshan
End of Chapter 28
Database System Concepts - 7th Edition 28.14 ©Silberschatz, Korth and Sudarshan
Theory of Multivalued Dependencies
Let D denote a set of functional and multivalued dependencies. The closure
D+ of D is the set of all functional and multivalued dependencies logically
implied by D.
Sound and complete inference rules for functional and multivalued
dependencies:
1. Reflexivity rule. If is a set of attributes and , then holds.
2. Augmentation rule. If holds and is a set of attributes,
then holds.
3. Transitivity rule. If holds and holds, then holds.
Database System Concepts - 7th Edition 28.15 ©Silberschatz, Korth and Sudarshan
Theory of Multivalued Dependencies (Cont.)
Database System Concepts - 7th Edition 28.16 ©Silberschatz, Korth and Sudarshan