Although, there are a number of query languages that are in use both commercially and in research. The most popular and widely accepted query language is Structured Query Language-SQL. Structured Query Language-SQL is not a general-purpose language. It is domain-specific. We use it in the design and management of data held in RDBMS.
The basis of SQL is relational algebra. SQL parser translates its abstract syntax tree into a tree of relational operators, which describes the relational algebra operations.
Originally SQL was named as SEQUEL which stands for Structured English Query Language. However, later it was renamed as SQL. The motive was to design a programming language just like English with formal syntax i.e. structured English.
SQL uses certain commands to carry out the required task. SQL categorize them into 5 categories.
We use Data Definition Language to define, delete and modify relational schema or structure. We also use DDL for defining view and integrity constraints on the data stored in the database. DDL commands are:
Create, Alter, Drop, Truncate and Rename
The command used to retrieve data from the database. DQL command is Select
We use DML commands to manipulate the data present in the database. We apply DML commands on the data of the database table. Most commonly used DML commands are:
Insert, Update and Delete.
Data Control Language includes commands which mainly deals with permissions and rights and other controls of the database. DCL commands are:
Grant and Revoke
TCL includes commands for specifying the beginning and end of the transactions in the database. TCL commands are:
Commit, Rollback and Savepoint