Codd's 12 Rules
Codd's rules are a checklist for what "relational" really means. Real systems follow some rules fully and bend others.
In plain English
Codd's rules are a checklist for what counts as a proper table-based database.
The one idea
Codd's rules are a conformance checklist: data in tables, every value addressable, catalog in tables, views, set operations, and independence.
A product can look like a table store and still fail the relational contract. The rules give you precise questions to ask about a system's guarantees.
By the end
- 01List the core ideas behind Codd's 12 rules.
- 02Explain the information, guaranteed access, and view rules.
- 03Distinguish logical and physical independence rules.
- 04Know where real DBMSs compromise.
The foundation rules
Rule 0 says the system must qualify as relational. The information rule says all data, including metadata, is stored in tables. The guaranteed-access rule says every value must be addressable by table name, primary key, and column. Systematic null handling says nulls must be distinct from any actual value.
SELECT table_name, column_name, data_type
FROM information_schema.columns
WHERE table_name = 'Student';
/* metadata such as column names and types is itself stored in tables */Catalog, views, and independence
The catalog rule says the system catalog is stored relationally. The view rule says views are virtual relations. The logical and physical independence rules say changes at one level should not break the levels above. These rules are the backbone of portable, maintainable database design.
Integrity, distribution, and non-subversion
The integrity rules require entity and referential integrity to be enforced by the DBMS. The distribution rule allows a distributed database to look like one system. The non-subversion rule says no lower-level language or tool may bypass the constraints. Real systems often expose bulk-load or administrative bypasses, so the rule is aspirational in places.
Auditing a table-shaped database
A vendor claims its product is relational because it shows results in rows and columns.
Ask whether the system catalog is exposed as ordinary tables.
If metadata can only be read through private commands, the information rule is weakened.
Try to update a view and observe the result.
A system that cannot update any view fails the view-updating rule, though many real systems compromise here.
Change a secondary index and rerun the same query.
If applications must change, physical independence is incomplete.
ConclusionThe rules are a benchmark, not a marketing badge. Most SQL products satisfy the spirit and bend several rules in practice.
The trade-off
No free correctness.
Gain
A vocabulary for judging whether a system deserves the relational name.
Cost
Strict conformance can conflict with performance, null handling, and vendor extensions.
Verdict
Use the rules to understand guarantees; do not expect a perfect score from any commercial system.
Recap
What to keep.
Takeaways
- +Codd's rules define the properties of a relational DBMS.
- +All data and metadata should be represented in tables.
- +Logical and physical independence are explicit rules.
- +Integrity must be enforced by the DBMS, not only by applications.
- +Real systems compromise on some rules.
Traps
- !Memorizing rule numbers without understanding the principles.
- !Assuming every SQL database is fully relational by Codd's definition.
- !Ignoring the non-subversion rule when designing bulk operations.
Focus
- →Explain the information and guaranteed-access rules.
- →Know which rules cover independence.
- →Give one example of a real-system compromise.
Check yourself
Before you turn the page.
Which rule says all data, including metadata, is stored in tables?
What does the non-subversion rule forbid?