Professional Documents
Culture Documents
relational design
and schema
refinement
By Shivam Chauhan -
11814901719, BBA(G) IV-C.
Features of good relational
design
I. Relation for every entity
II. Lesser number of Null values
III. No spurious tuples
IV. No Redundancy
V. No modification anomaly
1. Relation For Every Entity
Attributes describe
the characteristics or – Informally, each tuple in a relation should represent one entity or
properties of an entity
in a database table. ... relationship instance. (Applies to individual relations and their
The attribute values,
of each student entity,
attributes).
will define its – Attributes of different entities (EMPLOYEEs, DEPARTMENTSs,
characteristics in the
table. In a relational PROJECTs) should not be mixed in the same relation.
database, we store
data in the form of – Only foreign keys should be used to refer to other entities.
tables. The column
header of the table
– Entity and relationship attributes should be kept apart as much as
represents possible.
the attributes.
2. Lesser Number of Null Values:
– Relations should be designed such that their tuples will have as
few NULL values as possible.
– Attributes that are NULL frequently added in separate relations
(with the CPL primary key).
– Reasons for nulls:
• Attributes not applicable or invalid
• Attribute value unknown (may exist)
• Value known to exist, but unavailable
3. Decomposition (Spurious Tuples):
Spurious Tuples are
those rows in a table,
which occur as a result – Bad designs for a relational database may result in erroneous
of joining two tables in
wrong manner. They are
results for a certain JOIN operations.
extra tuples (rows) – The “lossless join” property is used to guarantee meaningful
which might not be
required. results for join operations.
In database- – The relations should be designed to satisfy the lossless join
ese, spurious condition.
tuples are created
when two tables are – No spurious tuples should be generated by doing a natural-join of
joined on attributes that
are neither primary keys any relations.
nor foreign keys.
– There are two important properties of decompositions:
1. Non-addictive or of the corresponding join losslessness.
2. Preservation of the functional dependencies.
– Lossless Decomposition.
– It is a process of splitting a relation into multiple relations and joins
back the relations to get the original relation.
Here is an example
of spurious tuples.
Where we have a
schema for ID,
Name and Year of Example of Spurious Tuples
birth of two
different people.
ID NAME YOB
If we separate it
into two relation 1 100 Vinesh 2015
has ID and Name 200 Vinesh 1980
and relation 2 has
Name and Year of
birth. If we separate it into two
Relation 1 Relation 2
Here spurious
tuples are ID NAME YOB
created after the 100 Vinesh 2015
two tables were
100 Vinesh 1980
joined in the
wrong manner. 200 Vinesh 2015 Spurious Tuples
200 Vinesh 1980
– Types of anomaly:
1. Update Anomalies
2. Deletion Anomalies
3. Insert Anomalies
1. Update Anomalies
– If data items are scattered and are not linked to each other
properly, then it could lead to strange situations.
– For example, when we try to update one data item having its
copies scattered over several places, a few instances get updated
properly while few others are left with old values.
Schema Refinement
The term "schema"
refers to the The Schema Refinement refers to refine the schema by using some
organization of data as technique. The best technique of schema refinement is decomposition.
a blueprint of how the
database is constructed Schema Refinement is a technique of organizing the data in the
(divided into database
tables in the case of
database. It is a systematic approach of decomposing tables to eliminate
relational databases). data redundancy and undesirable characteristics like Insertion, Update
The formal definition of
a database schema is
and Deletion Anomalies. Redundancy refers to repetition of same data
a set of formulas or duplicate copies of same data stored in different locations. Anomalies:
(sentences) called
integrity constraints Anomalies refers to the problems occurred after poorly planned and
imposed on a database normalized databases where all the data is stored in one table which is
sometimes called a flat file database.
Two levels of designing relation
schemas
– The storage "base relation" level: Design and storage processes are
concerned mainly with base relations. It explains how the tuples in a
base relation are stored.
INFORMAL DESIGN GUIDELINES FOR
RELATION SCHEMA
A) True
B) False
MCQ 3
Q3. Which of the following is not a feature of a good relational
design? Answer: B
A) No redundancy
B) More number of Null values
C) No modification anomaly
D) Relation for every entity
Thank You