0% found this document useful (0 votes)
5 views

Database Systems Notes1 2

The document discusses functional dependencies and normalization in database design. Functional dependencies define constraints between attribute sets in a relation. Normalization is the process of reducing redundancies and ensuring data integrity through decomposing relations and eliminating anomalies. The goals of normalization include characterizing and removing redundancy from database schemas.

Uploaded by

5frq4hkpc5
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Database Systems Notes1 2

The document discusses functional dependencies and normalization in database design. Functional dependencies define constraints between attribute sets in a relation. Normalization is the process of reducing redundancies and ensuring data integrity through decomposing relations and eliminating anomalies. The goals of normalization include characterizing and removing redundancy from database schemas.

Uploaded by

5frq4hkpc5
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Functional Dependencies: • Let R be a relational schema

• Functional dependency is a set of constraints between two attribute sets in a relation. α ⊆ R and β⊆ R
• Functional dependency says that if two tuples have the same values for attributes A1,
A2,..., An, then those two tuples must have the same values for attributes B1, B2, ..., Bn. • The functional dependency
• Functional dependency is represented by an arrow sign (→) that is, X→Y, where X α→β
functionally determines Y.
• The left-hand side attributes determine the values of attributes on the right-hand side. holds on R if and only if for any legal relations r(R),
• There is a set of rules for the data in the real world. Such as, a person can not have his whenever any two tuples t1 and t2 of r agree on the
name in numeric characters. attributes α, they also agree on the attributes β. That is,
• Some constraints that can be applied to the database of a university database are given t1[α] = t2 [α] ⇒ t1[β] = t2 [β]
below:
§ Students and teachers are identified by their unique IDs. • Example: Consider the student table, student_id → Name,
§ Every student and teacher has only one name. but not vice versa
§ Every student and teacher is associated with only one department.
§ Each department has one value for the chairperson, building and budget.
Armstrong’s Axioms:
• Armstrong's Axioms are a set of rules, when applied
• Example
repeatedly, it generates a closure of functional
(Image 60) Functional Dependencies: dependencies.
• If F is a set of functional dependencies then the closure
of F, denoted as F+ , is the set of all functional
dependencies logically implied by F.
• Reflexive rule− If alpha is a set of attributes and beta
is_subset_of alpha, then alpha holds beta.
• Augmentation rule− If a → b holds and y is attribute
set, then ay → by also holds. That is adding attributes in
• The student_id is unique in the above table so we can get record of student(s) through
dependencies, does not change the basic dependencies.
student_id.
• If two or more students have the same name, we can differentiate them through • Transitivity rule− Same as transitive rule in algebra, if a
→ b holds and b → c holds, then a → c also holds. a → b
student_id.
is called as a functionally that determines b.
46
Trivial Functional Dependency: • Normalization should be part of the database design process.
• Trivial− If a functional dependency (FD) X → Y holds, • However, it is difficult to separate the normalization process from the ER modelling
where Y is a subset of X, then it is called a trivial FD. process so the two techniques should be used concurrently.
Trivial FDs always hold. • Entity Relation Diagram (ERD) should be used to provide the big picture, or macro
• Non-trivial− If an FD X → Y holds, where Y is not a view, of an organization’s data requirements and operations.
subset of X, then it is called a non-trivial FD. • This is created through an iterative process that involves identifying relevant
• Completely non-trivial− If an FD X → Y holds, where X entities, their attributes and their relationships.
intersect Y = Φ, it is said to be a completely non-trivial FD. • The normalization procedure focuses on the characteristics of specific entities and
represent the micro view of entities within the ERD after being transformed into
relational tables.
Normalization:
• Normalization rules divides larger tables into smaller tables and links them using
• Normalization is a process of making the database consistent by
relationships.
reducing the redundancies and ensuring the integrity of data through
• The purpose of normalization is to eliminate redundant (repetitive) data and ensure
lossless decomposition.
data is stored logically.
• Normalization is the process of decomposing unsatisfactory/bad
• The theory of normalization was introduced by Edgar Codd with the introduction of
relations by breaking up their attributes into smaller relations.
First Normal Form (1NF).
• If the design of a database is not thorough, it may contain anomalies.
• Edgar Codd extended his theory with Second and Third Normal Form.
• Managing a database with anomalies is a hefty and difficult task.
• Later on, Edgar Codd joined Raymond F. Boyce to develop the theory of Boyce-
• There are three types of anomalies which can affect interaction with
Codd Normal Form.
database.
Importance of Normalization
§ Update anomalies− If data items are scattered and are not linked
• During the normalization process of database design, it is ensured that proposed
properly, then it could lead to strange situations.
entities meet required normal form before table structures are created.
Ø For example, when we try to update one data item that has
• Many real-world databases have been improperly designed or burdened with
copies in many other tables, there is a very much high possibility of
anomalies if improperly modified during the course of time.
updating some records and the other remain unedited leading to
• Database Administrators may be asked to redesign and modify existing databases.
inconsistency.
• This can be a large undertaking if the tables are not properly normalized.
§ Deletion anomalies− While deleting a record, some instances of it
Goals of Normalization
can be left undeleted because of unawareness and saving of data in
• Normalization is the branch of relational theory that provides design insights. It is
other tables.
the process of determining how much redundancy exists in a table.
§ Insert anomalies− To insert data in a record that does not exist at
• The goals of normalization are to:
all.
§ Be able to characterize the level of redundancy in a relational schema.
47
§ Provide mechanisms for transforming schemas in order to remove redundancy.

You might also like