DBMS Languages

What are the languages of DBMS?

In relational systems, SQL is the main language, split into DDL, DML, DCL and TCL. Here's what each group does, plus procedural and non-SQL languages.

On this page
  1. The four SQL command groups
  2. Extensions from each product
  3. Query languages outside SQL
  4. Where to start

The languages of a DBMS depend on the kind of database, but for relational systems the answer starts with SQL. SQL commands fall into groups by purpose, and most products add extensions of their own. Non-relational databases often use query languages that aren’t SQL at all.

The four SQL command groups

  • DDL defines structure, with commands such as CREATE, ALTER and DROP.
  • DML works with rows, with commands such as INSERT, UPDATE and DELETE. Many systems also support MERGE.
  • DCL controls permissions, with GRANT and REVOKE.
  • TCL manages transactions, with COMMIT, ROLLBACK and SAVEPOINT.

Some textbooks also name DQL for SELECT. The dbms languages list goes deeper into each group, with examples and the places where the groups get blurry.

Extensions from each product

Many products also add a procedural language with variables, loops and stored procedures. Common examples are:

  • T-SQL in Microsoft SQL Server
  • PL/SQL in Oracle Database
  • PL/pgSQL in PostgreSQL

Code written for one of these often needs changes before it runs on another.

Query languages outside SQL

  • MongoDB uses a JSON-style query syntax.
  • Neo4j uses Cypher for graph data.
  • Many RDF triple stores use SPARQL.

These languages have their own commands, so the SQL groups don’t apply to them directly.

Where to start

Learn SELECT, INSERT, UPDATE and DELETE on a small test database first. Then add CREATE TABLE and transaction commands.

The complete guide to dbms languages

DBMS Languages List: DDL DML DCL and TCL
Read the guide

Keep exploring

Guides from other topics

All topics →