SQL And Its Sub-Languages
SQL (Structured Query Language) is a language understood by most modern databases. It is an ANSI (American National Standard Institute) standard language which is used to manipulate databases.
SQL is a combination of 5 different sub-languages each of which are meant to do separate tasks.
- DQL (Data Query Language)
- DDL (Data Defination Language)
- DML (Data Manipulation Language)
- TCL (Transaction Control Language)
- DCL (Data Control Language)
DQL (Data Query Language)
It is also called as Data Retrieval Language (DRL). This language is used to retrieve data from the database. It provides the SELECT statement which can be used to extract data from tables in a database.
DDL (Data Definition Language)
This sub-language of SQL is used to create and manipulate different objects in the database. The various objects that a database can have are table, view, synonym, sequence, index and type. DDL provides the following statements to manipulate these objects:
DML (Data Manipulation Language)
DML is used to manipulate the data/ records stored in the database. The statements provided by DML for the purpose are:
TCL (Transaction Control Language)
After any DML statement is executed, the updated data is not made persistent in the respective tables. In order to save the data it has to be explicitly saved by the user using a TCL command. The user can either save or discard it. The statements provided by TCL for this purpose are:
DCL (Data Control Language)
DCL is used to control the access to different objects stored in the database. DCL provides 2 statements for access control: