Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 70 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
70
Dung lượng
1,58 MB
Nội dung
Chapter 06: DatabaseDesign Normalisation • Improves databasedesign by reducing redundancy. • Produces sets of relations ( tables ) with desirable properties. • Main Deliverable for Logical Modelling. • NB Description is logical not physical. Relations • Special types of tables where :- – Each cell is single valued – in a given column, entries are the same type – each row is unique( PK) – sequence of rows and columns is unimportant • We must structure tables to ensure minimal redundancy. Problems of Redundancy • Information redundancy - data stored many times increases storage requirements. Fig 6.2 • Insertion Anomalies - having to enter redundant data for each new entry or leaving a PK Null - which breaches - what type of integrity? Ie a new branch and no staff Problems of Redundancy • Deletion Anomalies - 1 row is deleted and other data is lost. Ie deletion of Branch B7 leads to loss of data on staff Member SA9 in Fig 6.2 • Modification Anomalies - Changing a data many times in many places or integrity is lost due to an anomaly. Redundancy Example • What anomalies could the relation below suffer from?PK is Empid and Course Empid Name Dept Salary Course Date 100 Simpson Marketing 42 000 SPSS 6 Oct 90 100 Simpson Marketing 42 000 Surveys 10 Jun 91 • This is prone to cause errors. • Find examples of the three types of Anomaly in the above table FUNCTIONAL DEPENDENCIES Definition • Let R be the relation, and let x and y be the arbitrary subset of the set of attributes of R. Then we say that Y is functionally dependent on x – in symbol. X → Y (Read x functionally determines y) – If and only if each x value in R has associated with it precisely one y value in R In other words Whenever two tuples of R agree on their x value, they also agree on their Y value. Example S # City P # QTY S1 London P1 100 S1 London P2 100 S2 Paris P1 200 S2 Paris P2 200 S3 Delhi P2 300 S4 Kolkata P2 400 S4 Kolkata P2 400 S4 Kolkata P5 400 Example One FD : - ( { S#} → {City} ) • Because every tuple of that relation with a given S# value also has the same city value. • The left and right hand side of an FD are sometimes called determinant and the dependents respectively. [...]... purpose in database design • Types of normal forms 1NF, 2NF, 3NF, BCNF, and 4NF • Transformation from lower normal forms to higher normal forms • Design concurrent use of normalization and E-R modeling are to produce a good database design • Usefulness of denormalization to generate information efficiently Normalization • Main objective in developing a logical data model for relational database systems... controlled redundancies to link tables • Normalization stages – – – – 1NF 2NF 3NF 4NF - First normal form Second normal form Third normal form Fourth normal form Data Redundancy • Major aim of relational database design is to group attributes into relations to minimize data redundancy and reduce file storage space required by base relations • Problems associated with data redundancy are illustrated by comparing . Chapter 06: Database Design Normalisation • Improves database design by reducing redundancy. • Produces sets of relations ( tables