
Relational Model in DBMS
Relational Model in DBMS
The most popular data model in the database industry today is the relational model found in database management systems (DBMS). First introduced by E.F. Codd in 1970, it revolutionized how data is stored, organized, and retrieved. Unlike the earlier hierarchical or network models, the relational model simplifies queries, makes data retrieval more efficient, and better represents real-world relationships.
In this article, we’ll explore the foundational elements of the relational model, discuss its key concepts, operations, advantages, and limitations, and walk through examples for better understanding.
Machine Learning Tutorial:-Click Here
Data Science Tutorial:-Click Here
Complete Advance AI topics:- CLICK HERE
DBMS Tutorial:-CLICK HERE
What is a Relational Model?
Data is arranged using a relational model into tables, or relations, that are made up of rows (tuples) and columns (attributes). Each table in a database is independent but can be related to others through keys. This tabular format not only simplifies the database structure but also enhances flexibility and scalability.
Relational databases are the backbone of many modern applications, including those powered by Oracle, MySQL, SQL Server, Sybase, and IBM DB2.
Key Terminologies in the Relational Model
Understanding the basic terminologies is essential for working with relational databases:
1. Relation (Table)
A table containing rows and columns is called a relation. For example, consider a STUDENT
table:
Stu_No | S_Name | PHONE_NO | ADDRESS | Gender |
---|---|---|---|---|
10112 | Rama | 9874567891 | Islam Ganj | F |
12839 | Shyam | 9026288936 | Delhi | M |
33289 | Laxman | 8583287182 | Gurugram | M |
27857 | Mahesh | 7086819134 | Ghaziabad | M |
17282 | Ganesh | 9028939884 | Delhi | M |
2. Tuple (Row/Record)
Each row in a table is a tuple. Every student in the STUDENT table represents a single tuple.
3. Attribute (Column/Field)
An attribute is a column in the table, such S_Name or PHONE_NO.
4. Domain
The range of acceptable values for a certain attribute is known as its domain. For instance, the domain of the Gender
attribute is {M, F}.
5. Cardinality
The number of rows (tuples) in a table. For example, if the STUDENT table has 5 students, its cardinality is 5.
6. Degree
The number of columns (attributes) in a table. The STUDENT
table above has 5 attributes, so its degree is 5.
7. Primary Key
A characteristic (or collection of characteristics) that gives each tuple a unique identity. In the STUDENT table, Stu_No
can be a primary key.
8. Foreign Key
An attribute in one table creates a link between tables by referencing the primary key in another table.
Example: Understanding Keys
Consider the following EMPLOYEE
table:
Emp_ID | E_Name | E_AGE | E_Qualification |
---|---|---|---|
1 | Ajeet Singh | 24 | M.C.A |
2 | Aryan Manhas | 20 | B.C.A |
3 | Mahesh Thakur | 40 | M.Tech |
4 | Ratan Kumar | 22 | B.Tech |
5 | Vimal Chabbra | 26 | M.C.A |
Here, Emp_ID
is a primary key as it uniquely identifies each employee.
Now, consider another table EMPLOYEE_SKILL
:
Emp_ID | E_Skill |
---|---|
1 | Web Technologies |
2 | Frontend Developer |
3 | UI/UX Developer |
4 | Backend Developer |
5 | Digital Marketing |
In this table, Emp_ID
is a foreign key referencing EMPLOYEE.Emp_ID
, and together Emp_ID
and E_Skill
can form a composite key.
Relational Schema and Instance
- Relational Schema:explains a relation’s structure, including the names of the table, columns, and data types.
- Relational Instance: A snapshot of the data in a relation at a specific point in time.
Properties of Relations
- Each cell holds a single, atomic value.
- Each column has a unique name.
- The order of rows does not affect the relation.
- A column’s entries are all of the same data type, or domain.
- No duplicate rows exist.
Operations on Relational Model
1. Insert Operation
Used to add new records. For instance, inserting a new book in a BOOK
table.
BID | Title | Author | Publisher | Price
B5 | Python | Rohit Sharma | McGraw | 225
Inserting a record will fail if:
- The primary key is duplicated.
- Null values are inserted into a primary key field.
- The foreign key refers to a non-existent record.
- Data type or domain constraints are violated.
2. Delete Operation
Removes existing records. If a shopkeeper cancels an order, only that order entry needs deletion, not the shopkeeper or book details.
3. Update Operation
Modifies data values. If updating a primary or foreign key, integrity must be ensured so no constraints are violated.
4. Retrieval Operation
Fetches data based on conditions.
Example 1:
Find all shopkeepers who ordered book B2
.
do until no more BOOK_ORDER;
get next BOOK_ORDER where BID = B2;
print SID;
end;
Example 2:
Find all books ordered by shopkeeper S1
.
do until no more BOOK_ORDER;
get next BOOK_ORDER where SID = S1;
print BID;
end;
Advantages of Relational Model
- Provides a clear and logical structure for data.
- Easy to design and implement.
- Supports data independence.
- Enables powerful query languages like SQL.
- Flexibility in modifying data without affecting overall schema.
- Better data security and authorization through relational separation.
- Reflects real-world objects and relationships naturally.
Limitations of Relational Model
- Limited support for binary data like images or multimedia files.
- Performance may degrade for large, complex databases.
- Hardware intensive in some implementations.
- Not suitable for applications with highly complex data structures (e.g., CAD/CAM).
- Maintaining data integrity across distributed systems is difficult.
- Design errors may lead to scalability issues and data corruption.
Frequently Asked Questions
1. What is the relational model in DBMS?
It is a data model that uses rows and columns to arrange data into tables (relations).
2. What is the purpose of keys?
Keys uniquely identify records and eliminate duplicate data.
3. What operations can be performed on relations?
Insert, Delete, Update, and Retrieve.
4. What are the properties of attributes?
- Attributes can have default and null values.
- Each has a specific domain.
- Primary keys ensure uniqueness.
5. What are examples of popular RDBMS?
- Oracle
- Microsoft SQL Server
- IBM DB2
- MySQL
Complete Python Course with Advance topics:-Click Here
SQL Tutorial :-Click Here
Download New Real Time Projects :–Click here
Conclusion
The relational model is a powerful and time-tested foundation for managing structured data. Whether you’re building enterprise-grade systems or learning database fundamentals, understanding the relational model is crucial. Its clarity, consistency, and widespread adoption continue to make it the backbone of modern data management.
Stay connected with Updategadh for more insightful database tutorials and updates.
relational model in dbms example
relational model in dbms pdf
network model in dbms
types of relational model in dbms
relational model in dbms diagram
relational model in dbms ppt
relational model in dbms advantages and disadvantages
relational model in dbms notes
er model in dbms
normalization in dbms
relational model in dbms geeksforgeeks
Post Comment