Codd's rules refers to a set of 13 database management system rules (0-12) developed by E.F. Codd in 1969-1970. He designed these rules as the prerequisites to consider a database management systems (DBMS) as a relational data base management system (RDBMS). Although the rules were not initially widely popular in commercial use, later DBMSs were based on Codd's rules.
Codd's rules are also referred to as Codd's law, Codd's 12 rules or Codd's 12 commandments.
CODD’s 12 rules define an ideal relational database which is used as a guideline for designing relational database systems today. Though no commercial database system completely conform to all 12 rules, they do interpret the relational approach. Here are the CODD’s 12 rules:
Rule 0: Foundation rule: The system must qualify as relational both as a database and as a management system.
Rule 1: The information rule: All information in the database must be represented in one and only one way (that is, as values in a table).
Rule 2: The guaranteed access rule: All data should be logically accessible through a combination of table name, primary key value and column name.
Rule 3: Systematic treatment of null values: A DBMS must support Null Values to represent missing information and inapplicable information in a systematic manner independent of data types.
Rule 4: Active online catalog based on the relational model: The database must support online relational catalog that is accessible to authorized users through their regular query language.
Rule 5: The comprehensive data sublanguage rule: The database must support at least one language that defines linear syntax functionality, supports data definition and manipulation operations, data integrity and database transaction control.
Rule 6: The view updating rule: Representation of data can be done using different logical combinations called Views. All the views that are theoretically updatable must also be updatable by the system.
Rule 7: High-level insert, update, and delete: The system must support set at a time insert, update and delete operators.
Rule 8: Physical data independence: Changes made in physical level must not impact and require a change to be made in the application program.
Rule 9: Logical data independence: Changes made in logical level must not impact and require a change to be made in the application program.
Rule 10: Integrity independence: Integrity constraints must be defined and separated from the application programs. Changing Constraints must be allowed without affecting the applications.
Rule 11: Distribution independence: The user should be unaware about the database location i.e. whether or not the database is distributed in multiple locations.
Rule 12: The nonsubversion rule: If a system provides a low level language, then there should be no way to subvert or bypass the integrity rules of high-level language.
Of all the rules, rule 3 is the most controversial. This is due to a debate about three-valued or ternary, logic. Codd's rules and SQL use ternary logic, where null is used to represent missing data and comparing anything to null results in an unknown truth state. However, when both booleans or operands are false, the operation is false; therefore, not all data that is missing is unknown, hence the controversy.