You are on page 1of 4

The Boyce-Codd Normal Form (BCNF) The Boyce-Codd Normal Form (BCNF)

• When part of the key is dependent on another • Occurs most often when the wrong attribute was
non-key attribute, ie. another candidate key. chosen as part of the composite Primary Key.
• Return to 2NF and correct by:
– Create a new composite key with C, not B.
– Create a new table eliminating the new partial
dependency.

CS275 Fall 2010 29 CS275 Fall 2010 30

The Boyce-Codd Normal Form (BCNF) The Boyce-Codd Normal Form (BCNF)

• Non-Boyce-Codd Normal Form • Resulting BCNF with two entities


– Can only exists with composite Primary Key – – Enroll, with composite PK Stu_ID & Class_code.
– Example Enroll entity: – Class with Class_code as it’s PK.
Enroll(Stu_ID, Staff_ID, Class_Code, Enroll_Grade)

31
CS275 Fall 2010 CS275 Fall 2010 32

8
Fourth Normal Form (4NF) Fourth Normal Form (4NF)
• Table is in fourth normal form (4NF) when both • Two Examples of multi-valued dependencies
of the following are true: • StudentID,StName,Phones(Home,Work,Cell,Fax)
– It is in 3NF • StudentID,Addresses(permanent, mailing, current)
– No multiple sets of multivalued dependencies
• 4NF is largely academic if tables conform to
• Convert multi-valued phones using two
following two rules:
additional tables in 3NF
– All attributes dependent on primary key,
independent of each other • Student(StudentID, StName,………..)
– No row contains two or more multivalued facts • StuPhones(StudentID, PhoneType, Phone#)
about an entity • Phones(PhoneType, Description)

34
CS275 Fall 2010 33 CS275 Fall 2010

Fourth Normal Form (4NF) Denormalization


• Example: Tracking employee’s volunteer service • Creation of normalized relations is important
database design goal
• Processing requirements should also be a goal
• If tables are decomposed to conform to
normalization requirements:
– Number of database tables expands
– Causing additional processing
– Loss of system speed

CS275 Fall 2010 35 CS275 Fall 2010 36

9
Denormalization Normalization and Database Design
• Conflicts are often resolved through • Normalization should be part of the design
compromises that may include denormalization process
• Defects of unnormalized tables: • Make sure that proposed entities meet required
– Data updates are less efficient because tables are normal form before table structures are created
larger
– Indexing is more cumbersome • Many real-world databases have been improperly
designed or burdened with anomalies
– No simple strategies for creating virtual tables
known as views • You may be asked to redesign and modify
• Use denormalization cautiously existing databases
– Understand why—under some circumstances—
unnormalized tables are a better choice

CS275 Fall 2010 37 CS275 Fall 2010 38

Data-Modeling Checklist Normalization and Database Design


• Data modeling
translates specific • ER diagram
real-world – Identify relevant entities, their attributes, and
environment into a their relationships
data model – Identify additional entities and attributes
• Data-modeling
• Normalization procedures
checklist helps
ensure that data- – Focus on characteristics of specific entities
modeling tasks are – Micro view of entities within ER diagram
successfully • Difficult to separate normalization process from
performed
ER modeling process

CS275 Fall 2010 39 CS275 Fall 2010 40

10
Summary Summary
• Normalization is a technique used to minimize • First three normal forms (1NF, 2NF, and 3NF) are
data redundancies most commonly encountered
• Normalization is an important part of the design • Table is in 1NF when:
process – All key attributes are defined
• Whereas ERD’s provide a macro view, – All remaining attributes are dependent on primary
normalization provides micro view of entities key
– Focuses on characteristics of specific entities • Table is in 2NF when it is in 1NF and contains no
– May yield additional entities partial dependencies
• Difficult to separate normalization from E-R • Table is in 3NF when it is in 2NF and contains no
diagramming – do both techniques concurrently. transitive dependencies

CS275 Fall 2010 41 CS275 Fall 2010 42

Summary
• Table that is not in 3NF may be split into new tables
until all of the tables meet 3NF requirements
• Table in 3NF may contain multivalued
dependencies
– Numerous null values or redundant data
• Convert 3NF table to 4NF by:
– Splitting table to remove multivalued dependencies
• Tables are sometimes denormalized to yield less
I/O, which increases processing speed

CS275 Fall 2010 43 CS275 Fall 2010 44

11

You might also like