What are the functions of DDL and DML in a DBMS?

DBMS stands for database management system. A DBMS is software that interfaces between a database and the users. A DBMS is designed to carry out data manipulations, retrieval, and storage.

There are different commands that a DBMS uses to perform its functionality, including DDL and DML.

DDL

DDL (Data Definition Language) is a suite of routines and instructions that are used to define the database and manipulate the database itself by creating and altering its tables, relations, and structure. The database definition language is used to specify the data to be stored and assigned characteristics.

Some basic DDL commands that are used to define the database scheme are as follows:

  • CREATE
  • ALTER
  • COMMENT
  • RENAME
  • TRUNCATE
  • DROP

Command descriptions

  1. The create command is used to aid the creation of a database.
  2. The alter command is used to alter the structure of the database.
  3. The comment command is used to make comments to the data dictionary.
  4. The rename command is used to rename an already existing object in the database.

DML

DML (Data Manipulation Language) is a suite of routines and commands that allows manipulation and alteration of the data in the database.

Some basic DML commands include:

  • SELECT
  • INSERT
  • UPDATE
  • DELETE
  • LOCK

Command descriptions

  1. DML can be used to retrieve data from the database based on specific criteria with select statements.

  2. We use the insert command to insert data into a table.

  3. Data manipulation language is used to update existing data within a database table with the update command.

  4. Data manipulation language helps to delete records from a database table with the delete command.

  5. Data manipulation language includes the lock command that helps maintain table concurrencyallowing multiple users to access the database simultaneously.

Free Resources