In relational database management systems, interacting with data requires two distinct capabilities: building the structure and managing the information within it. SQL achieves this by dividing its capabilities into specialized sub-languages, primarily Data Definition Language (DDL) and Data Manipulation Language (DML). Together, these two components form the backbone of all database administration and development.
DDL
DDL stands for data defination language
It is a subset of SQL commands used exclusively to define, modify, and manage the structure of database objects (like tables, schemas, indexes, and views) rather than the data itself.
Commands used are CREATE,ALTER, DROP, TRUNCATE & RENAME
Difference between DROP and TRUNCATE
The primary difference is that DROP deletes both the data and the entire table structure from the database, while TRUNCATE deletes all rows of data but keeps the table structure intact for future use
DML
DML (Data Manipulation Language) is a subset of SQL commands used to manage and modify data stored within existing database tables.
Unlike DDL (Data Definition Language), which creates or alters the structure of the database itself, DML only affects the rows and records inside those structures.
The four primary DML commands are INSERT, UPDATE, DELETE, and SELECT. (Note: In strict database theory, SELECT is sometimes classified as DQL or Data Query Language, but in daily practice, it is widely grouped under DML)




Top comments (0)