Question:

What do you mean by relational database? Give its one example.

Show Hint

Relational databases use keys to establish relationships: Primary Keys uniquely identify records in a table, while Foreign Keys link to Primary Keys in other tables, creating referential integrity.
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Definition of Relational Database:  

A relational database is a type of database that stores and organizes data in tables (also called relations) consisting of rows and columns. It establishes relationships between different tables using common fields. 

The concept of relational database was introduced by E. F. Codd in 1970. 

Key Characteristics:

  • Tables: Data is stored in tables representing entities (e.g., Students, Employees, Products).
  • Rows (Records/Tuples): Each row represents a single record.
  • Columns (Fields/Attributes): Each column represents an attribute of the entity.
  • Primary Key: A unique identifier for each row.
  • Foreign Key: A field that links one table to another.
  • Relationships: One-to-one, One-to-many, Many-to-many.
  • SQL (Structured Query Language): Used to query and manage data.


Advantages of Relational Databases:

  • Data integrity and accuracy
  • Reduced redundancy
  • Easy data retrieval using SQL
  • Flexible querying
  • Data security
  • Support for complex relationships



Example: School Management System 

Table 1: Students 

 

StudentID (Primary Key)NameAgeGrade
101Alice Johnson1510
102Bob Smith1611
103Charlie Brown1510
104Diana Prince1712



Table 2: Courses 

 

CourseID (Primary Key)CourseNameCredits
CS101Computer Science3
MATH201Mathematics4
ENG102English Literature2
SCI103Science3



Table 3: Enrollments (Relationship Table) 

 

EnrollmentIDStudentID (Foreign Key)CourseID (Foreign Key)
1101CS101
2101MATH201
3102ENG102
4103CS101
5104SCI103
6104MATH201



How It Works:

  • The Students table stores student details.
  • The Courses table stores course information.
  • The Enrollments table links students and courses.
  • StudentID in Enrollments references Students table.
  • CourseID in Enrollments references Courses table.


This structure allows queries such as:

  • Which courses is Alice Johnson enrolled in?
  • How many students are taking Computer Science?
  • Which students are in Grade 10?



Common Relational Database Management Systems (RDBMS):

  • MySQL
  • PostgreSQL
  • Oracle Database
  • Microsoft SQL Server
  • SQLite
  • MariaDB



Final Answer: 

A relational database organizes data into tables with rows and columns and establishes relationships between them using keys. Example: Students, Courses, and Enrollments tables in a school database.

Was this answer helpful?
0
0