Eroxl's Notes
Data Manipulation Language
aliases
DML

DML is a sub language of SQL which describes the syntax of the retrieving and manipulating of database records.

Statements

DML consists of several core statements for working with data:

SELECT

Retrieve data from tables. The SELECT statement includes:

  • Basic querying and column selection
  • DISTINCT values
  • Filtering with WHERE clause
  • Subqueries and set membership (IN, NOT IN, EXISTS, NOT EXISTS)
  • Set comparison operators (ANY, ALL)
  • Ordering results with ORDER BY
  • Limiting results with LIMIT

INSERT

Add new records to tables.

UPDATE

Modify existing records in tables.

DELETE

Remove records from tables.

Advanced Operations

JOIN

Combine rows from multiple tables based on related columns. Includes:

  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL OUTER JOIN

Set Operations

Combine results from multiple queries using Set theory operations:

Aggregate Functions

Perform calculations on multiple rows:

  • COUNT, SUM, AVG, MIN, MAX
  • GROUP BY clause
  • HAVING clause for filtering grouped results