DML stands for “Data Manipulation Language,” and it is a subset of SQL (Structured Query Language) that deals with the manipulation and management of data stored in a relational database. DML focuses on performing operations that modify, insert, or delete data within database tables. The primary DML statements are:

  1. INSERT: Adds new records (rows) into a table.
  2. UPDATE: Modifies existing records in a table.
  3. DELETE: Removes records from a table.

Let’s look at each of these statements in more detail:

  1. INSERT Statement:
    The INSERT statement is used to add new rows of data into a table. You specify the target table name and the values you want to insert into each column.

Example:

INSERT INTO employees (first_name, last_name, salary)
VALUES ('John', 'Doe', 50000);
  1. UPDATE Statement:
    The UPDATE statement is used to modify existing records in a table. You specify the target table, columns to be updated, new values, and a condition to identify the rows to be updated.

Example:

UPDATE employees
SET salary = salary * 1.1
WHERE department = 'Sales';
  1. DELETE Statement:
    The DELETE statement is used to remove records from a table. You specify the target table and a condition to identify the rows to be deleted.

Example:

DELETE FROM employees
WHERE hire_date < '2023-01-01';

DML statements can be combined with other SQL constructs to perform more complex operations. For instance, you can use subqueries, joins, and conditions to ensure that your data manipulations are accurate and effective.

DML statements are fundamental for maintaining and updating the data in a database, enabling you to keep your information up to date and relevant.