Different Types of SQL Commands

Types of SQL Commands:

SQL commands are instructions that used to communicate with the database. It can perform various tasks like creating a table, adding data to tables, dropping the table, modifying the table, set permission for users. There are mainly three types of SQL commands:

    1. Data Definition Language
    2. Data Manipulation Language
    3. Data Control Language

Data Definition Language:

It is a part of SQL which consists of those commands that create the objects (tables, indexes, views, etc.) in the databases. Create, Drop and Alter are a few commands of the DDL language.

Data Manipulation Language:

It is part of SQL which consists of a set of commands that determine which values are present in the tables at any given time. Data Manipulation Language divided into three categories:

i. Retrieving Data: It means getting information out of a table. A selection of data items stored in a table presented on the screen. The command for retrieving data items is SELECT.
ii. Manipulating Data: It refers to the DML features that allow us to perform statistical functions on data.
iii. Updating Data: It refers to inserting and deleting rows in tables and changing values in the columns.

Data Control Language:

It is another portion of SQL which allows the definition of a security mechanism or schema for protecting data from unauthorized access. DCL consists of features that determine whether a user is permitted to perform a particular action. It contains commands like GRANT, REVOKE, etc. These are also known as Transaction Control Commands.