Data Models in DBMS: A Comprehensive Overview
Explore the fundamental concepts of data models in database management systems (DBMS). Learn about the evolution of data models, starting from the flat data model and progressing to the Entity-Relationship (ER) Model. Understand how data models provide a logical structure for representing and organizing data within a database.
DBMS - Data Models
Data models are essential for defining the logical structure of a database. They introduce abstraction in a DBMS, illustrating how data is interconnected and how it is processed and stored within the system.
The earliest data model was the flat data model, which stored all data in a single plane. These early models lacked scientific rigor, often leading to significant data duplication and update anomalies.
Entity-Relationship Model
The Entity-Relationship (ER) Model is centered around real-world entities and the relationships among them. When transforming a real-world scenario into a database model, the ER Model establishes entity sets, relationship sets, general attributes, and constraints.
The ER Model is particularly suited for the conceptual design of a database and is based on two main concepts:
- Entities and their Attributes: An entity in an ER Model represents a real-world object characterized by properties known as attributes. Each attribute is defined by a set of values referred to as its domain. For instance, in a school database, a student serves as an entity, possessing various attributes such as name, age, and class.
- Relationships: A relationship denotes the logical association between entities. These relationships can be mapped to entities in various ways, defined by mapping cardinalities, which indicate the number of associations between two entities.
Mapping Cardinalities
- One to One
- One to Many
- Many to One
- Many to Many
Relational Model
The Relational Model is the most widely used data model in DBMS and is considered more scientific than others. It is based on first-order predicate logic and defines a table as an n-ary relation.
Main Highlights of the Relational Model:
- Data is stored in tables known as relations.
- Relations can be normalized.
- In normalized relations, the stored values are atomic.
- Each row in a relation contains a unique value.
- Each column in a relation contains values from the same domain.