SQL Commands- | Shalini Chauhan

Post

editor-img
Shalini Chauhan
Jan 17, 2023

SQL Commands-

SQL commands are instructions. It is used to communicate with the database. It is also used to perform specific tasks,

functions, and queries of data.

SQL can perform various tasks like create a table, add data to tables, drop the table, modify the table, set permission for users.

Types of SQL Commands

There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.

1. Data Definition Language (DDL)

o DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc.

o All the command of DDL are auto-committed that means it permanently save all the changes in the database.

Here are some commands that come under DDL:

o CREATE

o ALTER

o DROP

o TRUNCATE

2. Data Manipulation Language

o DML commands are used to modify the database. It is responsible for all form of changes in the database.

o The command of DML is not auto-committed that means it can't permanently save all the changes in the database. They can be rollback.

o INSERT o UPDATE o DELETE

3. Data Control Language

DCL commands are used to grant and take back authority from any database user. Here are some commands that come under DCL:

o Grant

o Revoke

4. Transaction Control Language

TCL commands can only use with DML commands like INSERT, DELETE and UPDATE only.

These operations are automatically committed in the database that's why they cannot be used while creating tables or dropping them.

Here are some commands that come under TCL:

o COMMIT

o ROLLBACK o SAVEPOINT

media

5. Data Query Language

DQL is used to fetch the data from the database.

It uses only one command:

o SELECT

I will discuss each command in detail in upcoming post:) STAY TUNED....


Tagged users
editor-img
Ravi Singh
@ravi1491
SDE Intern at Glue Labs