You are on page 1of 50

Database Relationship and

Normalization
Presented by Group 2
Reporters

Bhea Marie Jonalyn Ragadio


Cervantes Mark Andrie Codog
Table of Contents
2.1: Relational Database Model

2.2: Entity Relationship ER Modeling

2.3: Converting an ER model into a


Data Structure
INTRODUCTION
Database relationships and normalization are fundamental
principles in the design and implementation of relational
databases. They are widely adopted across various industries and
have played a significant role in developing efficient and reliable
data management systems.
R E L AT I O N A L
D AT A B A S E
MODEL
W H AT I S
R E L AT I O N A L
D AT A B A S E M O D E L

A relational database is a type of database that stores and allows access to data. These
types of databases are referred to as "relational" because the data items within them
have pre-determined relationships with one another. Data in a relational database is
stored in tables. The tables are connected by unique IDs or "keys." When a user needs to
access specific information, they can use a key to access all the tables of data that have
been pre-determined to be related to that key.
RELATION
ATTRIBUTE
DOMAIN
TUPLE.
CONSTRAINTS IN RELATIONAL
MODEL

Domain Constraints: These are attribute-level constraints. An attribute can only take values that lie inside the
domain range. e.g; If a constraint AGE>0 is applied to STUDENT relation, inserting a negative value of AGE
will result in failure.
Key Integrity: Every relation in the database should have at least one set of attributes that defines a tuple
uniquely. Those set of attributes is called keys. e.g.; ROLL_NO in STUDENT is a key. No two students can
have the same roll number.
Referential Integrity: When one attribute of a relation can only take values from another attribute of the same
relation or any other relation, it is called referential integrity. Let us suppose we have 2 relations
CHARACTERISTICS OF
R E L AT I O N A L M O D E L :

• Data is represented into rows and columns called as relation. Data is stored in tables
having relationship between them called Relational model.
• Relational model supports the operations like Data definition, Data manipulation,
Transaction management.
• Each column have distinct name and they are representing attribute.
• Each row represents the single entity.
ADVANTAGE AND DISSADVANTAGE OF
RELATIONAL DATABASE MODEL

Advantages:
• Simple model
• It is Flexible
• It is Secure
• Data accuracy
• Data integrity
• Operations can be applied easily.

Disadvantage:
• Not good for large database
• Relation between tables become difficult some
time.
CONVERTING AN
ER MODEL INTO
A DATABASE
STRUCTURE
INTRODUCTION
Converting an ER model into a database structure involves translating the
conceptual design of an ER model into a physical database structure that can be
implemented in a DBMS. The process includes steps such as Identifying Entities
and their Attributes, Defining Relationships and Cardinality, Applying
Normalization techniques, Establishing Keys, Determining data types, Creating
tables, Defining constraints, Indexing, and Optimizing the Design. The goal is to
create a database structure that accurately represents the entities, relationships,
and attributes of the real-world system,
THE PROCESS OF CONVERTING
AN ER
MODEL INTO A DATABASE
STRUCTURE
DEFINING
DEFINING
RELATIONSHI
KEYS
PS

IDENTIFYIN NORMALIZA RESOLVING


G ENTITIES TION ATTRIBUTES
THE PROCESS OF CONVERTING
AN ER
MODEL INTO A DATABASE
STRUCTURE

CREATING INDEXIN
TABLES G

ESTABLISHI DEFINING FINE-TUNING


NG DATA CONSTRAIN AND
TYPES TS OPTIMIZATION
IDENTIFYING ENTITIES
Identify the entities in the ER model and define their attributes.
Entities represent real-world objects or concepts, such as
Customers, Products, or Employees.
HERE ARE THE STEPS TO IDENTIFY
ENTITIES IN AN ER MODEL

UNDERSTAND IDENTIFY THE


OBJECTS OR AVOID
THE DOMAIN CONCEPTS
Gain a thorough Identify the main objects or DUPLICATION
Ensure that entities are not
understanding of the system concepts that are essential duplicated or redundant.
or domain that the ER model to the system. These objects Each entity should
is representing. This involves should be independent and represent a unique concept
analyzing the requirements,
have a clear existence on or object in the system.
studying existing processes,
their own.
and consulting with domain
experts.
HERE ARE THE STEPS TO IDENTIFY
ENTITIES IN AN ER MODEL

CONSIDER USE APPROPRIATE


NAMING REVIEW AND
RELATIONSHIPS CONVENTIONS
Choose meaningful and REFINE
Review the identified
Analyze the relationships entities and refine the list as
descriptive names for
between objects or needed. Seek feedback from
entities. The names stakeholders and experts to
concepts to identify
should accurately ensure that all relevant
additional entities.
represent the underlying entities are included and
objects or concepts they unnecessary entities are
represent. excluded.
DEFINING RELATIONSHIPS

Determine the relationships between entities and


specify their cardinality Relationships establish
associations between entities and represent how they
interact or relate to each other.
Identify Relationship Types

Determine the types of relationships that exist between


entities. Common relationship types include one-to-one,
one-to-many, and many-to-many.
One-to-one (1:1): In this type, each instance of one entity is

1. associated with exactly one instance of another entity, and vice


versa.

One-to-many (1:N): In this type, an instance of one entity can be

2. associated with multiple instances of another entity, but each


instance of the other entity is associated with only one instance of
the first entity.

Many-to-many (N:M): In this type, multiple instances of one entity can be

3. associated with multiple instances of another entity.


Determine Cardinality

Cardinality defines the number of instances or


occurrences of one entity that can be associated with
another entity in a relationship.
IT FURTHER SPECIFIES THE PARTICIPATION OF
LEVELS IN A RELATIONSHIP.

Minimum cardinality - It defines the minimum number


1. of instances that must participate in the relationship.

Maximum cardinality - It defines the maximum number

2. of instances that can participate in the relationship.


Assign
role
names
Role names are used to specify the participation of entities in a
relationship. They clarify the purpose or role of each entity in
the relationship.
Consider Attributes

Relationships may have attributes that provide additional


information about the association between entities. These
attributes describe characteristics of the relationship itself,
rather than the entities involved.
NORMALIZATION
Apply normalization techniques to eliminate redundancy and
ensure data integrity. Normalization involves breaking down
larger tables into smaller ones and establishing relationships
between them.
DEFINING KEYS

Identify primary keys and foreign keys. A primary key


uniquely identifies each record in a table, while a
foreign key establishes a link between two tables by
referencing the primary key of another table.
HERE ARE THE KEY TYPES COMMONLY DEFINED IN AN
ER MODEL
PRIMARY KEY (PK) FOREIGN KEY (FK)
A primary key is an attribute or a
combination of attributes that uniquely A foreign key is an attribute or a set of
identifies each instance of an entity. It attributes that refers to the primary key of
serves as a unique identifier for each entity another entity. It establishes a relationship
record within a table. Each entity in the ER between two entities, representing a
model should have a primary key defined. dependency or association.
RESOLVING
ATTRIBUTES
Determine where each attribute should be stored based on the
identified entities and relationships. Attributes are the
characteristics or properties of entities.
ESTABLISHING DATA TYPES

Assign appropriate data types to each attribute to define the


type of data that can be stored in the database like integers,
strings, dates.
HERE ARE THE STEPS TO ESTABLISH DATA
TYPES IN AN ER MODEL

ANALYZE CONSIDER DATA SIZE


ATTRIBUTE DATA AND CONSTRAINTS
Determine the size or length requirements
Review each attribute in the ER model
for attributes that have a character-based
and understand the type of data it
data type, such as strings. Consider any
represents. Consider the range and nature
constraints on the data, such as maximum
of values that the attribute can take.
length or allowed values, and define those
constraints accordingly.
Here are the steps to establish data types in an ER model

HANDLE SPECIAL
DATA TYPES REVIEW AND VALIDATE
Some attributes may require specific data Review the assigned data types for attributes and
types that cater to particular data formats, validate them against the actual data values that
such as email addresses, phone numbers, or will be stored. Ensure that the chosen data types
geographical coordinates. In such cases, accurately represent the nature of the data and
select or define appropriate data types that adhere to the database management system's
align with the specific requirements. capabilities and limitations.
CREATING TABLES
Create database tables based on the identified entities,
relationships, attributes, and their corresponding data types.
Each table represents an entity or a relationship between
entities.
DEFINING CONSTRAINTS

Apply constraints such as primary key constraints,


foreign key constraints, and other integrity constraints
to ensure data accuracy, consistency, and referential
integrity.
INDEXING
Determine which columns need to be indexed for efficient data
retrieval. Indexing can improve the performance of database
queries.
FINE-TUNING AND OPTIMIZATION

Review the database structure, make any necessary


adjustments, and optimize the design for better
performance and storage efficiency.
Question
Time

You might also like