DQL stands for Data Query Language, and it's a subset of SQL (Structured Query Language). It is used specifically to query data from a database without modifying it.
Read-only: DQL is used to retrieve data, not to insert, update, or delete it.
The primary command used is:
SELECT
Example:
SELECT name, birthdate FROM customers WHERE city = 'Berlin';
This command retrieves the names and birthdates of all customers living in Berlin — without changing any data.
Sub-language | Meaning | Main Purpose |
---|---|---|
DQL | Data Query Language | Reading data |
DML | Data Manipulation Language | Inserting, updating, deleting data (INSERT , UPDATE , DELETE ) |
DDL | Data Definition Language | Defining database structure (CREATE , ALTER , DROP ) |
DCL | Data Control Language | Managing access rights (GRANT , REVOKE ) |
TCL | Transaction Control Language | Handling transactions (COMMIT , ROLLBACK ) |