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
Enjoy 24/7 customer support for any queries or concerns you have.
Phone: +1 213 3772458
Email: support@gradeessays.com