The relational database model was introduced in 1970 by Edgar F. Codd. In his groundbreaking paper, he proposed organizing data into tables consisting of rows and columns rather than using hierarchical or navigational data structures.
This approach became the foundation of modern relational database management systems (RDBMS).
Table of Contents
Basic Components of a Relational Database
A relational database is built from one or more tables.
Tables
A table stores a specific type of information, such as customers, products, or orders.
Each table consists of:
- Columns (attributes) – define the type of data stored
- Rows (records) – contain individual data entries
For example, a customer table may contain the following columns:
| Customer ID | Name | Phone Number |
|---|
Each row represents a unique customer.
Primary Keys
Every table should contain a primary key.
A primary key:
- Uniquely identifies each record
- Cannot contain duplicate values
- Cannot be empty (NULL)
Example:
| Customer ID | Name |
|---|---|
| 1001 | John Smith |
| 1002 | Jane Doe |
In this case, Customer ID is the primary key.
Foreign Keys
A foreign key creates a relationship between two tables.
It contains values that reference the primary key of another table.
For example:
Customers Table
| Customer ID | Name |
|---|---|
| 1001 | John Smith |
Orders Table
| Order ID | Customer ID | Product |
|---|---|---|
| 5001 | 1001 | Laptop |
The Customer ID in the Orders table is a foreign key linking the order to the customer.
Example of a Relational Database
A simple business database might contain:
Customers Table
| Customer ID | Name |
|---|
Orders Table
| Order ID | Customer ID | Product | Order Date |
|---|
Using these relationships, different users can generate different reports from the same data.
Examples:
- A sales manager can view customer purchases.
- An accounting manager can review invoices and payments.
- A support team can access customer contact information.
Data Integrity Rules
Relational databases use rules to maintain data accuracy and consistency.
Entity Integrity
Entity integrity ensures that:
- Every table has a primary key
- Primary key values are unique
- Primary key values cannot be NULL
Referential Integrity
Referential integrity ensures that:
- Every foreign key value corresponds to an existing primary key value
- Relationships between tables remain valid
- Orphaned records are prevented
For example, an order cannot reference a customer that does not exist.
Data Domains and Constraints
When designing a database, administrators can define:
- Allowed data types
- Valid value ranges
- Required fields
- Uniqueness rules
These restrictions help ensure that only valid data is stored.
Physical Data Independence
Physical data independence means that database administrators can modify the way data is physically stored without affecting applications that use the database.
Examples include:
- Changing storage devices
- Adding or modifying indexes
- Using different storage structures
- Changing file organization methods
Applications continue to work without modification because the logical structure remains unchanged.
Logical Data Independence
Logical data independence allows changes to the database structure without requiring updates to existing applications.
Examples include:
- Adding new tables
- Adding new columns
- Creating new relationships
- Removing unused attributes
As long as existing structures remain compatible, applications can continue operating normally.
Summary
The relational database model organizes information into tables connected through primary and foreign keys. This structure provides efficient data storage, consistency, and flexibility while allowing multiple users and applications to access and manage data reliably. Features such as data integrity, logical independence, and physical independence have made relational databases the standard foundation for modern business applications.