Introduction to SQL Commands

In simple words SQL commands enables the users to work with the databases. SQL commands are instructions, used to communicate with the database to perform specific tasks, work, functions and queries with data stored on the databases. For example we can create databases, tables, add data to tables, modify data, drop the table, set permissions for users etc.

SQL commands are grouped into three major categories depending on their functionality :

DDL (Data Definition Language) Commands : 

DDLs or Data Definition Language commands are used to define the metadata of the database. With DDL commands we can create, modify and remove database objects such as tables, indexes, and users. Some of the common DDL commands are given below :


DML (Data Manipulation Language) Commands : 

DMLs or Data Manipulation Language commands enables the user to access or manipulate data as organised by the appropriate data model. It is a language that provides a set of operations to support the basic manipulation operations on the data held in the databases. The DML Commands allows the users to insert, update, delete and retrieve data from the database. Some of the common DML commands are given below :


DCL (Data Control Language) Commands : 

The DCL or Data Control Language commands are used to control privilege in database. To perform any operation in the database, such as for creating tables, sequences or views we need privileges. A privilege can either be granted to a User with the help of GRANT statement. The privileges assigned can be SELECT, ALTER, DELETE, EXECUTE, INSERT, INDEX etc. In addition to granting of privileges, you can also revoke (taken back) it by using REVOKE command. Some of the DCL commands are given below :


Next Topic :