Relational Model Rules
Relational Model Rules
Definition
"Relational Model Rules" most commonly refers to Codd's 12 Rules (numbered 0 through 12), proposed by Dr. E. F. Codd in 1985 as a benchmark for how "truly relational" a database management system is. Rule 0 is the foundational requirement that a system must manage data exclusively through its relational capabilities; Rules 1-12 elaborate specific, testable requirements built on that foundation.
The 12 Rules (summary)
- Foundation Rule — the system must use only relational means to manage data.
- Information Rule — all data is represented as values in tables (relations), nothing else.
- Guaranteed Access Rule — every value must be accessible via table name + primary key value + column name.
- Systematic Treatment of Null Values — NULLs must be handled consistently and distinctly from all other values, regardless of data type.
- Active/Dynamic Online Catalog — the database's own structure (metadata) must itself be stored as relations, queryable with the same language.
- Comprehensive Data Sublanguage Rule — one well-defined language must support data definition, manipulation, integrity, and transaction control.
- View Updating Rule — all theoretically updatable views must be updatable by the system.
- High-level Insert/Update/Delete — set-at-a-time operations must be supported, not just row-at-a-time.
- Physical Data Independence — applications/queries are unaffected by changes to physical storage.
- Logical Data Independence — applications/queries are unaffected by certain logical schema changes (e.g., splitting a table).
- Integrity Independence — integrity constraints are defined in the data sublanguage/catalog, not embedded in application code.
- Distribution Independence — data distribution across multiple sites is invisible to users.
- Non-subversion Rule — if a low-level/record-at-a-time interface exists, it cannot bypass the integrity rules enforced at the relational level.
How this differs from Relational Integrity (its closest sibling)
Relational Integrity is just one narrow slice (rooted mainly in Rule 3 and Rule 10) about keeping data valid via domain/entity/referential rules. Relational Model Rules (Codd's 12 Rules) is the full, much broader checklist for evaluating whether an ENTIRE DBMS PRODUCT correctly and completely implements the relational model — covering query language, catalog, views, physical/logical independence, and distribution, not just data validity.
Edge Cases
- No commercial DBMS, including major SQL products, fully satisfies all 12 rules to the letter — they are treated as an ideal benchmark, not a strict pass/fail certification.
- Rule 3 (systematic NULL treatment) directly underpins the Null Values topic — it would be a rule violation if a system treated NULL inconsistently across data types (e.g., allowing NULL for integers but silently coercing it to
0for strings). - SQL's "row-at-a-time" cursor operations coexist peacefully with Rule 7 (set-at-a-time), because SQL also fully supports set-based statements. Codd's rule requires that the set-based capability exist, not that row-based access be banned outright.
Key Takeaways / Q&A
Q: Is Rule 0 the same as Rule 1? A: No — Rule 0 is the overarching foundation ("the system must be relational"), while Rule 1 specifically requires all data to be represented as values within tables.
Q: Which rule most directly overlaps with the topic of Relational Integrity? A: Rule 10, Integrity Independence, which requires that integrity constraints be definable and enforceable independently of application programs.