Normalization (2)
Normalization (2)
Definition
• This is the process which allows you to winnow out
redundant data within your database.
• This involves restructuring the tables to successively
meeting higher forms of Normalization.
• A properly normalized database should have the
following characteristics
– Scalar values in each fields
– Absence of redundancy.
– Minimal use of null values.
– Minimal loss of information.
Update Anomalies
Relations that have redundant data may
have problems called update anomalies,
which are classified as ,
Insertion anomalies
Deletion anomalies
Modification anomalies
Example of Update Anomalies
Staf
f
staffNo sName position salary branceNo
SL21 John White Manager 30000 B005
SG37 Ann Beech Assistant 12000 B003
SG14 David Ford Supervisor 18000 B003
SA9 Mary Howe Assistant 9000 B007
SG5 Susan Brand Manager 24000 B003
SL41 Julie Lee Assistant 9000 B005
Branch
branceNo bAddress
B005 22 Deer Rd, London
B007 16 Argyll St, Aberdeen
B003 163 Main St,Glasgow
Bor_loan More
cust_id loan_id amount redundancy.
23-652 L-100 10000 Amount
15-202 L-100 10000 repeated for
23-521 L-100 10000 all loan. If
amount
modified
should be
Design Alternative :Large Schemas
Loan_id amount Loan_id Branch_name
Lossy Decomposition
123-45-6789 Kim 882-0000 1984-April-29
987-65-4321 Kim 869-9999 1981-01-16
Number of Tables
Redundancy
– Third Normal Form (3NF)
Complexity
– Boyce-Codd Normal Form (BCNF)
– Fourth Normal Form (4NF)
– Fifth Normal Form (5NF)
– Domain Key Normal Form (DKNF)
0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-55-123456-9 Jones 123-333-3333
B is functionally
A B
dependent on A
Example 1
Example 3
AuID AuName AuPhone
1 Sleepy 321-321-1111
Table Scheme: {AuID, AuName, AuPhone}
2 Snoopy 232-234-1234 Functional Dependencies: {AuId} {AuPhone}
3 Grumpy 665-235-6532 {AuId} {AuName}
4 Jones 123-333-3333
{AuName, AuPhone} {AuID}
5 Smith 654-223-3455
6 Joyce 666-666-6666
7 Roman 444-444-4444
FD – Example
Database to track reviews of papers submitted to an academic
conference. Prospective authors submit papers for review and
possible acceptance in the published conference proceedings.
Details of the entities
– Author information includes a unique author number, a name, a
mailing address, and a unique (optional) email address.
– Paper information includes the primary author, the paper number,
the title, the abstract, and review status (pending,
accepted,rejected)
– Reviewer information includes the reviewer number, the name, the
mailing address, and a unique (optional) email address
– A completed review includes the reviewer number, the date, the
paper number, comments to the authors, comments to the
program chairperson, and ratings (overall, originality, correctness,
style, clarity)
FD – Example
Functional Dependencies
– AuthNo AuthName, AuthEmail, AuthAddress
– AuthEmail AuthNo
– PaperNo Primary-AuthNo, Title, Abstract, Status
– RevNo RevName, RevEmail, RevAddress
– RevEmail RevNo
– RevNo, PaperNo AuthComm, Prog-Comm, Date,
Rating1, Rating2, Rating3, Rating4, Rating5
Functional dependency
• Types of functional dependencies:
– Full Functional dependency
– Partial Functional dependency
– Transitive dependency
Full dependencies
Partial dependencies
Transitive dependencies
Trivial Functional Dependencies
• Functional dependencies are said to be trivial
because they satisfied by all relation.
• A functional dependency of the form
α β is trivial if β C α.
Functional Dependencies (2)
2. Each manager can have more than one child Mary NULL Adam