Mapping, Data Models

Process of transforming request and results between three levels it’s called mapping.

There are the two types of mappings:

  1. Conceptual/Internal Mapping
  2. External/Conceptual Mapping

1. Conceptual/Internal Mapping:

  • The conceptual/internal mapping defines the correspondence between the conceptual view and the store database.
  • It specifies how conceptual record and fields are represented at the internal level.
  • It relates conceptual schema with internal schema.
  • If structure of the store database is changed.
  • If changed is made to the storage structure definition-then the conceptual/internal mapping must be changed accordingly, so that the conceptual schema can remain invariant.
  • There could be one mapping between conceptual and internal levels.

2. External/Conceptual Mapping:

  • The external/conceptual mapping defines the correspondence between a particular external view and conceptual view.
  • It relates each external schema with conceptual schema.
  • The differences that can exist between these two levels are analogous to those that can exist between the conceptual view and the stored database.
  • Example: fields can have different data types; fields and record name can be changed; several conceptual fields can be combined into a single external field.
  • Any number of external views can exist at the same time; any number of users can share a given external view: different external views can overlap.
  • There could be several mapping between external and conceptual levels.

Data Models define how the logical structure of a database is modeled. Data Models are fundamental entities to introduce abstraction in a DBMS. Data models define how data is connected to each other and how they are processed and stored inside the system.

The very first data model could be flat data-models, where all the data used are to be kept in the same plane. Earlier data models were not so scientific, hence they were prone to introduce lots of duplication and update anomalies.

Entity-Relationship Model

Entity-Relationship (ER) Model is based on the notion of real-world entities and relationships among them. While formulating real-world scenario into the database model, the ER Model creates entity set, relationship set, general attributes and constraints.

ER Model is best used for the conceptual design of a database.

ER Model is based on:

  • Entities and their attributes.
  • Relationships among entities.

These concepts are explained below.

5.1 er_model_intro

  • Entity: An entity in an ER Model is a real-world entity having properties called attributes. Every attribute is defined by its set of values called domain. For example, in a school database, a student is considered as an entity. Student has various attributes like name, age, class, etc.
  • Relationship: The logical association among entities is called relationship. Relationships are mapped with entities in various ways. Mapping cardinalities define the number of association between two entities.

Mapping cardinalities:

    • one to one
    • one to many
    • many to one
    • many to many

Relational Model

The most popular data model in DBMS is the Relational Model. It is more scientific a model than others. This model is based on first-order predicate logic and defines a table as an n-ary relation.

The main highlights of this model are:

5.2 relational_model_table

  • Data is stored in tables called relations.
  • Relations can be normalized.
  • In normalized relations, values saved are atomic values.
  • Each row in a relation contains a unique value.
  • Each column in a relation contains values from a same domain.

One thought on “Mapping, Data Models

Leave a Reply

error: Content is protected !!
%d bloggers like this: