Relational Data Model – Schema, Tuples, Attributes, Domains
The Relational Data Model is the most popular and widely used data model in Database Management Systems (DBMS). It organizes data into tables (called relations) that consist of rows and columns. Each table represents a real-world entity, and the relationships between entities are defined using keys. This model was first introduced by Dr. E. F. Codd in 1970 and forms the foundation of modern relational databases such as MySQL, Oracle, SQL Server, and PostgreSQL.
🔹 Main Concepts of the Relational Data Model
The relational model is based on a few key components that describe how data is represented and stored. These are:
- Relation: A table that represents data about a particular entity.
- Schema: The structure or design of the table.
- Tuple: A single record or row of data in the table.
- Attribute: A column that defines a property of the entity.
- Domain: The set of valid values that an attribute can have.
🔸 1. Relation
A relation is a table in a database that stores data about a specific entity or concept. Each relation consists of rows (tuples) and columns (attributes). For example, consider a STUDENT table:
| Student_ID | Name | Department | Age |
|---|---|---|---|
| 101 | Ahsan | CSE | 22 |
| 102 | Shovon | EEE | 23 |
| 103 | Rafi | BBA | 21 |
Here, the STUDENT table is a relation that contains information about students in different departments.
🔸 2. Schema
A schema defines the logical structure or design of a relation. It includes the relation’s name and the names of its attributes. Example:
STUDENT(Student_ID, Name, Department, Age)
Here, STUDENT is the name of the relation, and Student_ID, Name, Department, and Age are the attributes. The schema defines what kind of data will be stored, not the actual data itself.
🔸 3. Tuple
A tuple is a single row in a relation that represents one complete record of data. For example:
(101, 'Ahsan', 'CSE', 22)
Each tuple contains values for all attributes and represents one real-world entity. In simple terms: Tuple = Row = Record.
🔸 4. Attribute
An attribute is a column in a relation that describes a property of the entity. Each attribute has a data type and belongs to a specific domain. For example:
- Student_ID → Integer
- Name → String (Varchar)
- Department → String
- Age → Integer
Each attribute helps describe one property of the entity — such as ID, name, or age of a student.
🔸 5. Domain
A domain is the set of all valid values that an attribute can have. It ensures data integrity by preventing invalid entries. For example:
- Domain of Student_ID → positive integers (1, 2, 3, …)
- Domain of Department → {‘CSE’, ‘EEE’, ‘BBA’, ‘ENG’}
- Domain of Age → integers between 17 and 30
If someone tries to enter an invalid value such as Age = -5, the database system will reject it because it violates the domain constraint.
🎯 Summary
| Concept | Description | Example |
|---|---|---|
| Relation | Table that stores data | STUDENT |
| Schema | Design or structure of the table | STUDENT(Student_ID, Name, Dept, Age) |
| Tuple | Single record or row | (101, 'Ahsan', 'CSE', 22) |
| Attribute | Column defining a property | Age, Name, Dept |
| Domain | Allowed set of values for an attribute | Age → 17–30 |
💬 In Simple Words
- Relation = Table
- Schema = Table Structure
- Tuple = Row / Record
- Attribute = Column
- Domain = Allowed Values
✅ Advantages of Relational Model
- Simple and easy to understand
- Data stored in a clear tabular format
- Supports data integrity and consistency
- Data can be easily accessed using SQL
- Ensures data independence
The Relational Data Model is popular because it provides a logical and consistent way to organize and manage data efficiently. Its simplicity and flexibility make it the foundation for all relational database systems.
relational data model schema tuples attributes domains dbms tutorial relation example table structure sql database normalization concept explanation
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন