Branch/Class/Batch: AI&DS/SE/A2
Student Roll no.: A35
Student Name: Aryan Shetty
EXPERIMENT NUMBER: 2
AIM: Mapping ER/EER to Relational schema model.
OBJECTIVES: Develop entity relationship data model and its mapping to relational model
THEORY:
The Entity-Relationship (ER) model is a conceptual framework used to design and
visualize database structures. It represents entities (real-world objects) and their
relationships.
The Enhanced Entity-Relationship (EER) model extends the ER model by
including additional concepts like specialization, generalization, and categorization.
The Relational Model is used to implement the ER/EER model by converting
entities and relationships into relational tables.
The process of mapping an ER model to a relational model ensures data
consistency, integrity, and optimized retrieval. Each entity is mapped to a relation
(table), attributes become columns, and relationships are represented using primary
and foreign keys.
RELATIONAL MODEL CONCEPT:
The Relational Model is a widely used database model that organizes data into relations
(tables). Each relation consists of rows (tuples) representing records and columns
(attributes) defining the properties of the data. This model ensures data integrity,
consistency, and easy retrieval through structured relationships between tables.
Relation (Table): A collection of data organized in rows and columns, representing
entities or relationships.
Attributes (Columns): Properties of an entity, each with a defined data type (e.g.,
INTEGER, VARCHAR).
Tuples (Rows): Individual records stored in a relation.
Primary Key: A unique identifier for each tuple, ensuring no duplicate records
exist.
Foreign Key: An attribute in one table that references the primary key of another
table, establishing relationships.
Schema: The structure of a table, including attribute names, data types, and
constraints.
The mapping of an ER model to a relational schema involves converting entities into
tables, assigning primary and foreign keys, and representing relationships using appropriate
constraints. One-to-one, one-to-many, and many-to-many relationships are handled
using foreign keys or additional relations. Special cases such as weak entities, multivalued
attributes, specialization, and generalization are also mapped using structured relational
techniques. By following these principles, the relational model ensures efficient data
storage, retrieval, and integrity in databases.
ER/EER DIAGRAM:
RELATIONAL MODEL:
User map
Offline
Search
Route
Weather Map RELATIONAL SCHEMA MODEL
Map ID
Location Temperature
CONCULSION:
The process of mapping an ER/EER model to a relational model is essential for database design. It
ensures that entity relationships are accurately represented in relational databases. By
systematically converting entities, attributes, and relationships into relational schema components,
we can maintain data integrity, enforce constraints, and optimize database performance.