In this article, you will get to know the types of SQL statements which is used to manage any kind of databases.
The Types of SQL statements can be categorized into the following four ways: –
1) DDL ( Data Definition Language)
2) DML ( Data Manipulation language)
3) DCL ( Data Control Language)
4) TCL ( Transaction Control Language)
Now we will understand each of the above statements with examples: –
Table of Contents
1) DDL ( Data Definition Language): –
The DDL statement provides commands for defining relation schemas, that is for creating tables, indexes, sequences and so on and also commands for dropping, altering renaming objects.
a) CREATE: – It is used to create objects in the database.
b) ALTER: – It is used to alter the structure of the database.
|Alter the structure of the database|
c) RENAME: – To rename an object.
|Rename of a tablespace|
d) DROP: – This command is used to delete the objects from the database.
|Drop object from the database|
2) DML (Data Manipulation Language): –
a) SELECT: – It is used to retrieve the data from the database.
|Retrieve the data from the database|
b) INSERT: – This command is used to insert the data into a table.
|Insert data into a table|
c) UPDATE: – This command is used to update the existing records within the table.
|Updated the existing record|
3) DCL (Data Control language): –
4) TCL (Transaction Control Language): –
a) COMMIT: –
|Commit the transaction|
b) ROLLBACK: –
|Rollback the transaction|