SQL commands are 4 types. DDL, DML, DCL and TCL
Here I am describing about the SQL Commands.
DDL is the short name of Data Definition Language. It used to create, update, and delete database schemas and their properties. It defines how data can be stored in the database.
DDL actions are:
- CREATE: Used to create a database and its objects like (table, index, views, store procedure, function, and triggers)
- ALTER: Update the structure of the existing database
- DROP: Delete schema from the database
- TRUNCATE: remove all records from a table even with its auto incremental ID
- RENAME: rename an object
DML is the short name of Data Manipulation Language. It deals with data manipulation and includes the most common SQL commands such as SELECT, INSERT, UPDATE, DELETE, etc. It is used to store, modify, retrieve, delete, and update data in a database.
DML actions are:
- SELECT: Retrieve data from a database
- INSERT: Insert data into a table
- UPDATE: Updates existing data within a table
- DELETE: Delete records from a database table
- MERGE: For merging two rows or two tables
DCL is the short name of Data Control Language. It deals with the commands such as GRANT and mostly concerned with rights, permissions and other controls of the database system.
DCL actions are:
- GRANT: Allow users access privileges to the database
- REVOKE: withdraw users access privileges given by using the GRANT command
TCL is the short name of Transaction Control Language. It deals with a transaction within a database.
TCL actions are:
- COMMIT: Commits a Transaction
- ROLLBACK: Rollback a transaction in case of any error occurs
- SAVEPOINT: Roll back the transaction making points within groups