Learn Steps

Different sub-languages of SQL.

When we talk about databases. One of the biggest types that exists is SQL. SQL or Structured Query Language is used where you have to keep data that is relational in nature. Mysql, Postgres, DB2 are the different software that implements it. SQL comprises of many sub-languages that provide different capabilities to SQL. The capabilities that are provided by sub-languages of SQL are creation, manipulation of data, querying and control on it.

Now when we talk about different types of sub-languages that are supported by SQL, people generally know about DDL(Data Definition Language) and DML(Data Manipulation Language). In this article, we will talk about other types of sub-languages in SQL and what commands they provide to work with SQL.

DML (Data Manipulation Language):

In DML, we try to manipulate the data. Commands like INSERT and UPDATE are part of this sub-language.

DDL (Data Definition Language):

In DDL, we define the data structure and relation between them. Commands like CREATE are part of this.

DCL (Data Control Language):

In DCL, we control access to data. This is used for permission management and who can access the data. Commands like GRANT and REVOKE are part of this sub-language.

TCL (Transaction Control Language):

In TCL we control the flow in a transaction. COMMIT and ROLLBACK are part of this sub language.

DQL (Data Query Language):

In DQL, we query the data. SELECT command is part of DQL.

Below is the table of commands that exist in these sub-languages.

DDL DML DQL TCL DCL
CREATE
DROP
RENAME
TRUNCATE
ALTER
INSERT
UPDATE
DELETE
SELECT COMMIT
ROLLBACK
SAVEPOINT
GRANT
REVOKE

These were the sub-languages of SQL and what commands are part of which sub-language.

If you like the article please share and subscribe. You can also join our Facebook, LinkedIn or Twitter for regular updates on new tech articles.

READ MORE ABOUT MYSQL OPTIMIZATION HERE