- Data Definition Language (DDL) – to define and modify the structure of a database.
- Data Manipulation Language (DML) – to access, manipulate, and modify data in a database.
- Data Control Language (DCL) – to control user access to the data in the database and give or revoke privileges to a specific user or a group of users.
- Transaction Control Language (TCL) – to control transactions in a database.
- Data Query Language (DQL) – to perform queries on the data in a database to retrieve the necessary information from it.
- DDL:
CREATE
, ALTER
TABLE
, DROP
, TRUNCATE
, and ADD COLUMN
- DML:
UPDATE
, DELETE
, and INSERT
- DCL:
GRANT
and REVOKE
- TCL:
COMMIT
, SET TRANSACTION
, ROLLBACK
, and SAVEPOINT
- DQL: –
SELECT
+---------------------+
| SQL Commands |
+----------+----------+
|
v
+----------+----------+
| DDL (Data |
| Definition Language)|
+----------+----------+
|
+---------+---------+
| |
+----+----+ +-----+-----+
| CREATE | | ALTER |
| TABLE | | TABLE |
+----+----+ +-----+-----+
| |
v v
+--------+---------+ +-----+-------+
| | | |
+------| DROP TABLE | | MODIFY |
| | | | TABLE |
| +------------------+ +-------------+
| |
| v
| +--------+--------+
| | |
+-------------------------------| RENAME TABLE |
| |
+------------------+
+----------+----------+
| DML (Data |
| Manipulation Language)|
+----------+----------+
|
+---------+---------+
| |
+----+----+ +-----+-----+
| INSERT | | UPDATE |
| INTO | | TABLE |
+----+----+ +-----+-----+
| |
v v
+--------+---------+ +-----+-------+
| | | |
+------| DELETE FROM | | MERGE INTO |
| | | | TABLE |
| +------------------+ +-------------+
| |
| v
| +--------+--------+
| | |
+-------------------------------| TRUNCATE TABLE |
| |
+------------------+
+----------+----------+
| DCL (Data |
| Control Language) |
+----------+----------+
|
+---------+---------+
| |
+----+----+ +-----+-----+
| GRANT | | REVOKE |
| | | PRIVILEGES|
+----+----+ +-----+-----+
|
v
+--------+--------+
| |
| SET TRANSACTION|
| |
+------------------+
Leave a Reply