4.1.1 Design quality. 4.Normalization: Quality of relational designs. Informal guidelines (2) Informal guidelines (1)
|
|
- Carmella Brooks
- 6 years ago
- Views:
Transcription
1 .Normalization: Quality of relational designs. Funtional Dependenies.. Design quality.. Update anomalies.. Funtional Dependenies: definition.. Properties of Funtional Dependenies. Normal forms.. Informal introdution.. Normal Forms and FDs.. Normal forms (NF, NF, BCNF, MV NF).. Lossless join and dependeny preservation.. Multivalued dependenies and NF. Algorithms for finding Normal Forms. Normal Forms: Critial review.. Design quality What is a good oneptual model? Usually many alternatives. No lear guidelines, est pratie. Wanted: Formal methods for omparing designs But Use ommon sense! Simple prolems have simple solutions! "Design is an art ut a siene" Lit: Kemper/Eikler: hap 6; Garia-Molina/Ullman/Widom: hap. ff.; Elmasr/Navathe: hap 0-DBS-NF- Informal guidelines () Avoid redundanies: CREATE TABLE employee ( p# serial, name VARCHAR(0),... qualifiation VARCHAR(0), PRIMARY KEY (p#, qualifiation)); More than one qualifiation, primitive values p# is not a key. Informal guidelines () Avoid modeling more than one ojet from reality in one entity / relation CREATE TABLE Experiment ( id SERIAL PRIMARY KEY, responsile_sientist VARCHAR(0), institute VARCHAR (0), phone INT, purpose VARCHAR(00), start TIMESTAMP, endtime TIMESTAMP, result INT) Dum design! 0-DBS-NF- 0-DBS-NF-.. Update Anomalies Redundanies may ause "anomalies" Deletion of a row may delete all data aout a different ojet Update of an attriute may ause update on many rows Insertion may e diffiult / impossile, sine data are missing Update anomalies: Examples CREATE TABLE Experiment ( id SERIAL PRIMARY KEY, responsile_sientist VARCHAR(0), institute VARCHAR (0), phone INT, purpose VARCHAR(00), start TIMESTAMP, endtime TIMESTAMP, result INT) DELETE FROM Experiment WHERE result < 0 Tale definition using SQL / DDL (PostgresSQL) "update anomaly": deletion, update or insertion anomaly Data on experimenter may e lost! 0-DBS-NF- 0-DBS-NF-6
2 Update anomaly Example update Experiment set phone = 778 where resonsile_sientist = '-Lüdensheid' all those experiment tuples the experimentor of whih was '-Lüdensheid' have to e hanged update anomaly What is an insertion anomaly?.. Funtions, Funtional dependenies Important formal onept: Funtions Funtional dependenies (FD) generalize key onept FDs used to formalize integrity onstraints on attriutes and relationships Experiment (id, responsile_sientist, institute, phone,...result) {responsile_sientist} -> {institute} is a funtion whih expresses the onstraint: "The same responsile_person annot have different affiliations (institutes)" 0-DBS-NF-7 0-DBS-NF-8 Formal notation of RDM Relation: R dom(a) x dom(a) x x dom(an) Attriute set: Σ(R) = {a, a,, an} = R A, signature Tuple: r R Degree of R: numer of attriutes Relation Shema: R(a, a,, an) Dataase shema: set of relation shemas different notations in use Funtional Dependenies and keys Property of a key : at most one row for eah value Given a key, i.e. values for the key attriutes, then the value of eah a Σ(R) is unique or all values are undefined. eah suset of Σ(R) is funtional dependent on K Terminology: Relation = tale ( file) ut relations are sets. tales may have dupliate entries Tuple = row, reord Attriute = field (omponent) 0-DBS-NF-9 fname Tina Anna Carla Student name Maus mueller@... mei@... piep@... matrno key For a given key value, there is a unique value for eah attriute e.g. {matrno} {fname} 0-DBS-NF-0 Funtional Dependenies Funtional and key dependenies: onstraints (invariants) of the appliation domain "Funtional dependeny" onstraints have to e identified during requirements engineering like all onstraints. Ultimate goal: DBS monitors ompliane with DB state. Experiment (id, responsile_sientist, institute, phone,...result) Motivation for Normal Forms Suppose we an find a relational shema whih only has keyindued funtional dependenies (FD) (and "trivial" ones like {a,} -> {} ) How an we effiiently hek the DB state after an update with respet to FD? Do they still hold? A "good" shema avoids Update anomalies Costly hek of funtional dependenies after update What has to e done, when a new experiment is inserted? 0-DBS-NF- 0-DBS-NF-
3 Funtional Dependeny: : Definition Def.: Funtional Dependenies (FDs) Let A = Σ(R)* = {a,,,...a i,..} e the attriute set of a relation R, e, e' tuples of R, and X, Y A, r, r' R Y is funtionally dependent on X ( written: X Y) : ( xi X ) r.xi = r.xi ( yi Y ) e.yi = e.yi As we know: invariants are independent of the partiular dataase state They must hold at all times, i.e. they restrit the valid states of the dataase.. FD Properties Trivial funtional dependeny X Y Y X Augmentation Z A=Σ(R), X Y XZ YZ Transitivity X,Y,Z A=Σ(R), X Y, Y Z X Z Proof? Notation XY -> Z means X Y -> Z * Σ(R) : Attriute set of relation R 0-DBS-NF- 0-DBS-NF- Implied and inferred FD A funtional dependeny Y Z is alled implied y a set F= {F,, Fn} of funtional dependenies, if Y Z an e proven from F. A funtional dependeny Y Z an e inferred y a set of inferene rules R = {r, rm} from set F = {F,, Fn} of funtional dependenies if Y Z an e onstruted y a finite numer of syntati transformations of F aording to rules ri Armstrong inferene rules Given a set of FDs, find all implied FD's A sound, omplete, minimal set (Armstrong axioms): Y X X Y (I: inlusion) {X Y, Y Z} X Z (T: transitivity) {X Y} XZ YZ (A: augmentation) Sound: Only implied FDs are onstruted y the inferene rules Complete: Every implied FD will e produed y a finite numer of inferenes 0-DBS-NF- 0-DBS-NF-6 Types of Funtional Dependenies Given shema signature Σ(R) = {a,,an} Primary key P = {p, p e } Set of andidate keys C = { {k,..,k f },,{k',,k' g }} Def.: K = P» C are alled prime (or key) attriutes i.e. attriutes elonging to any andidate key. S(R) \ K : non-prime (or non-key) attriutes Types of funtional dependenies:. Key dependenies. Partial dependenies on one of the andidate keys expl.: {p#} -> {name} sine key is {p#,qualifiation} Types of FDs. Dependenies among non-key attriutes expl.: {responsile_sientist} -> {institute}. Dependenies among attriutes of different andidate keys Roadmap Funtional dependenies may ause "update anomalies" Update anomalies ause troules find relational shema without "anomalies" in ase of update Define "Normal forms" for relations whih do not show (all) anomalies Given a set of funtional dependenies, find algorithm whih generates a relational shema in some normal form 0-DBS-NF-7 0-DBS-NF-8
4 . Normal Forms.. Definitions Def.: First normal form A relation is in NF : all attriutes are single valued and atomi Customer (_id, name,, {phone}, ) (,'Miller',, {76, 7899}, ) ontradits key dependeny property: every attriute is funtionally dependent on every andidate key Seond Normal Form (NF) Def.: R is in seond normal form (NF), : X Σ( R ), a Σ ( R ) : a X a is not a prime attriute X -> a X is a key or a superset of a key ut not a proper suset of any key of R This means: No non-prime attriute funtionally depends on only a part of a key ("No partial dependeny") Building(No, roomno, rseats, Adr, NoRooms, ) 0-DBS-NF-9 0-DBS-NF-0 Third Normal Form (NF) More on NF Def.: R is in third normal form (NF) : X Σ( R ), a Σ ( R ) : a X X -> a X ontains a key or a is prime There is no funtional dependeny etween non-prime attriutes (or attriute sets). Proof? Experiment (id, responsile_sientist, institute, phone,...result) ut: {responsile_sientist} {institute} not in NF Equivalent definition: R is in NF : no non-prime attriute depends transitively on a key. A non-prime attriute y is transitively dependent on a key K, if K X and X y and not X K Notation: K X y Experiment (id, responsile_sientist, institute,..,result) 0-DBS-NF- 0-DBS-NF- NF and NF Design quality and Normal Forms R is in NF R is in NF Proof: Suppose R not in NF exists andidate key K and X K and non-prime attriute a and X a (i.e. exists partial dependeny) Sine K is a key K X a, ontradition to NF Experiment (id, responsile_sientist, institute,..,result) Indiates the modeling of two different 'real world entities' as one relation Split into two relations: Experiment (id, purpose, start, responsile,..,result); Experimentor ( p_id, intitute, phone,..) 0-DBS-NF- 0-DBS-NF-
5 DESIGN QUALITY: what do we have?. Key dependenies NF. No partial dependenies on andidate keys NF. No dependenies among non-key attriutes NF. Dependenies among attriutes of different andidate keys?? there is at least one more Normal Form whih exludes FDs etween prime attriutes. Beyond third NF Dependenies among key attriutes Example (*): R(p, o, s, n) with keys {o,s,n} and {p,s,n}, FD p -> o R in NF, ut transitive dependeny involving key attriute o: {p,s,n} -> p -> o Proposition: If R is in NF and X is a proper suset of a andidate key K and X a for some attriute a a K Corrolar: If X a is a nontrivial FD of a relation in NF, and X not a superkey X and a elong to different andidate keys 0-DBS-NF- (*) Interpretation e.g.: PLZ, Ortsteil, Straße, Nummer (in Germany) Annahme: (Ort, Straße, Nr), (PLZ, Straße, Nr) eindeutig0-dbs-nf-6 Boye Codd Normal Form (BCNF) Def.: A relation R is in BCNF : if there is a non-trivial dependenies X a then X is a superkey of R Equivalent to: X a (i) trivial or (ii) X ontains a key of R Ovious onsequene: BCNF NF NF and BCNF NF more important in pratie than BCNF Partial dependenies of andidate keys infrequent R relation in NF and andidate keys have only one attriute eah R is in BCNF R in NF and at most one andidate key has more than one attriute R is in BCNF Proof? 0-DBS-NF-7 0-DBS-NF-8 BCNF vs NF Last proposition useful in many pratial situation: If a relation R has a multi-attriute key and a unique identifier (e.g. a sequene numer) then NF implies BCNF e.g. Customer ( ID, name, ity, street, no, disount, ) has keys {ID} and {name, ity, street, no}.. Lossless property and preserving dependenies Normalization (y deomposition) Given relation R having shema Σ(R) and FD = {X Y X,Y Σ(R)} set of FDs, Find a set R,..., R n of relations in NF / BCNF suh that: Σ(R) =» Σ(R i ) For eah f = X Y FD there exists R i suh that X Y Σ(R i ) "Dependeny preserving" R an e reonstruted from R i, i=..n 0-DBS-NF-9 "Lossless" 0-DBS-NF-0
6 Joining relations When relation R has een split into relations R, R,..., R n, reonstrution of R from R,..., R n y means of the join operator Join operation (natural join): onatenate those tupels of R and S whih have same name and same value. Eliminate the redundant attriute. Lossless property Criterion for preserved information (losslessness) : R R R n = R R a R = = "Natural join" a 0-DBS-NF- a R = a = a R 0-DBS-NF- Lossless joins But a FD = {a ->, -> } In general: Deomposition of R into R and R is lossless, if Σ(R) Σ(R) Σ(R) or Σ(R) Σ(R) Σ(R) a = a Lossless joins Lossless deomposition and keys Σ(R) Σ(R) -> Σ(R) or Σ(R) Σ(R) -> Σ(R) The ommon attriute(s) of R and R are a key (or a superset of a key) of R or R Funtional dependenies are transformed into key dependenies Invariane property expressed y FDs may now e heked y heking the primary key property - effiiently done y every DBS 0-DBS-NF- 0-DBS-NF- BCNF and NF BCNF does not always guarantees oth the lossless property and dependeny preservation R(p, o, s, n) with keys {o,s,n} and {p,s,n}, FD p -> o Normalisation to BCNF: R (p,s,n) and R( p,o) Dependeny (o,s,n) -> p is lost Consequene: Normalization to NF is the est to ahieve in general.. Multivalued dependenies and NF Example Hoies(name,affiliation,hoy) B TUB B skiing Assumption: a person an have one or more affiliations, and one or more hoies, e.g {.} {,} These rows must exist (MVD restrition) Two multivalued attriutes: affiliation, hoies, oth dependent on name. Introdue redundany MVD defines whih tuples must exist. 0-DBS-NF- 0-DBS-NF-6 6
7 MVD Example with MV attriutes: {, } {,} MVD are invariants on the existene of tuples if multivalued attriutes are represented in NF Def.: MVD (multivalued dependeny) Let R = (a, y, ), is multivalued dependent on a (a ->>) if for eah value v of a {v} X (π y (σ a=v R)) X (π (σ a=v R)) R MVD: example {''} X {''} X {'skiing', ''} Person {''} X {'TU'} X {''} Person {''} X {'',} X {'',''} Person B TUB B skiing 0-DBS-NF-7 0-DBS-NF-8 Fourth Normal Form Def.: Let A, B Σ(R); R is in Fourth Normal Form if for every MVD A ->> B (i) B A or (ii) B = Σ(R) \ A or (iii) A ontains a key Example not in NF, hek(!) Normalized representation: TUB B skiing Normal forms: summary Normal forms are quality riteria for dataase design. Important: NF NF Exotis: BCNF, NF (and higher!) NF / NF formalize the asi design priniple: "Never mix up different real world entities into a single design ojet (e.g. entity)" NF / NF already defined for ERM, sine FDs are given (result of requirement analysis, just like key dependenies). 0-DBS-NF-9 0-DBS-NF-0. Finding Normal Forms Invariants of appliation domain have to e made expliit during requirements analysis e.g. A sientist has at most one affiliation her institute" A region-id is unique within a ountry A person has exatly one date of irth Formalization Funtional Dependenies Wanted: algorithm produing "good" relational shemas from the set DEP of all FDs FDs and Normal Forms Given a set of dependenies DEP there are two approahes: Synthesis Set up relations in suh a way, that All attriutes are onsumed The relations are in normal form Deomposition For a given set of relations find those whih are not normalized with respet to DEP and deompose them into normalized relations 0-DBS-NF- 0-DBS-NF- 7
8 Deomposition: eliminate FDs Given Σ(R) = U and DEP the set of FDs Algorithm DECOMP(R): (i) Find the set of keys K: K U DEP or K U DEP + (DEP+ set of all implied dependenies) (ii) Eliminate all transitive dependenies y splitting reursively: {if K Y -> a is a transitive FD in R k, split R k into R i, R j Σ(R i ) = Σ(R k ) \ {a}, Σ(R j ) = Y {a} } (iii) If no more relations R k with transitive dependeny exit else for all R k DECOMP(R k ) Synthesis Disadvantage of deomposition: ineffiient (e.g. determination of keys) produes more relations than neessary Synthesis Given relation R and set of FDs DEP Find a anonial set MIN of FDs whih "overs" DEP and is minimal. Construt normalized Relations R k from MIN with» Σ(R k ) = Σ(R) 0-DBS-NF- 0-DBS-NF- Finding a anonial set of FDs Finding a minimal over () Given a set of FDs DEP and a relational shema R - Find a minimal set MIN suh that DEP MIN + - Find a relational shema in NF, from whih R an e losslessly reonstruted MIN is alled minimal over of DEP Definitions X Y MIN + iff X Y an e proven from the FDs MIN e.g. {a, }+ = {a,, a } MIN is minimal iff for every FD f (MIN \ f) + MIN + {a d,, d e }+ = {a d,, a d, d e, a e} } Important first step: Given a set of attriutes X, determine all attriutes (losure of X) whih an e funtionally determined y X? Def.: Closure of attriute set X with respet to the set DEP of FDs is the largest set Y of attriutes suh that X Y DEP + 0-DBS-NF- 0-DBS-NF-6 Closure of attriute set X I = 0; X[0] = X; /* integer I, attr. set X[0] */ REPEAT /* loop to find larger X[I] */ I = I + ; /* new I */ X[I] = X[I-]; /* initialize new X[I] */ FOR ALL Z->W in DEP /* loop on all FDs Z ->W in DEP*/ IF Z X[I] /* if Z ontained in X[I] */ THEN X[I] = X[I] W; /* add attriutes in W to X[I]*/ END FOR /* end loop on FDs */ UNTIL X[I] = X[I-]; /* loop till no new attriutes*/ RETURN X = X[I] ; /* return losure of X */ Rule used: X -> YZ and Z -> W then X -> YZW Proof? Finding a anonial set Algorithm for determining a minimal over in polynomial time Step : Normalization Replae eah FD X Y of DEP in whih Y ontains more than one attriute, y FDs with one attriute on the right hand side DEP = {a -> d, a -> e} {a ->, a -> d, a -> e} 0-DBS-NF-7 0-DBS-NF-8 8
9 Finding a anonial set () Step : Remove redundant FDs f is redundant, if (DEP \ {f} ) + = DEP + For eah f = X Y DEP : if Y (X+) using only FDs DEP \{f} then f is redundant else not redundant { d, d e, ef a, f, a} + = {,d,e,f,a} {a} FD f= -> a is redundant Expliit derivation not using f: -> d, d -> e -> e, -> f -> ef, ef -> a -> a Finding a anonial set () Step : Minimize left hand side For of eah FD f = X Y DEP, a X DEP'= {DEP \ f } { X \ {a} Y} if {DEP}+ = (DEP') + then replae DEP y DEP' end_for If a FD f has een minimized repeat step {d -> a, -> e, e -> } + = {d -> a, -> e, e -> } + 0-DBS-NF-9 0-DBS-NF-0 Finding a anonial set () Step : Unify left hand side Applying the union rule " X Y X Z X YZ " {d -> a, d -> e, d -> f} unified: {d -> ae, d -> f} The remaining set of Funtional Dependenies is the minimal over of the original set DEP of FDs Synthesis algorithm Normalization prolem: Given a relation R in NF and a set DEP of FD Find a lossless, dependeny preserving deomposition R,,R k, all of them in NF Synthesis Algorithm Find minimal over MIN of DEP; For all X -> Y in MIN define a relation RX with shema Σ(RX) = X Y Assign all FDs X' -> Y' with X' Y' Σ(RX) to RX If none of the synthesized relations RX ontains a andidate key of R then introdue a relation Rkey whih ontains a andidate key of R Remove relations RY where: Σ(RY) Σ(RX) 0-DBS-NF- 0-DBS-NF- Normal Forms: Critial review Should relations e always normalized? Yes : makes invariant heking easy, no update anomalies No: Why should we normalize if there are no updates? Customer( u_id, name, fname, zipcode, ity, street, no) No reason to normalize into e.g.: Cu(u_Id, name, fname) and CuAdr(u_Id, zipcode, ity, street, no) if only one address per ustomer and updates are infrequent Consider ost of joins / updates How expensive are selets whih need joins eause of normalization? Updates whih ause anomalies? 0-DBS-NF- ER modeling and Normal Forms ER and Normal Forms: Two different mehanisms to design a dataase sheme ER more intuitive, NF uses algorithms ER-models often already in NF Use normalization as a omplementary design method Set up ER model Transform to relations Normalize eah non normalized relation if the tradeoff of join proessing and updating redundant data suggests to do so 0-DBS-NF- 9
4.1.1 Design quality. 4.Normalization: Quality of relational designs. Informal guidelines (2) Informal guidelines (2) Informal guidelines (1)
4.Normalization: Quality of relational designs Lit: 4.1 Funtional Dependenies 4.1.1 Design quality 4.1. Update anomalies 4.1. Funtional Dependenies: definition 4.1.4 Properties of Funtional Dependenies
More information5 Normalization:Quality of relational designs
5 Normalization:Quality of relational designs 5.1 Functional Dependencies 5.1.1 Design quality 5.1.2 Update anomalies 5.1.3 Functional Dependencies: definition 5.1.4 Properties of Functional Dependencies
More information5 Normalization:Quality of relational designs
5 Normalization:Quality of relational designs 5.1 Functional Dependencies 5.1.1 Design quality 5.1.2 Update anomalies 5.1.3 Functional Dependencies: definition 5.1.4 Properties of Functional Dependencies
More informationRelational Design: Characteristics of Well-designed DB
1. Minimal duplication Relational Design: Characteristics of Well-designed DB Consider table newfaculty (Result of F aculty T each Course) Id Lname Off Bldg Phone Salary Numb Dept Lvl MaxSz 20000 Cotts
More informationUNIT 3 DATABASE DESIGN
UNIT 3 DATABASE DESIGN Objective To study design guidelines for relational databases. To know about Functional dependencies. To have an understanding on First, Second, Third Normal forms To study about
More informationElmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant
More informationCSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization
CSE 544 Principles of Database Management Systems Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization References R&G Book. Chapter 19: Schema refinement and normal forms Also relevant to
More informationRelational Design Theory. Relational Design Theory. Example. Example. A badly designed schema can result in several anomalies.
Relational Design Theory Relational Design Theory A badly designed schema can result in several anomalies Update-Anomalies: If we modify a single fact, we have to change several tuples Insert-Anomalies:
More informationChapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases
Chapter 10 Functional Dependencies and Normalization for Relational Databases Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant
More informationSchema Refinement: Dependencies and Normal Forms
Schema Refinement: Dependencies and Normal Forms Grant Weddell David R. Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Spring 2012 CS 348 (Intro to
More informationNormalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design
1 Normalization What and Why Normalization? To remove potential redundancy in design Redundancy causes several anomalies: insert, delete and update Normalization uses concept of dependencies Functional
More informationChapter 10. Normalization. Chapter Outline. Chapter Outline(contd.)
Chapter 10 Normalization Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant Information in Tuples and Update Anomalies 1.3 Null
More informationFunctional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys)
1 / 13 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant d Information in Tuples and Update Anomalies 1.3 Null Values in Tuples 1.4 Spurious Tuples
More informationMenu. X + /X=1 and XY+X /Y = X(Y + /Y) = X
Menu K-Maps and Boolean Algera >Don t ares >5 Variale Look into my... 1 Karnaugh Maps - Boolean Algera We have disovered that simplifiation/minimization is an art. If you see it, GREAT! Else, work at it,
More informationSchema Refinement: Dependencies and Normal Forms
Schema Refinement: Dependencies and Normal Forms Grant Weddell Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Spring 2016 CS 348 (Intro to DB Mgmt)
More informationInformal Design Guidelines for Relational Databases
Outline Informal Design Guidelines for Relational Databases Semantics of the Relation Attributes Redundant Information in Tuples and Update Anomalies Null Values in Tuples Spurious Tuples Functional Dependencies
More informationCSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization
CSE 544 Principles of Database Management Systems Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization References R&G Book. Chapter 19: Schema refinement and normal forms Also relevant to this
More informationSchema Refinement: Dependencies and Normal Forms
Schema Refinement: Dependencies and Normal Forms M. Tamer Özsu David R. Cheriton School of Computer Science University of Waterloo CS 348 Introduction to Database Management Fall 2012 CS 348 Schema Refinement
More informationChapter 8: Relational Database Design
Chapter 8: Relational Database Design Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 8: Relational Database Design Features of Good Relational Design Atomic Domains
More informationDatabase Design Theory and Normalization. CS 377: Database Systems
Database Design Theory and Normalization CS 377: Database Systems Recap: What Has Been Covered Lectures 1-2: Database Overview & Concepts Lecture 4: Representational Model (Relational Model) & Mapping
More informationCOSC Dr. Ramon Lawrence. Emp Relation
COSC 304 Introduction to Database Systems Normalization Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Normalization Normalization is a technique for producing relations
More informationMODULE: 3 FUNCTIONAL DEPENDENCIES
MODULE: 3 (13 hours) Database design: functional dependencies - Inference Rules for Functional Dependencies - Closure -- Minimal Cover -Normal forms First-second and third normal forms Boyce- Codd normal
More informationRelational Database Design (II)
Relational Database Design (II) 1 Roadmap of This Lecture Algorithms for Functional Dependencies (cont d) Decomposition Using Multi-valued Dependencies More Normal Form Database-Design Process Modeling
More informationChapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies
Chapter 14 Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies Copyright 2012 Ramez Elmasri and Shamkant B. Navathe Chapter Outline 1 Informal Design Guidelines
More informationCSE 562 Database Systems
Goal CSE 562 Database Systems Question: The relational model is great, but how do I go about designing my database schema? Database Design Some slides are based or modified from originals by Magdalena
More informationFunctional Dependencies & Normalization for Relational DBs. Truong Tuan Anh CSE-HCMUT
Functional Dependencies & Normalization for Relational DBs Truong Tuan Anh CSE-HCMUT 1 2 Contents 1 Introduction 2 Functional dependencies (FDs) 3 Normalization 4 Relational database schema design algorithms
More informationRelational Database Design Theory. Introduction to Databases CompSci 316 Fall 2017
Relational Database Design Theory Introduction to Databases CompSci 316 Fall 2017 2 Announcements (Thu. Sep. 14) Homework #1 due next Tuesday (11:59pm) Course project description posted Read it! Mixer
More informationCS411 Database Systems. 05: Relational Schema Design Ch , except and
CS411 Database Systems 05: Relational Schema Design Ch. 3.1-3.5, except 3.4.2-3.4.3 and 3.5.3. 1 How does this fit in? ER Diagrams: Data Definition Translation to Relational Schema: Data Definition Relational
More informationUnit 3 : Relational Database Design
Unit 3 : Relational Database Design Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Content Relational Model: Basic concepts, Attributes and Domains, CODD's Rules, Relational
More informationDatabases -Normalization I. (GF Royle, N Spadaccini ) Databases - Normalization I 1 / 24
Databases -Normalization I (GF Royle, N Spadaccini 2006-2010) Databases - Normalization I 1 / 24 This lecture This lecture introduces normal forms, decomposition and normalization. We will explore problems
More informationFunctional Dependencies and Normalization for Relational Databases Design & Analysis of Database Systems
Functional Dependencies and Normalization for Relational Databases 406.426 Design & Analysis of Database Systems Jonghun Park jonghun@snu.ac.kr Dept. of Industrial Engineering Seoul National University
More informationRelational Database design. Slides By: Shree Jaswal
Relational Database design Slides By: Shree Jaswal Topics: Design guidelines for relational schema, Functional Dependencies, Definition of Normal Forms- 1NF, 2NF, 3NF, BCNF, Converting Relational Schema
More informationThis lecture. Databases -Normalization I. Repeating Data. Redundancy. This lecture introduces normal forms, decomposition and normalization.
This lecture Databases -Normalization I This lecture introduces normal forms, decomposition and normalization (GF Royle 2006-8, N Spadaccini 2008) Databases - Normalization I 1 / 23 (GF Royle 2006-8, N
More information3. Schema Design: Logical Design using the Relational Data Model
3. Schema Design: Logical Design using the Relational Data Model 3.1 Logical Schema Design 3.1.1 The Relational Data Model in a nutshell 3.1.2 Keys, candidate keys and more 3.2 From Conceptual to Logical
More informationNormalisation. Normalisation. Normalisation
Normalisation Normalisation Main objective in developing a logical data model for relational database systems is to create an accurate and efficient representation of the data, its relationships, and constraints
More informationSchema Refinement and Normal Forms
Schema Refinement and Normal Forms Chapter 19 Quiz #2 Next Wednesday Comp 521 Files and Databases Fall 2010 1 The Evils of Redundancy Redundancy is at the root of several problems associated with relational
More informationOn - Line Path Delay Fault Testing of Omega MINs M. Bellos 1, E. Kalligeros 1, D. Nikolos 1,2 & H. T. Vergos 1,2
On - Line Path Delay Fault Testing of Omega MINs M. Bellos, E. Kalligeros, D. Nikolos,2 & H. T. Vergos,2 Dept. of Computer Engineering and Informatis 2 Computer Tehnology Institute University of Patras,
More informationFunctional Dependencies and Finding a Minimal Cover
Functional Dependencies and Finding a Minimal Cover Robert Soulé 1 Normalization An anomaly occurs in a database when you can update, insert, or delete data, and get undesired side-effects. These side
More informationParametric Abstract Domains for Shape Analysis
Parametri Abstrat Domains for Shape Analysis Xavier RIVAL (INRIA & Éole Normale Supérieure) Joint work with Bor-Yuh Evan CHANG (University of Maryland U University of Colorado) and George NECULA (University
More informationMapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise
CSC 74 Database Management Systems Topic #6: Database Design Weak Entity Type E Create a relation R Include all simple attributes and simple components of composite attributes. Include the primary key
More informationCopyright 2016 Ramez Elmasri and Shamkant B. Navathe
CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases Slide 14-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1 Semantics of the Relation Attributes
More informationFunctional Dependencies CS 1270
Functional Dependencies CS 1270 Constraints We use constraints to enforce semantic requirements on a DBMS Predicates that the DBMS must ensure to be always true. Predicates are checked when the DBMS chooses
More informationCSCI 403: Databases 13 - Functional Dependencies and Normalization
CSCI 403: Databases 13 - Functional Dependencies and Normalization Introduction The point of this lecture material is to discuss some objective measures of the goodness of a database schema. The method
More informationFinal Review. Zaki Malik November 20, 2008
Final Review Zaki Malik November 20, 2008 Basic Operators Covered Renaming If two relations have the same attribute, disambiguate the attributes by prefixing the attribute with the name of the relation
More informationDatabase Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur
Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 19 Relational Database Design (Contd.) Welcome to module
More informationPath Sharing and Predicate Evaluation for High-Performance XML Filtering*
Path Sharing and Prediate Evaluation for High-Performane XML Filtering Yanlei Diao, Mihael J. Franklin, Hao Zhang, Peter Fisher EECS, University of California, Berkeley {diaoyl, franklin, nhz, fisherp}@s.erkeley.edu
More informationDatabase Management Systems Paper Solution
Database Management Systems Paper Solution Following questions have been asked in GATE CS exam. 1. Given the relations employee (name, salary, deptno) and department (deptno, deptname, address) Which of
More informationDatabases The theory of relational database design Lectures for m
Databases The theory of relational database design Lectures for mathematics students April 2, 2017 General introduction Look; that s why there s rules, understand? So that you think before you break em.
More informationInterconnection Styles
Interonnetion tyles oftware Design Following the Export (erver) tyle 2 M1 M4 M5 4 M3 M6 1 3 oftware Design Following the Export (Client) tyle e 2 e M1 M4 M5 4 M3 M6 1 e 3 oftware Design Following the Export
More informationDatabase Systems. Basics of the Relational Data Model
Database Systems Relational Design Theory Jens Otten University of Oslo Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 1 / 30 Basics of the Relational Data Model title year
More informationDefinitions Homework. Quine McCluskey Optimal solutions are possible for some large functions Espresso heuristic. Definitions Homework
EECS 33 There be Dragons here http://ziyang.ees.northwestern.edu/ees33/ Teaher: Offie: Email: Phone: L477 Teh dikrp@northwestern.edu 847 467 2298 Today s material might at first appear diffiult Perhaps
More informationChapter 6: Relational Database Design
Chapter 6: Relational Database Design Chapter 6: Relational Database Design Features of Good Relational Design Atomic Domains and First Normal Form Decomposition Using Functional Dependencies Second Normal
More informationDATABASE MANAGEMENT SYSTEMS
www..com Code No: N0321/R07 Set No. 1 1. a) What is a Superkey? With an example, describe the difference between a candidate key and the primary key for a given relation? b) With an example, briefly describe
More informationChapter 7: Relational Database Design
Chapter 7: Relational Database Design Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 7: Relational Database Design Features of Good Relational Design Atomic Domains
More informationEfficient and scalable trie-based algorithms for computing set containment relations
Effiient and salale trie-ased algorithms for omputing set ontainment relations Yongming Luo #1, George H. L. Flether #2, Jan Hidders 3, Paul De Bra #4 # Eindhoven University of Tehnology, The Netherlands
More informationPart V Relational Database Design Theory
Part V Relational Database Design Theory Relational Database Design Theory 1 Target Model of the Logical Design 2 Relational DB Design 3 Normal Forms 4 Transformation Properties 5 Design Methods Saake
More informationCS 338 Functional Dependencies
CS 338 Functional Dependencies Bojana Bislimovska Winter 2016 Outline Design Guidelines for Relation Schemas Functional Dependency Set and Attribute Closure Schema Decomposition Boyce-Codd Normal Form
More informationIn This Lecture. Normalisation to BCNF. Lossless decomposition. Normalisation so Far. Relational algebra reminder: product
In This Lecture Normalisation to BCNF Database Systems Lecture 12 Natasha Alechina More normalisation Brief review of relational algebra Lossless decomposition Boyce-Codd normal form (BCNF) Higher normal
More informationFigure 1. LBP in the field of texture analysis operators.
L MEHODOLOGY he loal inary pattern (L) texture analysis operator is defined as a gray-sale invariant texture measure, derived from a general definition of texture in a loal neighorhood. he urrent form
More informationCS 2451 Database Systems: Database and Schema Design
CS 2451 Database Systems: Database and Schema Design http://www.seas.gwu.edu/~bhagiweb/cs2541 Spring 2018 Instructor: Dr. Bhagi Narahari Relational Model: Definitions Review Relations/tables, Attributes/Columns,
More informationContext The Relational Data Model in a nutshell. 3.1 Logical schema design. Keep It simple, students KISS -
3. Schema Design: Logical Design using the Relational Data Model 3.1 Logical Schema Design 3.1.1 The Relational Data Model in a nutshell 3.1.2 Keys, candidate keys and more 3.2 From onceptual to Logical
More informationLecture 6a Design Theory and Normalization 2/2
CompSci 516 Data Intensive Computing Systems Lecture 6a Design Theory and Normalization 2/2 Instructor: Sudeepa Roy 1 HW1 deadline: Announcements Due on 09/21 (Thurs), 11:55 pm, no late days Project proposal
More informationDatabase design III. Quiz time! Using FDs to detect anomalies. Decomposition. Decomposition. Boyce-Codd Normal Form 11/4/16
Lecture 3 Quiz time! Database design III Functional dependencies cont. BCNF and 3NF What s wrong with this schema? {(, 2, Databases, Steven Van Acker ), (, 4, Databases, Rogardt Heldal )} Redundancy! Using
More informationPart II: Using FD Theory to do Database Design
Part II: Using FD Theory to do Database Design 32 Recall that poorly designed table? part manufacturer manaddress seller selleraddress price 1983 Hammers R Us 99 Pinecrest ABC 1229 Bloor W 5.59 8624 Lee
More informationFUNCTIONAL DEPENDENCIES
FUNCTIONAL DEPENDENCIES CS 564- Spring 2018 ACKs: Dan Suciu, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? Database Design Theory: Functional Dependencies Armstrong s rules The Closure Algorithm
More informationCase Study: Lufthansa Cargo Database
Case Study: Lufthansa Cargo Database Carsten Schürmann 1 Today s lecture More on data modelling Introduction to Lufthansa Cargo Database Entity Relationship diagram Boyce-Codd normal form 2 From Lecture
More informationChapter 16. Relational Database Design Algorithms. Database Design Approaches. Top-Down Design
Chapter 16 Relational Database Design Algorithms Database Design Approaches Top-Down design (Starting with conceptual design) Bottom-Up Design (relational synthesis) 2 Top-Down Design Design conceptual
More informationUNIT -III. Two Marks. The main goal of normalization is to reduce redundant data. Normalization is based on functional dependencies.
UNIT -III Relational Database Design: Features of Good Relational Designs- Atomic Domains and First Normal Form- Second Normal Form-Decomposition Using Functional Dependencies- Functional-Dependency Theory-Algorithms
More informationDatabase Design Principles
Database Design Principles CPS352: Database Systems Simon Miner Gordon College Last Revised: 2/11/15 Agenda Check-in Design Project ERD Presentations Database Design Principles Decomposition Functional
More informationRelational Database Systems 1. Christoph Lofi Simon Barthel Institut für Informationssysteme Technische Universität Braunschweig
Relational Database Systems 1 Christoph Lofi Simon Barthel Institut für Informationssysteme Technische Universität Braunschweig www.ifis.cs.tu-bs.de 10.0 Introduction Up to now, we have learned... how
More informationDatabase Constraints and Design
Database Constraints and Design We know that databases are often required to satisfy some integrity constraints. The most common ones are functional and inclusion dependencies. We ll study properties of
More informationRelational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up
Relational Database Design CPS 216 Advanced Database Systems Announcements 2 DB2 accounts have been set up Let me know if you have not received an email from me regarding your account Recitation session
More informationCarnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Overview - detailed. Goal. Faloutsos & Pavlo CMU SCS /615
Faloutsos & Pavlo 15-415/615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications Lecture #17: Schema Refinement & Normalization - Normal Forms (R&G, ch. 19) Overview - detailed
More informationDynamic Algorithms Multiple Choice Test
3226 Dynami Algorithms Multiple Choie Test Sample test: only 8 questions 32 minutes (Real test has 30 questions 120 minutes) Årskort Name Eah of the following 8 questions has 4 possible answers of whih
More informationNormalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms
Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms Normalization Niklas Fors (niklas.fors@cs.lth.se) Normalization 1 / 45
More informationCompilation Lecture 11a. Register Allocation Noam Rinetzky. Text book: Modern compiler implementation in C Andrew A.
Compilation 0368-3133 Leture 11a Text book: Modern ompiler implementation in C Andrew A. Appel Register Alloation Noam Rinetzky 1 Registers Dediated memory loations that an be aessed quikly, an have omputations
More informationCMU SCS CMU SCS CMU SCS CMU SCS whole nothing but
Faloutsos & Pavlo 15-415/615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications Lecture #17: Schema Refinement & Normalization - Normal Forms (R&G, ch. 19) Overview - detailed
More informationRelational Design Theory
OpenStax-CNX module: m28252 1 Relational Design Theory Nguyen Kim Anh This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Abstract One important theory
More informationExploring the Commonality in Feature Modeling Notations
Exploring the Commonality in Feature Modeling Notations Miloslav ŠÍPKA Slovak University of Tehnology Faulty of Informatis and Information Tehnologies Ilkovičova 3, 842 16 Bratislava, Slovakia miloslav.sipka@gmail.om
More informationV. Database Design CS448/ How to obtain a good relational database schema
V. How to obtain a good relational database schema Deriving new relational schema from ER-diagrams Normal forms: use of constraints in evaluating existing relational schema CS448/648 1 Translating an E-R
More informationRelational Database Systems 1
Relational Database Systems 1 Wolf-Tilo Balke Simon Barthel Institut für Informationssysteme Technische Universität Braunschweig www.ifis.cs.tu-bs.de 10.0 Introduction Up to now, we have learned......
More informationDynamic Programming. Lecture #8 of Algorithms, Data structures and Complexity. Joost-Pieter Katoen Formal Methods and Tools Group
Dynami Programming Leture #8 of Algorithms, Data strutures and Complexity Joost-Pieter Katoen Formal Methods and Tools Group E-mail: katoen@s.utwente.nl Otober 29, 2002 JPK #8: Dynami Programming ADC (214020)
More informationNORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18
NORMAL FORMS CS121: Relational Databases Fall 2017 Lecture 18 Equivalent Schemas 2 Many different schemas can represent a set of data Which one is best? What does best even mean? Main goals: Representation
More informationA {k, n}-secret Sharing Scheme for Color Images
A {k, n}-seret Sharing Sheme for Color Images Rastislav Luka, Konstantinos N. Plataniotis, and Anastasios N. Venetsanopoulos The Edward S. Rogers Sr. Dept. of Eletrial and Computer Engineering, University
More informationAlgorithms for External Memory Lecture 6 Graph Algorithms - Weighted List Ranking
Algorithms for External Memory Leture 6 Graph Algorithms - Weighted List Ranking Leturer: Nodari Sithinava Sribe: Andi Hellmund, Simon Ohsenreither 1 Introdution & Motivation After talking about I/O-effiient
More informationFINAL EXAM REVIEW. CS121: Introduction to Relational Database Systems Fall 2018 Lecture 27
FINAL EXAM REVIEW CS121: Introduction to Relational Database Systems Fall 2018 Lecture 27 Final Exam Overview 2 Unlimited time, multiple sittings Open book, notes, MySQL database, etc. (the usual) Primary
More informationLecture 4. Database design IV. INDs and 4NF Design wrapup
Lecture 4 Database design IV INDs and 4NF Design wrapup Problem description We want a database that we can use for scheduling courses and lectures. This is how it s supposed to work: code name Course dept
More informationA DYNAMIC ACCESS CONTROL WITH BINARY KEY-PAIR
Malaysian Journal of Computer Siene, Vol 10 No 1, June 1997, pp 36-41 A DYNAMIC ACCESS CONTROL WITH BINARY KEY-PAIR Md Rafiqul Islam, Harihodin Selamat and Mohd Noor Md Sap Faulty of Computer Siene and
More informationIncremental Mining of Partial Periodic Patterns in Time-series Databases
CERIAS Teh Report 2000-03 Inremental Mining of Partial Periodi Patterns in Time-series Dataases Mohamed G. Elfeky Center for Eduation and Researh in Information Assurane and Seurity Purdue University,
More informationInternational Journal of Advancements in Research & Technology, Volume 3, Issue 3, March-2014 ISSN
International Journal of Advanements in Researh & Tehnology, Volume 3, Issue 3, Marh-204 ISSN 2278-773 47 Phrase Based Doument Retrieving y Comining Suffix Tree index data struture and Boyer- Moore faster
More informationThe Happy Ending Problem
The Happy Ending Problem Neeldhara Misra STATUTORY WARNING This doument is a draft version 1 Introdution The Happy Ending problem first manifested itself on a typial wintery evening in 1933 These evenings
More informationFunctional dependency theory
Functional dependency theory Introduction to Database Design 2012, Lecture 8 Course evaluation Recalling normal forms Functional dependency theory Computing closures of attribute sets BCNF decomposition
More informationTDDD12 Databasteknik Föreläsning 4: Normalisering
What is Good Design TDDD12 Databasteknik Föreläsning 4: Normalisering Can we be sure that the translation from the EER diagram to relational tables results in a good database design? Or: Confronted with
More informationConcepts from
1 Concepts from 3.1-3.2 Functional dependencies Keys & superkeys of a relation Reasoning about FDs Closure of a set of attributes Closure of a set of FDs Minimal basis for a set of FDs 2 Plan How can we
More informationRelational Database Systems 1 Wolf-Tilo Balke Hermann Kroll, Janus Wawrzinek, Stephan Mennicke
Relational Database Systems 1 Wolf-Tilo Balke Hermann Kroll, Janus Wawrzinek, Stephan Mennicke Institut für Informationssysteme Technische Universität Braunschweig www.ifis.cs.tu-bs.de 10.0 Introduction
More informationFunctional Dependencies and Normalization
Functional Dependencies and Normalization Jose M. Peña jose.m.pena@liu.se Overview Real world Databases DBMS Model Physical database Queries Processing of queries and updates Access to stored data Answers
More informationRelational Model and Relational Algebra A Short Review Class Notes - CS582-01
Relational Model and Relational Algebra A Short Review Class Notes - CS582-01 Tran Cao Son January 12, 2002 0.1 Basics The following definitions are from the book [1] Relational Model. Relations are tables
More informationCS352 Lecture - Conceptual Relational Database Design
CS352 Lecture - Conceptual Relational Database Design Objectives: last revised September 16, 2004 1. To define the concepts functional dependency and multivalued dependency 2. To show how to find the closure
More informationRyan Marcotte CS 475 (Advanced Topics in Databases) March 14, 2011
Ryan Marcotte www.cs.uregina.ca/~marcottr CS 475 (Advanced Topics in Databases) March 14, 2011 Outline Introduction to XNF and motivation for its creation Analysis of XNF s link to BCNF Algorithm for converting
More informationNormal Forms. Winter Lecture 19
Normal Forms Winter 2006-2007 Lecture 19 Equivalent Schemas Many schemas can represent a set of data Which one is best? What does best even mean? Main goals: Representation must be complete Data should
More information