The Relational Model was propounded by Dr. E.F. Codd of IBM in 1972. For a package to qualify as an RDBMS, compliance with the 12 rules is required. In reality, all the 12 rules don’t carry the same degree of importance and some very good RDBMS products which exist today cannot even claim to obey more than 8 or so of these rules.
RULE 0
Any truly relational database must be manageable entirely through its relational capabilities
This is a single overall rule which tries to cover all others in a single sentence. It simply means that a RDBMS must be Relational, Wholly Relational and nothing but Relational.
Rule 1 : The Information Rule
All information is explicitly and logically represented in exactly one way – by data values in tables
It means that if an item of data does not reside somewhere in a table in the database, then it does not exist and this should be extended even to information such as tables, columns, views, column names, constraints and all other objects should be contained in a table-form
Rule 2: The rule of guaranteed access
Every item of data must be logically addressable by restoring to a combination of table name, primary key value and column name.
Though it is possible to retrieve individual data item in many different ways in a Relational/SQL environment, this rule means that any item can be retrieved by supplying the table name, the primary key values of the rows to easily search the row and the column name which is to be found or propogated.
Rule 3 : The systematic treatment of null values
It means that NULL values are representation of missing and inapplicable information. This support for null values must be consistent throughout the RDBMS and it should be independent of data type( a null value in a CHAR field must mean the same as null in an integer field)
Rule 4 : The database description rule
The description of the database is held and maintained using the same logical structures used to define the data, thus allowing users with appropriate authority to query such information in the same way and using the same language as they would query any other data in the database.
Rule 5 : The comprehensive sub-language rule
This means that the RDBMS must be completely manageable though it’s own sub-categories of SQL-language commands for enabling
Data-Definition(DDL)
Data-Manipulation(DML)
Data Authorisation(DCL)
Transaction boundaries(TCL)
Retrieval of data(DQL)
View definition(Describe)
Integrity constraints(Data Definition/Data Alteration)
Rule 6: The view updating rule
All views that can be updated in theory, can also be updated by the system
It simply means that only simple views are updatable, Complex views are non-updatable,(but can be made updateable through the use of INSTEAD OF TRIGGERS in ORACLE). A simple view is a view which is based on a single table, has non calculated columns,no group function, no group by clause, no distinct, no rownum, no rowid or any such pseudocolumns. Simple view are again updatable subject to non-violation of constraints at the base table level.
Rule 7 : The Insert and Update rule
A RDBMS has to be capable of Inserting, Updating and Deleting data as a relational set(that is more than one row in a single go). Many RDBMS fail to achieve this and hence fall-back to a single-record-at-a-time procedural technique when it comes to data manipulation.
Rule 8 : The Physical independence rule
Users access to the database, via application programs, must remain logically consistent whenever changes to the storage representation or access methods to the data, are changed.
Example, if an index is built and destroyed by the DBA on a table, any user should still retrieve the same data from that table, although a bit slowly.
Rule 9 : The Logical data independence rule
Application programs must be independent of changes made to the base tables, with minor changes in the corresponding queries or use of views(makes changes in the query of the view)
TAB1 FRAG1 FRAG2
A B C D A B A C D
1 A C E 1 A 1 C E
4 A C F 4 A 4 C F
6 B D G 6 B 6 D G
2 B D H 2 B 2 D H
It should be possible to split a table vertically into more than one fragment as long as such splitting preserves all the original data(is non loss) and maintain the primary key in each and every segment
FRAG1 FRAG2 TAB1
A B A C D A B C D
1 A 1 C E 1 A C E
4 A 4 C D 4 A C D
6 B 6 D G 6 B D G
2 B 2 D H 2 B D H
It should be possible to combine base tables into one by way of a non-loss join
Rule 10 : INTEGRITY RULES
The relational model includes two general integrity rules
Integrity Rule 1 (Entity Integrity):
If the attribute A of a relation R is a primary attribute of R, then A cannot accept null values
Integrity Rule 1 (Referential Integrity):
It is concerned with foreign key, that is, with attributes of a relation having domains that are those of the primary key of another/same relation.
Rule 11 : Distribution rule
A RDBMS must have distribution independence
This is one of the attractive aspects of RDBMS packages. It simply means that databases built on relational model are suited to client-server architecture.
Rule 12 : No Subversion rule :
If an RDBMS supports a lower level language that permits for example, row-at-a-time processing, then this language must not be able to bypass any integrity rules or constraints of the relational language.