A solid conceptual grasp of Relational Database Management System (RDBMS) theory is essential for passing university examinations and designing robust enterprise software architectures. In this class, we break down the terminology of the relational model, compare DBMS vs RDBMS, examine table structures, and explore the legendary ACID transaction model.
Figure 1.2: Relational Schema Architecture showing tuples, attributes, domain constraints, and the 4 pillars of ACID.
Dr. Edgar Codd formulated relational database theory using rigorous mathematical terminology. In production software engineering, practical SQL terms are used interchangeably:
| Mathematical Relational Term | Standard SQL Term | Technical Definition & Meaning |
|---|---|---|
| Relation | Table | A two-dimensional grid of rows and columns representing a specific entity (e.g., students, orders). |
| Tuple | Row / Record | A single horizontal record representing an individual instance of that entity. |
| Attribute | Column / Field | A named vertical column holding a specific data property (e.g., student_name, gpa). |
| Domain | Data Type & Constraints | The allowable set of atomic values for an attribute (e.g., valid integer, email string). |
| Degree | Column Count | The total number of columns present in a table. |
| Cardinality | Row Count | The total number of rows currently stored in a table. |
| Criteria | Traditional DBMS | Modern RDBMS |
|---|---|---|
| Data Storage | Data stored as isolated hierarchical files or flat documents. | Data stored in tabular relations with predefined columns. |
| Relational Keys | No concept of foreign keys or referential integrity. | Enforces Primary Keys and Foreign Keys. |
| Data Redundancy | High data redundancy and risk of inconsistent duplicates. | Minimized through database normalization (1NF, 2NF, 3NF). |
| Transaction Safety | Little or no ACID support; prone to corruption during crashes. | Full ACID transaction guarantees with Write-Ahead Logging (WAL). |
| Examples | XML, Flat text files, Microsoft Access (basic mode). | MySQL, PostgreSQL, Oracle Database, SQLite, MS SQL Server. |
In database engineering, a Transaction is a sequence of one or more SQL operations treated as a single indivisible unit of work. Every reliable RDBMS guarantees the ACID model:
• Atomicity ("All or Nothing"): Guarantees that either all statements in a transaction execute successfully, or the entire transaction is rolled back to its original state if an error or crash occurs. Example: In a bank transfer, deducting money from Account A and crediting Account B must either both succeed or neither occurs.
• Consistency (Integrity Preservation): Ensures that a transaction transitions the database from one valid state to another valid state, strictly obeying all declared schema rules, foreign keys, uniqueness, and check constraints.
• Isolation (Concurrent Independence): Ensures that multiple transactions executing concurrently in parallel do not see each other's partial, uncommitted state. This prevents concurrency bugs like Dirty Reads and Phantom Reads.
• Durability (Permanent Storage): Guarantees that once a transaction is committed, its written data will never be lost, even in the event of an immediate server crash or sudden power failure, thanks to Write-Ahead Logs (WAL) flushed to non-volatile disk.
In the next class, we install and configure your SQL environment (Installation & Setup) using MySQL and SQLite!