Database Languages are used to create and maintain database. Today almost all RDBMS(MySql, Oracle, Infomix, Sybase, MS Access) uses SQL as the standard database language.
The database language commands can be categorized as follows:
The database language commands can be categorized as follows:
- Data Definition Language (DDL)
- Data Manipulation Language (DML)
- Data Query Language (DQL)
- Data Control Language (DCL)
- Transaction Control Language (TCL)
Data Definition Language (DDL)
DDL commands are used to define the database structure or schema.
It includes:
- CREATE: To create database instances or objects.
- ALTER: To alter the database structure or schema.
- DROP: To delete the database instances or objects.
- TRUNCATE: To remove all records from a table, including all spaces allocated for the records are removed
- RENAME: To rename a database object or instance.
- COMMENT: To add comments to the data dictionary.
Data Manipulation Language (DML)
DML commands are used for managing data within schema objects.
It includes:
- INSERT: To insert data into a table.
- UPDATE: To update existing data within a table.
- DELETE: To deletes all records from a table.
- MERGE: To merging two rows or two tables.
Data Query Language (DQL)
DQL commands are used to retrieve data from the database. All Select statements comes under DQL.
It include:
- SELECT: To retrieve data from the table.
Data Control Language (DCL)
DCL commands are used for granting and revoking user access on a database.
It includes:
- GRANT: To grant access to user.
- REVOKE: To revoke (withdraw) access from user.
Transaction Control Language (TCL)
TCL commands are used to manage transactions in database.These are used to manage the changes made by DML statements.
It includes:
- COMMIT: To save work done.
- SAVEPOINT: To identify a point in a transaction to which you can later roll back.
- ROLLBACK: To restore database to original since the last COMMIT.