Home » Database Management System » Unit 1: Introduction » Describe the classification of database languages. Which type of language is SQL? OR Discuss the following terms: (i) DDL command (ii)DML command

Describe the classification of database languages. Which type of language is SQL? OR Discuss the following terms: (i) DDL command (ii)DML command

Support this post with a reaction:

5,436 views

Database languages are used to talk to a DBMS. Using these languages, users and administrators can:

  • Create the structure of a database
  • Add, change, or remove data
  • Manage security and access

Classification of Database Languages

1. Data Definition Language (DDL)

DDL is used to define or change the structure of the database  like creating, changing, or deleting tables and indexes.

It works on the schema – structure, not the actual data. Its effects are usually saved automatically.

Main DDL Commands:

CommandWhat it doesExample
CREATEBuilds a new table or structureCREATE TABLE Student (RollNo INT PRIMARY KEY, Name VARCHAR(30), Marks INT);
ALTERChanges an existing table (add/remove column)ALTER TABLE Student ADD Email VARCHAR(50);
DROPDeletes a table permanently, along with its structure and dataDROP TABLE Student;
TRUNCATEDeletes all rows instantly, but keeps the table structure for future useTRUNCATE TABLE Student;

2. Data Manipulation Language (DML)

DML is used to work with the actual data stored in tables adding, changing, deleting, or viewing records.

Main DML Commands:

CommandWhat it doesExample
INSERTAdds new rows of dataINSERT INTO Student VALUES (101, ‘Aman’, 85, ‘aman@email.com’);
UPDATEChanges existing dataUPDATE Student SET Marks = 90 WHERE Roll No = 101;
DELETERemoves rows based on a conditionDELETE FROM Student WHERE Roll No = 101;
SELECTFetches data from a tableSELECT Name, Marks FROM Student WHERE Marks > 80;

3. Data Control Language (DCL)

DCL is used to give or take away permissions for users to access data.

Main DCL Commands:

CommandWhat it doesExample
GRANTGives permission to a userGRANT SELECT, INSERT ON Student TO User_Rohan;
REVOKETakes back permission from a userREVOKE INSERT ON Student FROM User_Rohan;

4. Transaction Control Language (TCL)

TCL is used to manage transactions. A transaction is a group of operations that should either all complete or none at all.

Main TCL Commands:

CommandWhat it doesExample
COMMITSaves all changes permanentlyCOMMIT;
ROLLBACKUndoes changes and goes back to the last saved state (used if error happens)ROLLBACK;
SAVEPOINTCreates a checkpoint inside a transaction, so we can roll back to that specific point instead of undoing everythingSAVEPOINT sp1;

Which Type of Language is SQL?

SQL (Structured Query Language) is not just one type  it actually covers all these categories together, under one syntax.

  • CREATE → acts as DDL
  • INSERT, UPDATE → act as DML
  • SELECT → acts as DQL (Data Query Language)
  • GRANT → acts as DCL

So SQL is a complete database language that combines DDL, DML, DQL, DCL, and TCL all together.

A Closer Look: DDL and DML

DDL Commands (Builds the Structure)

DDL commands build the skeleton of the database. They define the schema, columns, data types, and rules (constraints).

Whenever a DDL command runs, it updates the data dictionary (this is like a “metadata” file information about the data  stored inside the DBMS).

  • CREATE — builds new database objects like tables or views.
  • ALTER — changes the structure of an existing table (add/remove column).
  • DROP — removes a table completely, along with all its data.
  • TRUNCATE — removes all rows from a table, but keeps the table structure.

DML Commands (Works with the Data)

DML commands work with the actual data inside the tables that DDL created.

  • INSERT — adds new rows into a table.
  • UPDATE — changes existing data based on a condition.
  • DELETE — removes specific rows based on a condition.
  • SELECT — retrieves data from one or more tables to view or study.