Module 01 • Relational Theory Foundations

01. Database Explainer: RDBMS & Relational Theory

Before big data lakes, Spark, or Snowflake existed, the entire digital economy ran on Relational Databases. Learn the mathematical foundation that powers every financial bank, airline reservation system, and enterprise application on earth.

Instructor Insight (© Venkata Bhattaram): "People often ask: 'Why not just use a shared Google Sheet or a JSON file on a hard drive?' The answer is concurrency and integrity. If 10,000 customers try to buy the last concert seat at the exact same millisecond, an Excel spreadsheet will corrupt and crash. An RDBMS uses mathematical relational algebra, row-level locks, and ACID guarantees to ensure only 1 person gets the ticket and 9,999 get clean apologies—with zero data corruption."
The Filing Cabinet vs. The Master Librarian Analogy
1. A Flat File (Spreadsheet/CSV): Is like a messy manila folder on a wooden desk. Anyone can open it, scratch out a number, spill coffee on it, or delete a page by accident. There are no rules preventing you from typing "twenty dollars" into an age column.

2. An RDBMS (PostgreSQL, Oracle, MySQL, SQL Server): Is a high-security vault managed by a superhuman Master Librarian. Every folder has a strict blueprint (Schema), every page has a unique serial barcode (Primary Key), and related folders are cross-referenced with unbreakable red threads (Foreign Keys).
The Gold Standard of Reliability

ACID Properties Explained for Beginners

The four golden promises every relational database guarantees during transactions.

A • Atomicity

All or Nothing

If you transfer $100 from Account A to Account B, either both steps succeed, or the entire operation rolls back to 0. The bank will never deduct from A without crediting B!

C • Consistency

Rules Never Broken

Every database constraint (e.g. balance >= 0, email must contain @) must hold true before and after every transaction. Illegal data is instantly rejected.

I • Isolation

No Stepping on Toes

Even if 1,000 customers make purchases at the exact same microsecond, each transaction executes as if it were the only one running on the entire computer.

D • Durability

Saved Forever

Once a transaction commits and returns "Success", the data is committed to disk logs (WAL). Even if someone unplugs the server power cord 1 millisecond later, the record survives!

The 1970 Revolution

E.F. Codd's 12 Rules & Relational Theory

In 1970, IBM researcher Dr. Edgar F. Codd invented the Relational Model. In 1985, he published his famous 12 Rules (further expanded by Chris Date) to define what makes a true relational database.

Click any rule to inspect its plain-English purpose: 12 Fundamental Principles
Rule 01 • The Information Rule

All Information Must Be in Tables

All data at the logical level must be represented strictly as column values in rows of tables. There are no hidden pointers, memory addresses, or invisible files that users must navigate.

Plain English: If it's not inside a cell in a row of a named table, it does not exist in the database!
Concept vs Implementation

Table vs. Entity: What is the Difference?

Novices often use "Entity" and "Table" interchangeably, but in Data Engineering, they represent two different levels of abstraction.

Conceptual Level

1. The Entity (The Idea)

An Entity is a real-world person, place, physical object, or business concept about which we want to store information.

Real-World Examples:
• Customer (A human with a name and phone number)
• Product (A pair of running shoes on a warehouse shelf)
• Order (The business event when a customer buys shoes)
Physical Level

2. The Table (The Implementation)

A Table (mathematically called a Relation) is the concrete 2-dimensional grid of rows and columns created inside the SQL database engine to hold an Entity's data.

SQL DDL Definition:
CREATE TABLE customers (
  id INT PRIMARY KEY,
  full_name VARCHAR(100),
  email VARCHAR(255)
);
Horizontal Records

Rows • Records • Tuples

Three words that describe the exact same concept across math, computer science, and business.

1. Tuple (Mathematical Relational Term)

An ordered set of attribute values representing a single proposition of fact.

2. Record (File System & Storage Term)

A single chunk of binary bytes written together on a magnetic hard drive or SSD block.

3. Row (SQL & User Interface Term)

A single horizontal line on your screen representing one customer, order, or student.

The Primary Key Rule: No Identical Twins Allowed!
In a true relational table, duplicate rows are strictly forbidden! Every row MUST have a Primary Key (like your Passport Number, Social Security Number, or Order ID #1092) that uniquely distinguishes it from every other row in the universe.
Vertical Dimensions

Columns • Attributes • Domains • Data Types

How columns define the characteristics of an entity and enforce strict mathematical validation rules.

Attribute / Column

A named property that describes the entity. For example, in a customers table, the attributes are first_name, email, and signup_date.

Domain & Data Type

The permitted pool of valid values. An INT column will never accept the letter 'Z'. A DATE column requires a valid calendar day.

Foreign Key Constraint

A column in Table A that points to the Primary Key of Table B (e.g. orders.customer_id → customers.id). Prevents "orphan" orders.

Hands-On Practice

2D Interactive Relational Table Simulator

Experience how Primary Keys, Foreign Keys, and constraints work live in action. Click the controls below to inspect and test relational rules!

Click any button above or hover over table cells to inspect relational mechanics.
Primary Entity Table: customers
id PK • INT full_name VARCHAR email VARCHAR country CHAR(2)
101 Alice Walker alice@acme.com US
102 Bob Martinez bob@techcorp.io CA
103 Chen Wei chen@global.cn SG
Related Entity Table: orders
order_id PK • INT customer_id FK • INT product_name VARCHAR amount_usd DECIMAL
9001 101 MacBook Pro M3 $2,499.00
9002 101 USB-C Hub Cable $49.00
9003 102 Dell 4K UltraSharp $799.00