Normalization Of Deviance - Maryland Patient Safety Center · Normalization Of Deviance
Normalization
-
Upload
baabtracom-mentoring-partner-first-programming-school-in-india -
Category
Technology
-
view
783 -
download
1
description
Transcript of Normalization
![Page 1: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/1.jpg)
![Page 2: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/2.jpg)
NORMALIZATION
Rajishma [email protected]/ Rajishma
T Nairtwitter.com/usernamein.linkedin.com/in/profilename9020217968
![Page 3: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/3.jpg)
Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
![Page 4: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/4.jpg)
NORMALIZATION
Normalization is the process of removing potential anomalies from the database design.
These anomalies include:
– Insertion anomalies– Update anomalies– Deletion anomalies
![Page 5: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/5.jpg)
INSERTION ANOMALIES
An insertion anomaly occurs when you can’t enter a record in because some data is missing.
Consider a database with the rule that every employee must be assigned to a project, but a newly hired employee doesn’t have a project yet.
One solution is to create a dummy project, but this puts bad data into your database and is not a good idea.
![Page 6: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/6.jpg)
UPDATE ANOMALIES
Update anomalies occur when the same data is stored in more than one place.
This means whenever you have to make a change to the data, you must do it in several places.
The more times you have to edit the same data in multiple places, the more chances you have of making a mistake, causing inconsistent data.
![Page 7: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/7.jpg)
DELETION ANOMALIES
causes other data to be lost Deletion anomalies occur when deleting a record accidently .
![Page 8: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/8.jpg)
Normalization:– The process of decomposing unsatisfactory "bad"
relations by breaking up their attributes into smaller relations
Normal form:– Condition using keys and FDs of a relation to
certify whether a relation schema is in a particular normal form
![Page 9: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/9.jpg)
FIRST NORMAL FORM
Only attribute values permitted are single atomic (or indivisible) values
Techniques to achieve first normal form– Remove attribute and place in separate relation– Expand the key– Use several atomic attributes
![Page 10: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/10.jpg)
![Page 11: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/11.jpg)
![Page 12: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/12.jpg)
SECOND NORMAL FORM
Second Normal Form removes what are called “functional dependencies.”
Functional dependencies are groups of columns that depend on each other rather than on the key of the table.
![Page 13: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/13.jpg)
Functional dependencies (FDs)– Are used to specify formal measures of the
"goodness" of relational designs– And keys are used to define normal forms for
relations– Are constraints that are derived from the meaning
and interrelationships of the data attributes A set of attributes x functionally depends a set of
attributes Y if the value of X determines a unique value for Y
![Page 14: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/14.jpg)
X -> Y holds if whenever two tuples have the same valuefor X, they must have the same value for Y– For any two tuples t1 and t2 in any relation
instance r(R): If t1[X]=t2[X], then t1[Y]=t2[Y] X -> Y in R specifies a constraint on all relation
instances r(R)
![Page 15: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/15.jpg)
SECOND NORMAL FORM
Formal definition of 2NF is a table that is in 1NF and every non-primary-key column is fully functional dependent on the primary key.
Full functional dependency indicates that if A and B are columns of a table, B is fully dependent on A if B is functionally dependent on A but not on any proper subset of A.
![Page 16: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/16.jpg)
![Page 17: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/17.jpg)
![Page 18: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/18.jpg)
TRANSITIONAL DEPENDENCY
Transitive functional dependency: a FD X -> Z that can be derived from two FDs X -> Y and Y -> Z
For example, consider a table with A, B, and C. If B is functional dependent on A and C is functional dependent on B , then C is transitively dependent on A via B (provided that A is not functionally dependent on B or C).
If a transitive dependency exists on the primary key, the table is not in 3NF.
`
![Page 19: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/19.jpg)
![Page 20: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/20.jpg)
![Page 21: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/21.jpg)
BCNFA relation R is in Boyce/Codd N/F (BCNF) if and only if
every determinant is a candidate key. Here, determinant is a simple attribute or composite attribute on which some other attributes is fully functionally dependent.
Each normal form is strictly stronger than the previous oneEvery 2NF relation is in 1NFEvery 3NF relation is in 2NFEvery BCNF relation is in 3NF
There exist relations that are in 3NF but not in BCNF The goal is to have each relation in BCNF (or 3NF)
![Page 22: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/22.jpg)
campus course class time Room/bldngeast English 101 1 8:00-9:00 212 AYE
east English 101 2 10:00-11:00 305 RFK
West English 101 3 8:00-9:00102 PPR
![Page 23: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/23.jpg)
• no two buildings on any of the university campuses have the same name, thus ROOM/BLDG----->CAMPUS. As the determinant is not a candidate key this table is not in bcnf.
• R1(course, class, room/bldg, time)•
course class time Room/bldng
English 101 1 8:00-9:00 212 AYE
English 101 2 10:00-11:00 305RFK
English 101 3 8:00-9:00 102PPR
![Page 24: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/24.jpg)
• R2(room/bldg, campus)
campus Room/bldng
east 212 AYEeast 305 RFKwest 102 PPR
![Page 25: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/25.jpg)
Identify all candidate keys in the relation.Identify all functional dependencies in the
relation.
If functional dependencies exists in the relation where their determinants are not candidate keys for the relation, remove the functional dependencies by placing them in a new relation along with a copy of their determinant.
![Page 26: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/26.jpg)
FOURTH NORMAL FORM
4NF: A relation that is in Boyce-Codd Normal Form and contains no MVDs.
BCNF to 4NF involves the removal of the MVD from the relation by placing the attribute(s) in a new relation along with a copy of the determinant
![Page 27: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/27.jpg)
MVD multi-valued dependency
• Represents a dependency between attributes (for example, A, B, and C) in a relation, such that for each value of A there is a set of values for B, and a set of values for C. However, the set of values for B and C are independent of each other
![Page 28: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/28.jpg)
50
NormalizationBCNF to 4NF Relations
![Page 29: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/29.jpg)
If this presentation helped you, please visit our page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
![Page 30: Normalization](https://reader033.fdocuments.in/reader033/viewer/2022061121/54689e3baf7959d8018b64bd/html5/thumbnails/30.jpg)
Contact Us
Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
Start up VillageEranakulam,Kerala, India.
Email: [email protected]