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

Database Design and Normalization

The document covers database design and normalization, outlining its importance for data management and manipulation. It discusses the Entity-Relationship (ER) model, normalization techniques (1NF, 2NF, 3NF), and the phases of database design: conceptual, logical, and physical. Additionally, it provides insights into data modeling, the principles of database design, and the representation of entities, attributes, and relationships.

Uploaded by

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

Database Design and Normalization

The document covers database design and normalization, outlining its importance for data management and manipulation. It discusses the Entity-Relationship (ER) model, normalization techniques (1NF, 2NF, 3NF), and the phases of database design: conceptual, logical, and physical. Additionally, it provides insights into data modeling, the principles of database design, and the representation of entities, attributes, and relationships.

Uploaded by

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

Database Design

and Normalization
GBETNKOM NJIFON Jeff, Lecturer
Lesson objectives
● Explain the importance and benefits of database design for data
management and manipulation.
● Identify the main components and concepts of the Entity-Relationship (ER)
model, such as entities, attributes, relationships, cardinalities, and keys.
● Create an ER diagram for a given scenario or problem using a standard
notation, such as Chen or Crow's Foot.
● Apply the normalization techniques of first normal form (1NF), second
normal form (2NF), and third normal form (3NF) to eliminate data
redundancy and anomalies in a relational database schema.
● Evaluate the quality and efficiency of a database design based on the ER
model and the normalization rules.
Content
● Principles of database design
● Entity-Relationship (ER) modeling
● Normalization techniques (1NF, 2NF, 3NF)
Principles of database design
Presentation
The two main approaches to the design of a database are referred to as
“bottom- up” and “top-down.”
● The bottom-up approach begins at the fundamental level of attributes
(that is, properties of entities and relationships), which through analysis of
the associations between attributes are grouped into relations that
represent types of entities and relationships between entities.
● The top-down starts with the development of data models that contain a
few high-level entities and relationships and then applies successive
top-down refinements to identify lower-level entities, relationships, and
the associated attributes.
Data modeling
The two main purposes of data modeling are to assist in the understanding of
the meaning (semantics) of the data and to facilitate communication about
the information requirements.

Database design is made up of three main phases: conceptual, logical, and


physical design.
● Identify entity types
● Identify relationship types
Identify and associate attributes
Conceptual database

with entity or relationship types
● Determine attribute domains

design ●


Determine candidate, primary, and
alternate key attributes
Consider use of enhanced
The process of constructing a model of the data used in an modeling concepts (optional step)
enterprise, independent of all physical considerations. ● Check model for redundancy
● Validate conceptual data model
against user transactions
● Review conceptual data model with
user
● Derive relations for logical
data model

Logical database ● Validate relations using


normalization
● Validate relations against user
design ●
transactions
Check integrity constraints
The process of constructing a model of
● Review logical data model
the data used in an enterprise with user
based on a specific data model, but ● Merge logical data models
independent of a particular DBMS into global model (optional
and other physical considerations. step)
● Check for future growth
Physical database
Design base relations
design

● Design representation of
derived data
The process of producing a description of the ● Design general constraints
implementation of the database on secondary storage; it
describes the base relations, file organizations, and
indexes used to achieve efficient access to the data,
and any associated integrity constraints and security
measures.
Entity/Relationship modeling
Presentation
● Objective: To build a conceptual data model of the data requirements of
the enterprise.
● The “boss” knows they want a database, but they don’t know what they
want in it.
● Sketching the key components is an efficient way to develop a working
database.
Terminology
● Entity = “thing” or object, real life abstract concept. It can be weak or
strong according to an existent dependency on another entity.
● Attribute = property of an entity. Attributes are simple values, e.g. integers
or character strings. Not structs, sets, etc.
● A relationship connects two or more entity and represents an interaction.
● A key is a set of attributes for one entity such that no two instances of this
entity in this set agree on all the attributes of the key.
● Redundancy = saying the same thing in two (or more) different ways.
Representation
● An entity is represented by a rectangle on an E/R diagram.
● A relationship is represented by a diamond shape.
● An attribute is represented by an oval shape.
Example - 1/2

● Beers has two attributes, name and manf (manufacturer).


Example - 2/2
Example - 2/2 (explanation)
● Bars sell some beers.
● Drinkers like some beers.
● Drinkers frequent some bars.
Types of relationship
Normalization techniques
Presentation
Normalization is a technique for producing a set of relations with desirable
properties, given the data requirements of an enterprise.
The purpose of normalization is to identify a suitable set of relations that support
the data requirements of an enterprise. The characteristics of a suitable set of
relations include the following:
● the minimal number of attributes necessary to support the data requirements
of the enterprise;
● attributes with a close logical relationship are found in the same relation;
● minimal redundancy, with each attribute represented only once, with the
important exception of attributes that form all or part of foreign keys, which are
essential for the joining of related relations.
First Normal Form (1FN)
● Property: A relation in which the intersection of each row and column
contains one and only one value.
First Normal Form (1NF)
● The previous table is not in 1NF because each client rental has several values under some
columns (propertyNo, pAddress, etc.)
● To fix this, there should be a single value for each cell of each record of a table as shown below.
Second Normal Form (2NF)
● Property: The table should be in 1NF and all non-key fields must be a function of the
full key.
● The example shown below violates the 2NF because Key is Part + Warehouse but
Warehouse address is repeated in every row that refers to a part stored in a
warehouse.
Second Normal Form (2NF)
● Solution: split the initial table into two new relations.
Third Normal Form (3NF)
● Property: The relation should be in 2NF and non-key fields cannot be a
function of other nonkey fields.
● The example shown below violates the 3NF property because Key is
employee but Department location is repeated in every employee record.
If department location changes, every record with it must be changed
Third Normal Form (3NF)
● Solution: split the initial table into two new tables.
Assignment
● Install MySQL and PostgreSQL
Cheers mates !

You might also like