Tuesday, 29 July 2014

Database Languages

A database system provide Data Definition Language(DDL) to specify Database schema and Data Manipulation Language(DML) to express Database queries and updates. They are a part of a single Database language, such as the widely used SQL language.

Data Manipulation Language (DML)

DML allows users to acces and manipulate data as organized by the appropriate

data models.The types of access are,

* Retrieval of data

* Insertion of data

* Deletion of data

* Modification of data

Basically there are two types of DMLs,

1) Procedural DML

Here user need to specify what data and how to access that data

2) Declarative DML (Non procedural DML)

Here user need to specify what the data is and the DML will find an effective way to access those data

Therefore users mostly prefer Declarative DMLs since it is easier to learn and it can efficiently carry out data access.

Data Definition Language (DDL)

We specify database schema by a set of definitions and additional properties of data using DDL. We specify the storage structure and access methods used by Database system by a set of statements in a special type of DDL called data storage and definition language.

The DDL provides facilities to specify certain consistency constraints. Database system implement integrity constraints that can be tested with minimal overhead.

* Domain Constraints

Declaring an attribute like int, char as a specific domain acts as constraints on the values it can take. They are checked whenever new data items are entered.

* Referential integrity

There occurs some cases where we want a value appearingin one relation must appear in another relation. In some cases database modification cause violation in Referential integrity. When that happens, the action that causes the violation is rejected.

* Assertion

Assertion is any condition that a database must always satisfy. Domain constraints and Refrential integrity are other forms of assertions. When an assertion is created, system tests for its validity. If it is valid, database allows further modification if it does not cause any violation.

* Authorization

Users are differentiated according to type of access that they have to the database. This differentiation among the users are expressed in terms of Authorization.

The different types of authorizations are,

  • Read authorization
  • Insert authorization
  • Update authorization
  • Delete authorization

Data dictionary is a special type of table that can be accessed and updated by the database system itself. The database system consults the data dictionary before reading and modifying the data.

No comments:

Post a Comment