Relational Model Concepts in DBMS with Examples
Of course! Hereβs a detailed explanation of the Relational Model concepts in DBMSβwith clear definitions, examples, and diagrams where helpful.
π 1. What is the Relational Model?
Types of relational model in DBMS
The Relational Model was introduced by E.F. Codd in 1970. It organizes data into relations (tables) consisting of rows and columns. Each relation represents an entity type, and each row (tuple) represents a single instance of that entity.
It is the most widely used data model in modern DBMS like MySQL, Oracle, SQL Server, PostgreSQL, etc.
π 2. Key Concepts in the Relational Model
πΉ Relation (Table)
- A relation is a table with rows and columns.
- Each relation has a name and a set of attributes (columns).
- Example:
Student +--------+----------+--------+ | RollNo | Name | Marks | +--------+----------+--------+ | 1 | Alice | 85 | | 2 | Bob | 90 | +--------+----------+--------+
πΉ Attribute (Column)
- A property or characteristic of the relation.
- Example:
RollNo
,Name
,Marks
are attributes ofStudent
.
πΉ Tuple (Row/Record)
- A single row in a relation.
- Example:
(1, 'Alice', 85)
is a tuple in the Student table.
Also Read:
- Blog
- Career Course
- DBMS Tutorial
- Internship
- IT jobs
- Latest Jobs
- Marketing jobs
- Private jobs
- Sales jobs
πΉ Domain
- The set of allowed values for an attribute.
- Example: The domain of
Marks
might be integers between 0 and 100.
πΉ Degree
- The number of attributes (columns) in a relation.
- Example: Student relation with attributes RollNo, Name, Marks β degree 3.
πΉ Cardinality
- The number of tuples (rows) in a relation.
- Example: If the Student table has 5 rows, its cardinality is 5.
πΉ Relation Schema
- Specifies the relationβs name and structure.
- Notation:
Student(RollNo, Name, Marks)
πΉ Relation Instance
- A set of tuples at a particular point in time (i.e., the current state of the relation).
π 3. Keys in Relational Model
Keys ensure uniqueness and identification of tuples:
β Super Key
- A set of one or more attributes that can uniquely identify a tuple.
- Example:
{RollNo}
,{RollNo, Name}
.
β Candidate Key
- Minimal super keys; no redundant attributes.
- Example:
{RollNo}
.
β Primary Key
- A candidate key chosen to uniquely identify tuples.
- Example:
RollNo
is the primary key in Student.
β Alternate Key
- Candidate keys not chosen as the primary key.
β Foreign Key
- Attribute(s) in one relation referring to the primary key of another relation to establish referential integrity.
- Example:
Student.CourseID
β referencesCourse.CourseID
.
π 4. Integrity Constraints
Rules that ensure valid and consistent data:
β Entity Integrity
- Primary key cannot be NULL.
β Referential Integrity
- Foreign key value must match an existing primary key in the referenced relation, or be NULL.
β Domain Constraints
- Values must belong to the attribute’s domain.
β Unique Constraint
- Ensures attribute(s) have unique values across tuples (e.g., candidate keys).
π 5. Relational Operations
The relational model supports operations that form the basis of SQL and relational algebra:
β
Select (Ο) β Filters rows based on a condition.
β
Project (Ο) β Selects specific columns.
β
Union (βͺ) β Combines rows from two relations (duplicates removed).
β
Set Difference (-) β Tuples in one relation but not the other.
β
Cartesian Product (Γ) β Combines every tuple of one relation with every tuple of another.
β
Rename (Ο) β Changes relation or attribute names.
β
Join (β¨) β Combines tuples based on related attributes.
π 6. Example Diagram
Hereβs how two related tables can look in the relational model:
Student Table
RollNo | Name | CourseID |
---|---|---|
1 | Alice | 101 |
2 | Bob | 102 |
Course Table
CourseID | CourseName |
---|---|
101 | Mathematics |
102 | Physics |
Foreign Key:
Student.CourseID
β Course.CourseID
β Summary of Advantages
β Simplicity β Tables are intuitive.
β Data Integrity β Ensured by keys and constraints.
β Flexibility β Easy to extend schema.
β Powerful β Foundation for SQL.
Would you like a PDF summary, MCQs for practice, or examples of SQL statements related to the relational model?
Free career development courses
Types of DBMS Architecture Tutorial
Types of DBMS Users with Examples
Components of DBMS full Details
Types of Databases β (Database Management System)