Thursday, February 19, 2015

Codd's Twelve Rules - Rule 7 - High level Insert, Update, and Delete


Codd's Twelve Rules - Rule 7 - High level Insert, Update, and Delete



Rule 7
High level Insert, Update, and Delete
Rule
The capability of handling a base relation or a derived relation as a single operand applies not only to the retrieval of data but also to the insertion, update, and deletion of data.
Description
This rule stresses the set-oriented nature of a relational database. It requires that rows be treated as sets in insert, delete, and update operations. The rule is designed to prohibit implementations that support only row-at-a-time, navigational modification of the database. The SQL language covers this via the INSERT, UPDATE, and DELETE statements.
Example
SQL Server,          MySQL, and Oracle support bulk insert, delete, and update.
          INSERT INTO yourtable VALUES (1,2), (5,5), ...; - this can be used to insert multiple rows at a time in MySQL.
Some DBMS that fulfills this property
SQL Server,          MySQL, and Oracle

Wednesday, February 18, 2015

Codd's Twelve Rules - Rule 4 - Dynamic Online Catalog Based on the Relational Model


Codd's Twelve Rules - Rule 4 - Dynamic Online Catalog Based on the Relational Model



Rule 4
Dynamic Online Catalog Based on the Relational Model
Rule
The database description is represented at the logical level in the same way as ordinary data, so authorized users can apply the same relational language to its interrogation as they apply to regular data.
Description
This rule requires that a relational database be self-describing. In other words, the database must contain certain system tables whose columns describe the structure of the database itself, or alternatively, the database description is contained in user-accessible tables. In other words, this rule insists a data dictionary that stores meta data.
Example
  • INFORMATION_SCHEMA system views in SQL Server, 
  •  INFORMATION_SCHEMA  information database in MySQL, and
  • Oracle Data dictionary resides in SYSTEM tablespace and can be accessed using the prefixes USER, ALL, or DBA.
Some DBMS that fulfills this property
SQL Server, MySQL, and Oracle.

Codd's Twelve Rules - Rule 5 - Comprehensive Data Sublanguage Rule


Codd's Twelve Rules - Rule 5 - Comprehensive Data Sublanguage Rule



Rule 5
Comprehensive Data Sublanguage Rule
Rule
A relational system may support several languages and various modes of terminal use. However, there must be at least one relational language that has a linear syntax, can be used both interactively and within application programs, supports data definition operations (including view definitions), data manipulation operations (update as well as retrieval), security and integrity constraints, and transaction management operations (begin, commit, and rollback).
Description
This rule insist the existence of SQL like language to manipulate data. Manipulation should involve all the above said things (highlighted in blue color).
Example
Transact-SQL satisfies the manipulation in SQL Server,
SQL satisfies the data manipulation in Oracle and
MySQL support a subset of ANSI SQL.
Some DBMS that fulfills this property
T-SQL in SQL Server, SQL in Oracle, ANSI SQL in MySQL, SQL in IBM DB2




Codd's Twelve Rules - Rule 6 - View Updating Rule


Codd's Twelve Rules - Rule 6 - View Updating Rule



Rule 6
View Updating Rule
Rule
All views that are theoretically updateable are also updateable by the system.
Description
This rule deals with views, which are virtual tables used to give various users of a database different views of its structure. It’s one of the most challenging rules to implement in practice, and no commercial product fully satisfies it today. A view is theoretically updateable as long as it’s made up of columns that directly correspond to real table columns.
Example
All views are not updateable. Views can be updateable if they follow the certain rules unlike tables. The following syntax can be used to update views;
UPDATE < view_name > SET<column1>=<value1>,<column2>=<value2>,.....
WHERE <condition>;
Some DBMS that fulfills this property
  • SQL Server technically fulfills this rule by using INSTEAD OF triggers,
  • MySQL support view update in some cases. For a view to be updatable, there must be a one-to-one relationship between the rows in the view and the rows in the underlying table in MySQL,
  • All views that are theoretically updateable are also updateable by the Oracle system.


Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents