✏️ Explanatory Question
Level: Basic — Tests your understanding of why relational databases like MySQL exist.
A DBMS (Database Management System) is software that stores and manages data, but it stores that data as files without any defined relationship between them. Data may be stored in a hierarchical or navigational form, and there is no concept of tables linked together.
An RDBMS (Relational Database Management System) is an advanced type of DBMS that stores data in tables (relations) made of rows and columns, and — crucially — it allows those tables to be related to each other using keys. MySQL is an RDBMS.
| DBMS | RDBMS |
|---|---|
| Stores data as files. | Stores data in tables (rows & columns). |
| No relationship between data. | Tables are related using primary & foreign keys. |
| Handles small amounts of data. | Handles large amounts of data efficiently. |
| No support for normalization. | Supports normalization to reduce redundancy. |
| Does not enforce ACID properties. | Follows ACID properties for reliable transactions. |
| Single-user access (usually). | Supports multiple users at the same time. |
| Examples: File systems, XML, Microsoft Access (basic). | Examples: MySQL, PostgreSQL, Oracle, SQL Server. |
In an RDBMS like MySQL, two tables can be related using a foreign key — something a plain DBMS cannot do:
-- Parent table
CREATE TABLE departments (
dept_id INT PRIMARY KEY,
dept_name VARCHAR(50)
);
-- Child table RELATED to departments via a foreign key
CREATE TABLE employees (
emp_id INT PRIMARY KEY,
emp_name VARCHAR(100),
dept_id INT,
FOREIGN KEY (dept_id) REFERENCES departments(dept_id)
);