What is a relational database?
A relational database (RDB) is a type of database where information is stored as tables, and relationships between data are expressed through shared fields. The core idea is that data is organized in a structured, interconnected way, so it can be efficiently searched, updated, and analyzed.
Key points
- Tables (relations): data is stored in tables, every row is a record (e.g. an employee), every column is a field (e.g. name, age).
- Relationships between tables: tables can be linked through shared fields (keys). For example, an "Employees" table and a "Departments" table are linked through a
DepartmentIDfield. - Uniqueness of data: every table usually has a primary key, a unique identifier for every record.
- SQL: relational databases use SQL to work with tables, run queries, and manage the relationships between them.
Example:
- The
Employeestable:ID,Name,DepartmentID - The
Departmentstable:ID,NameThe link throughDepartmentIDlets you find out which department each employee works in.
Put simply, a relational database is like a well-organized spreadsheet with several sheets, where data between sheets is linked and complex queries can be run to find the information you need.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.