Skip to content
Home ยป Relational Database in DBMS

Relational Database in DBMS

1. Introduction to Relational Database

A Relational Database is a type of database that stores data in a structured format using tables (relations). It follows the Relational Model, which organizes data into rows and columns, making it easy to access and manipulate using Structured Query Language (SQL).

๐Ÿ”น Introduced by: Dr. E.F. Codd (1970)
๐Ÿ”น Used in: MySQL, PostgreSQL, Oracle, SQL Server
๐Ÿ”น Key Concept: Data is stored in tables (relations) with rows (tuples) and columns (attributes).


2. Key Components of a Relational Database

1๏ธโƒฃ Table (Relation)

A table represents a relation in a relational database.

  • It consists of rows (tuples) and columns (attributes).
  • Each table stores data about a specific entity.

๐Ÿ”น Example Table: Student

Student_ID (PK)NameAgeCourse
101Alice22Computer Science
102Bob21Mathematics
103Charlie23Physics

2๏ธโƒฃ Row (Tuple)

  • A row represents a single record in a table.
  • Example: (101, Alice, 22, Computer Science) is one tuple in the Student table.

3๏ธโƒฃ Column (Attribute)

  • A column represents a property or characteristic of an entity.
  • Example: Student_ID, Name, Age, and Course are attributes of the Student entity.

4๏ธโƒฃ Primary Key (PK)

  • A Primary Key is a unique identifier for each record in a table.
  • It ensures no duplicate values in that column.
  • Example: Student_ID is the Primary Key in the Student table.

5๏ธโƒฃ Foreign Key (FK)

  • A Foreign Key is an attribute that establishes a relationship between two tables.
  • It refers to the Primary Key in another table.

๐Ÿ”น Example: Course Table (Related to Student Table)

Course_ID (PK)Course_Name
CSE101Computer Science
MTH102Mathematics

Here, in the Student table, Course is a Foreign Key referring to Course_ID in the Course table.


3. Features of Relational Databases

โœ… Data is stored in tables (relations).
โœ… Uses Primary & Foreign Keys for relationships.
โœ… Supports SQL for querying and manipulation.
โœ… Ensures Data Integrity & Consistency using constraints.
โœ… Reduces Data Redundancy by normalizing tables.


4. Relationships in a Relational Database

There are three types of relationships in a relational database:

1๏ธโƒฃ One-to-One (1:1)

  • Each record in Table A is linked to one record in Table B.
  • Example: Student has one ID_Card.

2๏ธโƒฃ One-to-Many (1:M)

  • A record in Table A can be linked to multiple records in Table B.
  • Example: One Teacher can teach multiple Students.

3๏ธโƒฃ Many-to-Many (M:N)

  • Many records in Table A can be linked to many records in Table B.
  • Example: Students can enroll in multiple Courses, and Courses have multiple Students.

๐Ÿ”น Solution: We create a junction table (Enrollment) to manage the relationship.

Student_ID (FK)Course_ID (FK)
101CSE101
101MTH102

5. Advantages of Relational Databases

โœ… Easy to Use โ†’ Tables and SQL make it simple.
โœ… Data Integrity & Accuracy โ†’ Constraints ensure valid data.
โœ… Flexibility โ†’ Data can be easily modified and queried.
โœ… Security โ†’ Supports user authentication and access control.
โœ… Scalability โ†’ Can handle large amounts of data efficiently.


6. Disadvantages of Relational Databases

โŒ Performance Issues โ†’ Complex joins slow down large queries.
โŒ Complex Structure โ†’ Requires proper design for efficiency.
โŒ Hardware Cost โ†’ Requires good storage and computing power.


7. Real-World Applications of Relational Databases

๐Ÿ“Œ Banking Systems โ†’ Accounts, Transactions, Loans
๐Ÿ“Œ E-commerce Platforms โ†’ Users, Orders, Products
๐Ÿ“Œ University Database โ†’ Students, Courses, Enrollment
๐Ÿ“Œ Social Media Platforms โ†’ Users, Posts, Comments
๐Ÿ“Œ Healthcare Systems โ†’ Patients, Doctors, Appointments


8. Conclusion

A Relational Database is the most widely used database model today due to its structured format, efficiency, and reliability. It provides powerful querying capabilities using SQL, making it the preferred choice for business, finance, education, and more.