October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Oracle SQL: The Six Types of SQL Statements

Oracle SQL has six statement categories. See what each covers, why Oracle classifies SELECT as DML, and how DDL differs from DML in transaction behavior.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Oracle groups SQL statements into six categories: data definition language (DDL), data manipulation language (DML), transaction control, session control, system control, and embedded SQL. In Oracle’s taxonomy, SELECT is DML—a limited form that reads data without changing what is stored. The practical distinction to remember is that DDL implicitly commits the current transaction, while DML does not implicitly commit it in the cited Oracle 19c reference.

Oracle’s six SQL statement categories

Oracle’s Concepts overview groups statements by what they do. The SQL Language Reference supplies detailed statement lists, which can vary by release. The examples below reflect the categories and representative statements in Oracle’s documentation.

Category What it affects Representative statements
DDL (Data Definition Language) Schema structure, schema objects, privileges, and roles CREATE, ALTER, DROP, GRANT, REVOKE, TRUNCATE
DML (Data Manipulation Language) Data in existing schema objects; includes queries SELECT, INSERT, UPDATE, DELETE, MERGE, CALL, EXPLAIN PLAN, LOCK TABLE
Transaction control Work performed in a transaction and its boundaries COMMIT, ROLLBACK, SAVEPOINT, SET TRANSACTION, SET CONSTRAINT
Session control Properties of the current user session ALTER SESSION, SET ROLE
System control Properties of the database instance ALTER SYSTEM
Embedded SQL SQL statements incorporated into a procedural-language program DDL, DML, and transaction-control statements embedded in a program

For the official functional summaries, see Oracle’s Oracle Database 26 Concepts overview. For statement lists, consult the Oracle Database 19c SQL Language Reference for the release you use.

Is SELECT DML in Oracle?

Yes. Oracle’s SQL Language Reference classifies SELECT as DML and calls it a limited form of DML. A query accesses data and can manipulate the data it accesses while producing results, but it does not change the data stored in the database.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Mastering Oracle SQL, 2nd Edition
  • Used Book in Good Condition

Some instructional material calls queries “DQL” (Data Query Language) to distinguish them from statements that change stored data. That is an alternate teaching convention, not a separate category in Oracle’s six-category classification.

How the categories differ in practice

DDL defines or administers schema objects

Statements such as CREATE TABLE, ALTER TABLE, and DROP TABLE create, modify, or remove database objects. Oracle’s DDL category also includes privilege and role operations such as GRANT and REVOKE, as well as TRUNCATE.

Rank #2
Sale
Oracle PL / SQL For Dummies
  • Used Book in Good Condition

DDL has an important transaction consequence. Oracle Database’s Oracle AI Database SQL Language Reference, Chapter 10, “Types of SQL Statements,” states: “The database implicitly commits the current transaction before and after every DDL statement.” That wording is from the Oracle Database 26 reference. A DDL statement can therefore commit earlier DML work in the current transaction; check the SQL Language Reference matching your database release for its exact behavior.

DML queries or changes data

INSERT, UPDATE, DELETE, and MERGE operate on data in existing objects. In the Oracle Database 19c SQL Language Reference, DML statements do not implicitly commit the current transaction. That lets related data changes remain part of a transaction until you commit or roll them back.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Transaction control governs DML work

Oracle describes a transaction as a sequence of statements treated as a unit. For example, when a manager leaves, a transaction might insert a row into JOB_HISTORY and update the relevant employees’ MANAGER_ID values. The changes can be committed together or undone as appropriate.

  • COMMIT ends the transaction and makes its changes permanent.
  • ROLLBACK undoes all or part of the transaction’s work.
  • SAVEPOINT marks a point within the transaction so you can roll back only the work performed after that point.
  • SET TRANSACTION and SET CONSTRAINT are also listed as transaction-control statements in Oracle Database 19c.

See Oracle’s Database Development Guide discussion of transactions for the transaction concept and explanations of COMMIT, ROLLBACK, and SAVEPOINT.

Session control differs from system control by scope

ALTER SESSION and SET ROLE change settings or roles for the current session. ALTER SYSTEM changes properties of the database instance, so its scope is broader than one session.

Embedded SQL places statements inside a program

Embedded SQL describes SQL statements incorporated into a procedural-language program. It is a category about how SQL is used in a program, rather than a single statement that performs one particular database operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep SQL classification separate from OCI processing

Oracle’s SQL Language Reference classifies statements by their function in SQL. Oracle’s OCI introduction uses categories relevant to client processing, including queries, DML, PL/SQL, embedded SQL, DDL, and control statements. For OCI applications, Oracle says transaction, session, and system control statements are treated as if they were DML for processing. That is an OCI handling convention, not a replacement for Oracle’s SQL-language taxonomy.

Oracle’s 19c SQL reference also notes that session-control statements and ALTER SYSTEM are not supported in PL/SQL; transaction-control support has exceptions for certain forms of COMMIT and ROLLBACK. DDL can be supported in PL/SQL through DBMS_SQL. These details are release- and context-dependent, so consult the matching reference before relying on them in an application.

For OCI-specific categories and processing behavior, see Oracle’s Oracle Database 19c OCI introduction.

Quick Recap

SaleBestseller No. 1
Mastering Oracle SQL, 2nd Edition
Mastering Oracle SQL, 2nd Edition
Used Book in Good Condition
$20.80
SaleBestseller No. 2
Oracle PL / SQL For Dummies
Oracle PL / SQL For Dummies
Used Book in Good Condition
$15.95
Bestseller No. 3

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.