Query Language DDL, DML, DCL

Rumman Ansari   Software Engineer   2023-03-25   7640 Share
☰ Table of Contents

Table of Content:


Query language (QL) refers to any computer programming language that requests and retrieves data from database and information systems by sending queries. It works on user entered structured and formal programming command based queries to find and extract data from host databases.

Query language may also be termed database query language.

Structure Query Language(SQL)

Structure Query Language(SQL) is a database query language used for storing and managing data in Relational DBMS. SQL was the first commercial language introduced for E.F Codd's Relational model of database. Today almost all RDBMS(MySql, Oracle, Infomix, Sybase, MS Access) use SQL as the standard database query language. SQL is used to perform all types of data operations in RDBMS.

  • Data-definition language (DDL): The SQL DDL provides commands for defining relation schemas, deleting relations, and modifying relation schemas.
  • DDL - Data Definition Language

    Command & Description

    CREATE

    Creates a new table, a view of a table, or other objother objectsatabase.

    ALTER

    Modifies an existing database object, such as a table.

    DROP

    Deletes an entire table, a view of a table or other objects in the database.

  • Interactive data-manipulation language (DML): The SQL DML includes a query language based on both the relational algebra and the tuple relational calculus. It includes also commands to insert tuples into, delete tuples from, and modify tuples in the database.
  • DML - Data Manipulation Language

    Command & Description

    SELECT

    Retrieves certain records from one or more tables.

    INSERT

    Creates a record.

    UPDATE

    Modifies records.

    DELETE

    Deletes records.

  • View definition: The SQL DDL includes commands for defining views.
  • Transaction control. SQL includes commands for specifying the beginning and ending of transactions.
  • Embedded SQL and dynamic SQL. Embedded and dynamic SQL define how SQL statements can be embedded within general-purpose programming languages, such as C, C++, Java, PL/I, Cobol, Pascal, and Fortran.
  • Integrity. The SQL DDL includes commands for specifying integrity constraints that the data stored in the database must satisfy. Updates that violate integrity constraints are disallowed.
  • Authorization. The SQL DDL includes commands for specifying access rights to relations and views.

DCL - Data Control Language

Command & Description

GRANT

Gives a privilege to user.

REVOKE

Takes back privileges granted from user.