Showing posts with label RDBMS Concepts. Show all posts
Showing posts with label RDBMS Concepts. Show all posts

Normalization Rules

1st NF : No Repeating groups : Remove any repeating groups along with the primary key to a new table.


2nd NF: No Partial Dependencies :If columns are dependent on only a part of the primary key, extract them along with the part of the primary key to a new table.


3rd NF: No Transitive Dependencies:  If non-key columns are dependent on another non-key column, extract them to a new table and identify a primary key.


4th NF Separates independent multi-valued facts to separate tables.


5th NF Breaks out data redundancy not covered by previous NFs.


ELIMINATE DATA NOT DEPENDENT ON KEY. All non key cols should be dependent on the Primary key. (Then the table is said to have functional dependence.)The aim of normalization Is to arrive at a set of tables that are fully functionally dependent.

ACID Properties

1. A Is for Atomicity: The principle of atomicity states that all parts of a transaction must complete, or none of them.

2. C Is for Consistency: The principle of consistency states that the results of a query must be consistent with the state of the database at the time the query started.

3. I Is for Isolation: The principle of isolation states that an incomplete (that is, uncommitted) transaction must be invisible to the rest of the world.

4. D Is for Durability: The principle of durability states that once a transaction completes with a COMMIT, it must be impossible for the database to lose it.

Codd's Rules


1. Information Rule: All information in a relational database including table names, column names are represented by values in tables (data dict tables/cols).
2. Guaranteed Access 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 (accessible thru tab/col/PK).
3. Systematic Treatment of Nulls Rule: The RDBMS handles records that have unknown or inapplicable values in a systematic way (nulls).
4. Active On-line catalog based on the relational model: The description of a database and in its contents are database tables and therefore can be queried on-line via the data manipulation language (query dict with sql).
5. Comprehensive Data Sub-language Rule: A RDBMS may support several languages. But at least one of them should allow user to do all of the following: define tables and views, query and update the data, set integrity constraints, set authorizations and define transactions (sql lang DDL).
6. View Updating Rule: Any view that is theoretically updateable can be updated using the RDBMS(view update).
7. High-Level Insert, Update and Delete: The RDBMS supports insertions, updation and deletion at a table level in addtion to selection(dml).
8. Physical Data Independence: The execution of adhoc requests and application programs is not affected by changes in the physical data access and storage methods (physical Ind.). 
9. Logical Data Independence: Logical changes in tables and views such adding/deleting columns or changing fields lengths need not necessitate modifications in the applications (logical Ind.).
10. Integrity Independence: Like table/view definition, integrity constraints are stored in the on-line catalog and not in the application programs (integrity Ind.const in db).
11. Distribution Independence: Application programs and adhoc requests are not affected by change in the distribution of physical data (distribution Ind.).
12. No subversion Rule: If the RDBMS has a language that accesses the information of a record at a time, this language should not be used to bypass the integrity constraints.(bypass no integrity cons)