Question: Below is the answer to a previous question I had, but I do not understand why to truncate is a DDL command, but Delete is

Below is the answer to a previous question I had, but I do not understand why to truncate is a DDL command, but Delete is a DML command. Can you please explain with an example of each?

1. Data Definition Language(DDL) is the one that deals with database schemas and descriptions, of how the data should reside in the database.
examples:

CREATE - to create a database and its objects

ALTER - alters the structure of the existing objects in the database

DROP - delete objects from the database

TRUNCATE - remove all records from a table

COMMENT - add comments to the data dictionary

RENAME - rename an object

2. Data Manipulation Language(DML) is the one which deals with data manipulation,it is used to store, modify, retrieve, delete and update data in a database

SELECT - retrieve data from a table in the database

INSERT - insert data into a table

UPDATE - updates data of a table

DELETE - Delete all records from a table

3. Data Control Language(DCL) is one that includes commands that are used to grant rights, permissions, and other controls of the database.

GRANT - allow users access privileges to the database

REVOKE - withdraw users access privileges

4. Transaction Control Language(TCL) are the ones that deals with a transaction within a database

COMMIT - commits a Transaction

ROLLBACK - rollback a transaction

Step by Step Solution

3.30 Rating (144 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Why Truncate is a DDL command and Delete is a DML command Truncate is a DDL command because it reini... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!