- Art and the Zen of System Design
- KPI Dashboard
- 13_WCDMA Análise do Procedimento de Paging
- interface rating form lori
- NLP
- Edu Cat en Cts Ff v5r19 Toprint
- normalization
- pppppppppppppppppppppp
- dbms (santosh mandal)
- Normailization 1NF 2NF #NF Slides
- MI0034-Database Management System Set 1
- 9466ut One Set II (1)
- database_NCC_ june2009_assingment_Iadcs
- Chem442FinalProject-PartC
- Dust City Quickstart Guide
- CCP305
- Traverse 2008 Self Help Menu
- scratch20catchgame
- Codigo Python v3
- PST 201F Assignment 3-Sumaya Moodley (Ryt)
- Using DUNDi With Trixbox
- Lab Assignment 4a
- Ansys Apdl Bolt Torque Tutorial
- Database Systemscomp2
- Types of Joins - Relationships
- SQL_Queries_1.0
- emdd
- sqr-guide
- ROS Cheat Sheet Hydro
- Paper 4 Vol 3 No 1
- New VP Record
- UNIT I
- System Software
- win7
- Toc
- Cs1353 Software Engineering
- computer network two marks
- 10.1.1.112
- CS1303-QB
- Cs1253 Visual Programming two marks
- New VP Record
- Cs1252 Operating Systems
- 23293984 Problems on Algorithms 2002
- Cse Curriculum
- Search Sort
- r 2008 Cse Syllabus
- Basic Research in Computer Science BRICS RS-97-43
- MaanavaN.com
- System Calls 4
- 15652284 Formula Sheet Probability and Random Processes
- Math Formula
- COA two marks
- DAA

Goal = BCNF = Boyce-Codd Normal Form = all FD's follow from the fact key ! everything." Formally, R is in BCNF if every nontrivial FD for R, say X ! A, has X a superkey. 3 Nontrivial" = right-side attribute not in left side.

Why?

1. Guarantees no redundancy due to FD's. 2. Guarantees no update anomalies = one occurrence of a fact is updated, not all. 3. Guarantees no deletion anomalies = valid fact is lost when tuple is deleted.

1

Example of Problems

Drinkersname, addr, beersLiked, manf, favoriteBeer

name addr beersLiked manf favoriteBeer Janeway Voyager Bud A.B. WickedAle Janeway ??? WickedAle Pete's ??? ??? Bud Spock Enterprise Bud FD's: 1. name ! addr 2. name ! favoriteBeer 3. beersLiked ! manf ???'s are redundant, since we can gure them out from the FD's. Update anomalies: If Janeway gets transferred to the Intrepid, will we remember to change addr in each of her tuples? Deletion anomalies: If nobody likes Bud, we lose track of Bud's manufacturer.

2

Each of the given FD's is a BCNF violation: Key = fname, beersLikedg 3 Each of the given FD's has a left side a proper subset of the key.

Another Example

Beersname, manf, manfAddr

FD's = name ! manf, manf ! manfAddr. Only key is name. 3 manf ! manfAddr violates BCNF with a left side unrelated to any key.

.

3

Setting: relation R, given FD's F . Suppose relation R has BCNF violation X ! B . We need only look among FD's of F for a BCNF violation, not those that follow from F . Why? 1. Compute X + . 3 Cannot be all attributes | why? 2. Decompose R into X + and R , X + X .

Decomposition to Reach BCNF

R

X

X+

3. Find the FD's for the decomposed relations. 3 Project the FD's from F = calculate all consequents of F that involve only attributes from X + or only from R , X + X . 4

Example

F=

**R = Drinkersname, addr, beersLiked, manf,
**

favoriteBeer

1. name ! addr 2. name ! favoriteBeer 3. beersLiked ! manf Pick BCNF violation name ! addr. Close the left side: name+ = name addr favoriteBeer . Decomposed relations:

Drinkers1name, addr, favoriteBeer Drinkers2name, beersLiked, manf

Projected FD's skipping a lot of work that leads nowhere interesting: 3 For Drinkers1: name ! addr and name ! favoriteBeer. 3 For Drinkers2: beersLiked ! manf. 5

BCNF violations? 3 For Drinkers1, name is key and all left sides of FD's are superkeys. 3 For Drinkers2, name, beersLiked is the key, and beersLiked ! manf violates BCNF.

Decompose Drinkers2

Close beersLiked+ = beersLiked, manf. Decompose:

Drinkers3beersLiked, manf Drinkers4name, beersLiked

**Resulting relations are all in BCNF:
**

Drinkers1name, addr, favoriteBeer Drinkers3beersLiked, manf Drinkers4name, beersLiked

6

3NF

One FD structure causes problems: If you decompose, you can't check the FD's in the decomposed relations. If you don't decompose, you violate BCNF. Abstractly: AB ! C and C ! B . In book: title city ! theatre and theatre ! city. Another example: street city ! zip, zip ! city. Keys: fA; B g and fA; C g, but C ! B has a left side not a superkey. Suggests decomposition into BC and AC . 3 But you can't check the FD AB ! C in these relations.

7

Example

**A = street, B = city, C = zip.
**

street zip 545 Tech Sq. 02138 545 Tech Sq. 02139 city Cambridge Cambridge city Cambridge Cambridge zip 02138 02139 zip 02138 02139

Join:

street 545 Tech Sq. 545 Tech Sq.

8

De ne the problem away. A relation R is in 3NF i for every nontrivial FD X ! A, either: 1. X is a superkey, or 2. A is prime = member of at least one key. Thus, the canonical problem goes away: you don't have to decompose because all attributes are prime.

Elegant" Workaround

9

There are two important properties of a decomposition: 1. We should be able to recover from the decomposed relations the data of the original. 3 Recovery involves projection and join, which we shall defer until we've discussed relational algebra. 2. We should be able to check that the FD's for the original relation are satis ed by checking the projections of those FD's in the decomposed relations. Without proof, we assert that it is always possible to decompose into BCNF and satisfy 1. Also without proof, we can decompose into 3NF and satisfy both 1 and 2. But it is not possible to decompose into BNCF and get both 1 and 2. 3 Street-city-zip is an example of this point. 10

What 3NF Gives You

Multivalued Dependencies

The multivalued dependency X ! Y holds in ! a relation R if whenever we have two tuples of R that agree in all the attributes of X , then we can swap their Y components and get two new tuples that are also in R.

X

Y

others

11

Example

MVD tuples:

Drinkersname, addr, phones,beersLiked name phones Drinkers

! !

. If

with has the two

name addr phones beersLiked sue a p1 b1 sue a p2 b2 it must also have the same tuples with phones components swapped: name addr phones beersLiked sue a p1 b2 sue a p2 b1 Note: we must check this condition for all pairs of tuples that agree on name, not just one pair.

12

1. Every FD is an MVD. 3 Because if X ! Y , then swapping Y 's between tuples that agree on X doesn't create new tuples. 3 Example, in Drinkers: name ! addr. ! 2. Complementation: if X ! Y , then X ! Z , ! ! where Z is all attributes not in X or Y . 3 Example: since name ! phones ! holds in Drinkers, so does name ! addr beersLiked. !

MVD Rules

13

**Sometimes you need to have several attributes on the right of an MVD. For example:
**

Drinkersname, areaCode, phones, beersLiked, beerManf

Splitting Doesn't Hold

name Sue Sue Sue Sue

areaCode 650 650 415 415

phones 555-1111 555-1111 555-9999 555-9999

BeersLiked Bud WickedAle Bud WickedAle

beerManf A.B. Pete's A.B. Pete's

name name

! areaCode phones holds, but neither ! ! areaCode nor name ! phones do. ! !

14

Eliminate redundancy due to multiplicative e ect of MVD's. Roughly: treat MVD's as FD's for decomposition, but not for nding keys. Formally: R is in Fourth Normal Form if whenever MVD X ! Y is nontrivial Y ! is not a subset of X , and X Y is not all attributes, then X is a superkey. 3 Remember, X ! Y implies X ! Y , so ! 4NF is more stringent than BCNF. Decompose R, using 4NF violation X ! Y , ! into XY and X R , Y .

4NF

R

X

Y

15

Example

Drinkersname, addr, phones, beersLiked

**FD: name ! addr Nontrivial MVD's:
**

name

Only key: fname, phones, beersLikedg All three dependencies above violate 4NF. Successive decomposition yields 4NF relations:

D1name, addr D2name, phones D3name, beersLiked

! !

name beersLiked

.

! phones and !

16

- Art and the Zen of System DesignUploaded bydamianmtn3
- KPI DashboardUploaded byAhmed El Shafie
- 13_WCDMA Análise do Procedimento de PagingUploaded bydabreulima
- interface rating form loriUploaded byapi-266320453
- NLPUploaded byVirat Bhandari
- Edu Cat en Cts Ff v5r19 ToprintUploaded byC_a_R
- normalizationUploaded byicanjaga
- ppppppppppppppppppppppUploaded bypatykhan
- dbms (santosh mandal)Uploaded byEr Santosh Kumar
- Normailization 1NF 2NF #NF SlidesUploaded byPoojitha Ponnam
- MI0034-Database Management System Set 1Uploaded byZameer Ahmed Sait
- 9466ut One Set II (1)Uploaded byAnju Sabharwal
- database_NCC_ june2009_assingment_IadcsUploaded byibamin
- Chem442FinalProject-PartCUploaded byShawn Bell
- Dust City Quickstart GuideUploaded byDingusbubmis
- CCP305Uploaded byapi-3849444
- Traverse 2008 Self Help MenuUploaded byScott Whitton
- scratch20catchgameUploaded byapi-349870595
- Codigo Python v3Uploaded byokokok1226
- PST 201F Assignment 3-Sumaya Moodley (Ryt)Uploaded bysumaya
- Using DUNDi With TrixboxUploaded byToxiNiK
- Lab Assignment 4aUploaded byecutronic
- Ansys Apdl Bolt Torque TutorialUploaded byBakkiya Raj
- Database Systemscomp2Uploaded byShivam Shukla
- Types of Joins - RelationshipsUploaded bySundararajan Srinivasan
- SQL_Queries_1.0Uploaded byKaran Vaswani
- emddUploaded bypostscript
- sqr-guideUploaded byJustin Smith
- ROS Cheat Sheet HydroUploaded byMithun Varma Diddi
- Paper 4 Vol 3 No 1Uploaded byHadiBies

- New VP RecordUploaded bykarthikbabube
- UNIT IUploaded bykarthikbabube
- System SoftwareUploaded bykarthikbabube
- win7Uploaded bykarthikbabube
- TocUploaded bykarthikbabube
- Cs1353 Software EngineeringUploaded bykarthikbabube
- computer network two marksUploaded bykarthikbabube
- 10.1.1.112Uploaded bykarthikbabube
- CS1303-QBUploaded bykarthikbabube
- Cs1253 Visual Programming two marksUploaded bykarthikbabube
- New VP RecordUploaded bykarthikbabube
- Cs1252 Operating SystemsUploaded bykarthikbabube
- 23293984 Problems on Algorithms 2002Uploaded bykarthikbabube
- Cse CurriculumUploaded bykarthikbabube
- Search SortUploaded bykarthikbabube
- r 2008 Cse SyllabusUploaded bykarthikbabube
- Basic Research in Computer Science BRICS RS-97-43Uploaded bykarthikbabube
- MaanavaN.comUploaded bykarthikbabube
- System Calls 4Uploaded bykarthikbabube
- 15652284 Formula Sheet Probability and Random ProcessesUploaded bykarthikbabube
- Math FormulaUploaded bykarthikbabube
- COA two marksUploaded bykarthikbabube
- DAAUploaded bykarthikbabube