×

DBMS Tutorial

DBMS Practice

Database Languages and Their Types in DBMS

DBMS Database Languages: In this tutorial, we will learn about the different types of database languages. By Anushree Goswami Last updated : May 26, 2023

What are Database Languages?

Database languages are the languages that provide the facility to specify the database schema and to express database queries and updates. They are further divided into four categories but all are purposed to provide the facilities in their specific ways and the most widely used database language is SQL language.

Let us understand the basics of the Database Languages, what's their task are and how they perform it.

Types of Database Languages

database languages

There are four types of database languages, they are:

1) Data Definition Language (DDL)

A Data Definition Language is a special kind of language that used to specify the database schema by the set of definitions. DDL is also purposed to specify the additional properties of the data.

There is a special type of DDL named as Data Storage and Definition language that specify the storage structure and access methods used by the database system. The hidden details for the implementation of the database schemas from the users are defined by these statements. Also, the data values that are stored in the database are required to satisfy certain consistency constraints.

For e.g. – A university is required to fulfill the criteria of the marks of the students never be negative. DDL provides facilities to specify such type of constraints. Every time the database gets updated, these constraints are being checked by the database system. These constraints can refer to the arbitrary predicate for the database. But these arbitrary predicates are costly for the tests. Therefore, in that case, integrity constraints are implemented by the database systems so that these constraints can be tested with less overhead and more accuracy.

  • Domain Constraints
    These are the most basic form of integrity constraint. In the database, they can be easily tested by the system every time a new data item is entered. Domain needs to be related to every attribute such as integer, character, date/time types. These attributes related to domain further acts as constraints on the values associated with it.
  • Referential Integrity
    Referential integrity means the value that is in the one relation must also appear in a certain set of attributes in another relation.
    Modifications in the database could turn out to violate the referential integrity and such actions are rejected by the normal procedure.
  • Assertions
    Assertions are the conditions that are needed to be satisfied by the database. The above two constraints, Domain Constraints and Referential Integrity Constraints are the special forms of assertions.
    System checks for the validity of the assertion and if it does not fit the validity criteria, no further modifications are done to the database.
  • Authorization simply means to provide access or permission to the differentiated users on various data values in the database.
    Most common authorizations are:
    1. Read Authorization – It only allows the user to read the data.
    2. Insert Authorization – It only allows the user to insert the data.
    3. Update Authorization – It only allows the user to modify the data.
    4. Delete Authorization – It only allows the user to delete the data.
    All of these different types of authorization are mutually exhaustive such that user can be assigned one or some or all of the combination of these types.
    DDL acts like any other programming language, in which an input is taken by the user and the output is generated. These outputs are further stored in the Data Dictionary.

2) Data-Manipulation Language (DML)

Data Manipulation Language (DML) is a language that provides the facility to access or manipulate the data to the user. There is various type of access, such as, retrieval, insertion, modification, and deletion of the information that is stored in the database.

DML are further classified into two types:

  • Procedural DMLs
    It is required from the user to specify what type of data is needed and how one can reach up to that data.
  • Declarative DMLs
    These are also referred to a Non – Procedural DML that requires from the user only to specify what type of data is needed and it doesn't specify how to reach up to that data.
    Declarative DMLs are easy to learn and use than Procedural DMLs.
    But in Declarative DMLs when the user doesn’t specify how to reach up to that data, this is the responsibility of the database system to figure out itself how to do so.

The query is a statement that requests for the retrieval of the information. Query Language is the portion of the DML that involves information retrieval. Therefore, Query Language and Data Manipulation Language, these terms are used synonymously, although they are technically incorrect.

3) Data Control Language (DCL)

Data Control Language provides the facility of the authorization in the database. All the commands used in DDL and DML can further be authorized with DCL.

The drawback of DCL is that one cannot rollback the command as DCL allows only implicit commit. This mainly occurs in Oracle Database. Some of the commands of DCL are:

  1. Grant: It allows only specific user to perform specific tasks.
  2. Revoke: It allows the cancellation of the previously granted permissions or the denied one.

4) Transaction Control Language (TCL)

Transaction Control Language is used to manage the transactions in the database. The functions performed by DML are further managed by this language. It allows the statements to be grouped together into logical transactions. TCL performs the following tasks:

  1. Commit: It is used to save the transaction in the database.
  2. Rollback: It is used to restore the database to the last committed state.
  3. Savepoint: It is used to store the transaction temporarily such that one can easily rollback to the transaction when needed.


Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.