Codd's 12 rules
Encyclopedia
Codd's twelve rules are a set of thirteen rules (numbered zero to twelve) proposed by Edgar F. Codd
Edgar F. Codd
Edgar Frank "Ted" Codd was an English computer scientist who, while working for IBM, invented the relational model for database management, the theoretical basis for relational databases...

, a pioneer of the relational model
Relational model
The relational model for database management is a database model based on first-order predicate logic, first formulated and proposed in 1969 by Edgar F...

 for database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

s, designed to define what is required from a database management system
Database management system
A database management system is a software package with computer programs that control the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications by database administrators and other specialists. A database is an integrated...

 in order for it to be considered relational, i.e., a relational database management system (RDBMS). They are sometimes jokingly referred to as "Codd's Twelve Commandments".

Codd produced these rules as part of a personal campaign to prevent his vision of the relational database being diluted, as database vendors scrambled in the early 1980s to repackage existing products with a relational veneer. Rule 12 was particularly designed to counter such a positioning.

Even if such repackaged non-relational products eventually gave way to SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

 DBMSs, no popular "relational" DBMSs are actually relational, be it by Codd’s twelve rules or by the more formal definitions in his papers, in his books or in succeeding works in the academia or by its coworkers and successors, Christopher J. Date
Christopher J. Date
Chris Date is an independent author, lecturer, researcher, and consultant, specializing in relational database theory.-Biography:Chris Date attended High Wycombe Royal Grammar School from 1951 to 1958 and received his BA in Mathematics from Cambridge University in 1962. He entered the computer...

, Hugh Darwen
Hugh Darwen
Hugh Darwen is a computer scientist who was an employee of IBM United Kingdom from 1967 to 2004, and has been involved in the history of the relational model.- Work :...

, David McGoveran and Fabian Pascal. Only less known DBMSs, most of them academic, strive to comply. The only commercial example, as of December 2010, is Dataphor
Dataphor
Dataphor is an open-source truly relational database management system and its accompanying user interface technologies, which together are designed to provide highly declarative software application development...

.

Some rules are controversial, specially rule three, due to the debate on three-valued logic.

The rules

Rule (0): The system must qualify as relational
Relational model
The relational model for database management is a database model based on first-order predicate logic, first formulated and proposed in 1969 by Edgar F...

, as a database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

, and as a management system
Management system
A management system is the framework of processes and procedures used to ensure that an organization can fulfill all tasks required to achieve its objectives....

.
For a system to qualify as a relational database management system (RDBMS), that system must use its relational facilities (exclusively) to manage the database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

.


Rule 1: The information rule:
All information in the database is to be represented in only one way, namely by values in column positions within rows of tables.


Rule 2: The guaranteed access rule:
All data must be accessible. This rule is essentially a restatement of the fundamental requirement for primary keys
Unique key
In relational database design, a unique key can uniquely identify each row in a table, and is closely related to the Superkey concept. A unique key comprises a single column or a set of columns. No two distinct rows in a table can have the same value in those columns if NULL values are not used...

. It says that every individual scalar value in the database must be logically addressable by specifying the name of the containing table
Table (database)
In relational databases and flat file databases, a table is a set of data elements that is organized using a model of vertical columns and horizontal rows. A table has a specified number of columns, but can have any number of rows...

, the name of the containing column and the primary key value of the containing row
Row (database)
In the context of a relational database, a row—also called a record or tuple—represents a single, implicitly structured data item in a table. In simple terms, a database table can be thought of as consisting of rows and columns or fields...

.


Rule 3: Systematic treatment of null values:
The DBMS must allow each field to remain null (or empty). Specifically, it must support a representation of "missing information and inapplicable information" that is systematic
Systematic
Systematic is an American hard rock band from Oakland, California. They were one of the first signings to Metallica drummer Lars Ulrich's record label, The Music Company, via Elektra Records. The band released two studio albums before disbanding in 2004....

, distinct from all regular values (for example, "distinct from zero or any other number", in the case of numeric values), and independent of data type
Data type
In computer programming, a data type is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of...

. It is also implied that such representations must be manipulated by the DBMS in a systematic way.


Rule 4: Active online
ONLINE
ONLINE is a magazine for information systems first published in 1977. The publisher Online, Inc. was founded the year before. In May 2002, Information Today, Inc. acquired the assets of Online Inc....

 catalog
Database catalog
The database catalog of a database instance consists of metadata in which definitions of database objects such as base tables, views , synonyms, value ranges, indexes, users, and user groups are stored....

 based on the relational model
:
The system must support an online, inline, relational catalog
Database catalog
The database catalog of a database instance consists of metadata in which definitions of database objects such as base tables, views , synonyms, value ranges, indexes, users, and user groups are stored....

 that is accessible to authorized users by means of their regular query language
Query language
Query languages are computer languages used to make queries into databases and information systems.Broadly, query languages can be classified according to whether they are database query languages or information retrieval query languages...

. That is, users must be able to access the database's structure (catalog) using the same query language that they use to access the database's data.


Rule 5: The comprehensive data sublanguage rule:
The system must support at least one relational language that
  1. Has a linear syntax
    Linear syntax
    Linear syntax is a computer-programming term for an expression that can be parsed from left to right. Linear syntax implies the ability to write code without the use of line-feed or carriage-return characters. Although the use of such characters is recommended for code readability, they are...

  2. Can be used both interactively and within application programs,
  3. Supports data definition operations (including view definitions), data manipulation operations (update as well as retrieval), security and integrity constraints, and transaction
    Database transaction
    A transaction comprises a unit of work performed within a database management system against a database, and treated in a coherent and reliable way independent of other transactions...

     management operations (begin, commit, and rollback).


Rule 6: The view
View (database)
In database theory, a view consists of a stored query accessible as a virtual table in a relational database or a set of documents in a document-oriented database composed of the result set of a query or map and reduce functions...

 updating rule
:
All views that are theoretically updatable must 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. This means that data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. This rule states that insert, update, and delete operations should be supported for any retrievable set rather than just for a single row in a single table.


Rule 8: Physical data independence:
Changes to the physical level (how the data is stored, whether in arrays or linked lists etc.) must not require a change to an application based on the structure.


Rule 9: Logical data independence:
Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure. Logical data independence is more difficult to achieve than physical data independence.


Rule 10: Integrity independence:
Integrity constraints
Integrity constraints
Integrity constraints are used to ensure accuracy and consistency of data in a relational database. Data integrity is handled in a relational database through the concept of referential integrity...

 must be specified separately from application programs and stored in the catalog
Database catalog
The database catalog of a database instance consists of metadata in which definitions of database objects such as base tables, views , synonyms, value ranges, indexes, users, and user groups are stored....

. It must be possible to change such constraints as and when appropriate without unnecessarily affecting existing applications.


Rule 11: Distribution independence:
The distribution of portions of the database to various locations should be invisible to users of the database. Existing applications should continue to operate successfully :
  1. when a distributed version of the DBMS is first introduced; and
  2. when existing distributed data are redistributed around the system.


Rule 12: The nonsubversion rule:
If the system provides a low-level (record-at-a-time) interface, then that interface cannot be used to subvert the system, for example, bypassing a relational security or integrity constraint.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK