Module:5�Relational–Database Design
Ms. Khushbu Tikhe
Assistant Professor
Department of Electronics Engineering
SLRTCE, Mira Road
Pitfalls in Relational-Database designs
but A bad design may lead to
Pitfalls in Relational-Database designs
1. Repetition of information
2. Inability to represent certain information
Example: The information concerning loans is now kept in one singlerelation, lending, which is defined over the relation schema.
Lending-schema=(branch-name, branch-city, assets, customer- name, loan-number, amount)
Example:
Problems:
1. add a new loan The loan is made by the Perryridge branch to Adams in the amount of $1500. Let the loan-number be L-31.
ⅰ Repeating information wastes space.
ⅱ Repeating information complicates updating the database.
2. we cannot represent directly the information concerning a branch.(branch-name, branch-city,assets) unless there exists at least one loan at the branch.
The problem is that tuples in the lending relation require values for loan-number, amount and customer-name.
Solution: introduce null values to handle updates through views.
Among the undesirable properties that a bad design may have
3. Dependency of various attributes of relation:
4. Loss of information:
Design Guideliness for Relational Schema
Introduction:
Note:
Spurious Tuples :�Spurious Tuples are those rows in a table, which occur as a result of joining two tables in wrong manner. They are extra tuples (rows) which might not be required.
Relational Decomposition
Types of Decomposition
a. Lossless join Decomposition
Example
Employee ⋈ Department
b. Dependency Preservation
c. No repetation of information
Normalization Process
Functional Dependencies
X → Y
Emp_Id → Emp_Name
Example:�Consider an employee table:
Types of Functional Dependencies
Full Functional Dependency
EXAMPLE:
Partial Functional Dependency
Multivalued dependency
In this example, maf_year and color are independent of each other but dependent on car_model. In this example, these two columns are said to be multivalue dependent on car_model.
This dependence can be represented like this:
car_model -> maf_year
car_model-> colour
Trivial Functional dependency
Non trivial functional dependency
Transitive dependency
FD Properties(Armstrong's Axioms/Closures of FD)
2. Additional rules or Secondary rules
1. Axioms or primary rules
Axiom of Reflexivity:
Axiom of Augmentation:
Axiom of Transitivity:
2. Additional rules or secondary rules
Union:
Composition:
2. Additional rules or secondary rules
Decomposition:
Pseudo Transitivity:
Keys and Attributes in Keys
Super Keys:- Example
Candidates Key :- Example
First Normal Form(1NF)
1. First Normal Form –
Minimize Domain Redundancy:
Second Normal Form(2NF)
Example:
Example 2 –
Consider following functional dependencies in relation R (A, B , C, D )
Minimizing Tuple Redundancy:
Third Normal Form(3NF)
Minimizing Group Redundancy:
Boyce-Codd Normal Form
BCNF states that −
and
Example
Example2
Employee table.
Key Points –
What is Multi-valued Dependency?
Example
Dependency Diagram
References