State any two E.F. Codd’s rule for RDBMS.
Of course. Edgar F. Codd, a researcher at IBM, developed a set of thirteen rules (numbered 0 to 12) to define the criteria for a database management system to be considered truly relational (an RDBMS). A system is considered more "relational" the more rules it adheres to.
Here are two of the most fundamental of Codd's rules, explained with examples.
State the Rule:
"All information in a relational database is to be represented explicitly at the logical level and in exactly one way—by values in tables."
Explanation in Simple Terms:
This is the most basic principle of a relational database. It means that everything is stored in tables. All of your data, without exception, must be presented to the user as values within the rows and columns of tables. There should be no other way to store or access data, such as hidden pointers or special links between files that the user can't see. This makes the database structure simple, predictable, and easy to query.
Example:
Consider a database storing student information. According to this rule, all data about a student—their ID, name, and major—must be stored in a table.
Students
Table:
| StudentID | FirstName | Major |
| :--- | :--- | :--- |
| 101 | Alice | Computer Science|
| 102 | Bob | Biology |
| 103 | Charlie | Computer Science|
Here, every piece of information is a value in a cell within the Students
table. You don't need to follow a behind-the-scenes pointer to find out what "Computer Science" means; the value is stored directly in the table.
State the Rule:
"Each and every datum (atomic value) in a relational database is guaranteed to be logically accessible by resorting to a combination of table name, primary key value, and column name."
Explanation in Simple Terms:
This rule states that there must be no ambiguity in finding any single piece of data. Every value in the database has a unique "address." This address is formed by specifying three things:
1. The name of the table it's in.
2. The value of the primary key for its row (which uniquely identifies that row).
3. The name of the column it's in.
This rule enforces the critical importance of a primary key for every table.
Example:
Using the same Students
table, the StudentID
is the primary key because it is unique for every student. If we want to find the major of the student whose ID is 102, we can access it with absolute certainty.
Students
102
(This points us directly to Bob's row)Major
This unique combination (Students
, 102
, Major
) leads us directly to the single, unambiguous value: "Biology". There is no other way to interpret this request, and the system guarantees access to that specific data point.