Relational Model in DB

What is the Relational Model?

The Relational Model is a way to represent and manage data in the form of tables.
It was proposed to organize data logically so that it is easy to store, retrieve, update, and maintain consistency.

In the relational model:

  • Data is stored in tables
  • Each table represents a real-world entity
  • Relationships between data are represented using keys

Most modern databases, such as MySQL, PostgreSQL, Oracle, and SQL Server,r are based on the relational model.


Basic Terminology in the Relational Model

Before going deeper, it is important to understand the core terms used in the relational model.

Relation

A Relation is a table that stores data.

Example:
A STUDENT table storing student details is a relation.

A relation consists of:

  • Rows
  • Columns
  • A fixed structure (schema)

Tuple

A Tuple is a single row in a relation.

Each tuple represents one record.

Example:

Roll_No

Name

Age

101

Rahul

20

Here, the row (101, Rahul, 20) is a tuple.


Attribute

An Attribute is a column in a relation.

Each attribute represents a property of the entity.

Example:

  • Roll_No
  • Name
  • Age

Domain

A Domain is the set of allowed values for an attribute.

Example:

  • Domain of Age → integers from 1 to 120
  • Domain of Name → character strings

Domains help maintain data validity.


Relation Schema

A Relation Schema defines the structure of a relation.

It includes:

  • Relation name
  • Attributes
  • Domains of attributes

Example:

STUDENT (Roll_No, Name, Age)

This describes the structure, not the actual data.


Relation Instance

A Relation Instance is the actual data stored in the table at a particular time.

Example:

Roll_No

Name

Age

101

Rahul

20

102

Anita

21

The schema remains fixed, but the instance changes as data is inserted, updated, or deleted.


Degree and Cardinality

Degree

The Degree of a relation is the number of attributes (columns).

Example:

STUDENT (Roll_No, Name, Age)

Degree = 3


Cardinality

The Cardinality of a relation is the number of tuples (rows).

Example:
If the STUDENT table has 50 rows, its cardinality is 50.


Properties of a Relation

A valid relation in the relational model follows these rules:

  1. Each cell contains atomic (indivisible) values
  2. Each attribute has a unique name
  3. Order of rows does not matter
  4. Order of columns does not matter
  5. No two tuples are identical
  6. All values in a column belong to the same domain

These rules ensure data consistency and simplicity.


Why the Relational Model is Important

The relational model:

  • Provides a clear logical structure
  • Reduces data redundancy
  • Ensures data integrity
  • Makes querying simple using SQL
  • Forms the foundation of relational databases

Because of these advantages, it is the most widely used data model in database systems.


Relational Model vs File-Based System (Brief)

File-Based System

Relational Model

Data stored in files

Data stored in tables

High redundancy

Reduced redundancy

No strict rules

Strong constraints

Difficult to query

Easy querying using SQL


What Comes Next?

Now that the basic structure of the relational model is clear, the next logical topic is Keys in the Relational Model.

Keys explain:

  • How rows are uniquely identified
  • How tables are connected
  • How data integrity is maintained