Chapter 7. SQL

Structured Query Language (SQL) has evolved over the years into the standard language for operations on relational databases. While each database vendor has implemented its own version of SQL, Oracle has remained fairly compliant with the ANSI SQL standard, although the company has certainly added its share of extensions and enhancements with each new release of the database.

SQL statements fall into two categories: Data Definition Language (DDL) and Data Manipulation Language (DML). You invoke DDL statements when you need to manipulate the structure of your Oracle database. You can use DDL statements to define, modify, and remove every type of object that can exist in an Oracle database. Many of the DDL statements require special database privileges and are normally executed by the DBA.

Data Manipulation Language (DML) statements, on the other hand, access and manipulate data stored in the Oracle database. You can use DML statements to insert, update, delete, and read data, as well as to control how Oracle operates when accessing data in the database.

This chapter provides a quick reference to the two types of SQL statements and their syntax. The common keywords and identifiers, summarized in the first section, apply to both types of statements.

Get Oracle in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.