Codds Twelve Rules
Rules that make a RDBMS
Amitabh Trehan
amitabhtrehan@[Link]
August 22, 2003
Home Page Title Page
Page 1 of 15 Go Back Full Screen Close Quit
Codds Rules
1985 Proposed to test DBMSs for conrmation to concept of Codds Relational model Hardly any commercial product follows all Oracle = 8 1 out of 12. 2
Home Page Title Page
Page 2 of 15 Go Back Full Screen Close Quit
Rule Zero
For a system to qualify as an RDBMS it must be able to manage its databases entirely through its Relational capabilities The other 12 rules derive from this rule
Home Page Title Page
Page 3 of 15 Go Back Full Screen Close Quit
Rule 1: Information Rule
All Information (inlcuding metadata) is to be represented as data stored in cells of tables. The rows and columns have to be strictly unordered.
Home Page Title Page
Page 4 of 15 Go Back Full Screen Close Quit
Rule 2: Guaranteed Access
Home Page
Each unique piece of data (atomic value) should be accesible by : TableName + Primary Key (Row) + Attribute (Column) Violation: Ability to directly access via pointers
Title Page
Page 5 of 15 Go Back Full Screen Close Quit
Rule3: Systematic treatment of NULL
NULLs may mean: Missing data, Not applicable, No value Should be handled consistently - Not Zero or Blank Primary keys Not NULL expressions on NULL should give NULL
Page 6 of 15 Go Back Full Screen Close Quit Home Page Title Page
Rule4: Active On-Line Catalog
Database dictionary (Catalog) to have description of the Database Catalog to be governed by same rules as rest of the database The same query language to be used on catalog as on the application database
Page 7 of 15 Go Back Full Screen Close Quit Home Page Title Page
Rule5: Powerful language
One well dened language to provide all manners of access to data Example: SQL If le supporting table can be accessed by any manner except a SQL Interface, then a violation
Page 8 of 15 Go Back Full Screen Close Quit Home Page Title Page
Rule6: View Updation Rule
All views that are theoretically updatable should be updatable View = Virtual table, temporarily derived from base tables Example: If a view is formed as join of 3 tables, changes to view should be reected in base tables Not updatable: View does not have NOT-NULL attribute of base table Problems with computed elds in view e.g. Total Income = White income + Black income
Home Page Title Page
Page 9 of 15 Go Back Full Screen Close Quit
Rule7: tions
Relational level operaHome Page Title Page
There must be insert, update, delete operations at the level of Relations Set operations like Union,Intersection and Minus should be supported
Page 10 of 15 Go Back Full Screen Close Quit
Rule8: Physical Data Independence
Home Page
The physical storage of data should not matter to the system If say, some le supporting table was renamed or moved from one disk to another, it should not eect the applications.
Title Page
Page 11 of 15 Go Back Full Screen Close Quit
Rule9: dence
Logical Data Indepen-
If there is change in the logical structure (table structures) of the database the user view of the data should not change implemented through views. Say, if a table is split into two tables, a new view should give result as the join of the two tables Dicult rule to satisfy
Home Page Title Page
Page 12 of 15 Go Back Full Screen Close Quit
Rule10: Integrity Independence
The database should be able to enforce its own integrity rather than using other programs Integrity rules = Filter to allow correct data, should be stored in Data Dictionary Key and check constraints, triggers etc should be stored in Data Dictionary This also makes RDBMS independent of front end
Home Page Title Page
Page 13 of 15 Go Back Full Screen Close Quit
Rule11: dence
Distribution IndepenHome Page Title Page
A database should work properly regardless of its distribution across a network This lays foundation of Distributed databases Similiar to Rule8 only that applies to distribution on a local Disk
Page 14 of 15 Go Back Full Screen Close Quit
Rule12: Nonsubversion Rule
If low level access is allowed to a system it should not be able to subvert or bypass integrity rules to change data This may be achieved by some sort of locking or encryption Some low level access tools are provided by vendors that violate these rules for extra speed
Home Page Title Page
Page 15 of 15 Go Back Full Screen Close Quit