Oracle Database 26ai SQL and PL/SQL Book
Every SQL function, statement, and developer package of Oracle AI Database 26ai — each with an example that ran in Oracle AI Database 26ai Free and the output it really produced. The complete developer's guide, from your first SELECT to nearly 100 built-in packages.
- Analytic functions
- JSON
- AI Vector Search
- Property graphs
- PL/SQL
- DBMS_SQL
- DBMS_SCHEDULER
- UTL_HTTP

The documentation, with the output it never shows
Oracle's manuals tell you the syntax. They rarely show what a statement returns, on data that looks like a real application. This book runs every example on Oracle AI Database 26ai and prints what came back.
Syntax diagrams, and results left to you
- A dozen reference manuals: SQL, PL/SQL, packages and types, JSON, XML, vector search.
- Examples on EMP and DEPT, and hardly ever the output they produce.
- Blog snippets written for 11g, 12c, or 19c, with no word on what has changed.
- Features new since 19c that you may not know exist.
Every feature, run and shown
- One book for SQL, PL/SQL, and the developer packages of Oracle AI Database 26ai.
- 677 examples, printed with the output they produced — none of it typed by hand.
- One realistic airline schema, Nimbus Air, from the first chapter to the last.
- What is new since 19c, marked in the text and collected in Appendix B.
Syntax, example, real output
Every function, statement, and package subprogram gets the same treatment: what it is for, how to write it, an example on the Nimbus Air data, and exactly what that example returned.
Find the feature
By task in the contents, or by name in the index. Each entry starts with its purpose and its syntax — here, a data quality operator new in 26ai.
Run the example
A short, practical query on the book's airline schema: which customers are called something like Mueller?
Read the real output
What the query returned in Oracle AI Database 26ai: Müller is two edits from Mueller, but scores 80 of 100 by Jaro-Winkler.
677 examples, each with what it returned
A runner executed every example with SQLcl on Oracle AI Database 26ai Free, and the book prints exactly what came back. Here are six of them, as they appear in the book.
Chapter 15: QUALIFY filters on an analytic function, so the best-paid employee of each department takes no subquery.
Real pages from the book
Syntax blocks, examples on the Nimbus Air data, and the output of every one of them, with chapters that open with what you will learn. Click any page to read it.
Pages shown from the full-color edition. The Kindle edition shows code in color; the paperback is printed in black and white.
SQL, PL/SQL, and the packages, completely
Every SQL function family, every kind of query, DML and DDL, the PL/SQL language from blocks to SQL macros, and the built-in packages that developers use.
Eight parts, 66 chapters
Read Part I to set up the database and meet Nimbus Air, then go to the chapter you need. Each part builds on the ones before it, and the index finds any feature by name.
Getting Started
The database, the tools, and the sample schema every example runs on.
- 1How to Use This Book
- 2Installing Oracle AI Database 26ai Free
- 3SQL*Plus, SQLcl, and SQL Developer
- 4Database Basics for Developers
- 5The Nimbus Air Sample Schema
SQL Fundamentals
The building blocks of every statement.
- 6Data Types
- 7Literals, Operators, Expressions, Conditions, and Pseudocolumns
- 8Format Models
Querying Data
From SELECT basics to graphs, JSON, XML, and vectors.
- 9SELECT Basics
- 10Joins
- 11Aggregation and Grouping
- 12Subqueries and Set Operators
- 13The WITH Clause and Recursive Queries
- 14Hierarchical Queries
- 15Analytic Queries and Windows
- 16PIVOT, UNPIVOT, MATCH_RECOGNIZE, and MODEL
- 17Flashback Queries, Sampling, and Partition-Extended Names
- 18Property Graphs and SQL/PGQ
- 19JSON in SQL
- 20XML in SQL
- 21AI Vector Search
SQL Functions Reference
Every SQL function, family by family.
- 22Character Functions
- 23Numeric and Bitwise Functions
- 24Date, Time, and Interval Functions
- 25Conversion Functions
- 26NULL-Related, Comparison, and Conditional Functions
- 27Aggregate Functions
- 28Analytic Functions
- 29LOB, Collection, Hashing, Encoding, and UUID Functions
- 30Environment, Identifier, Object, and Other Functions
- 31Machine Learning in the Database
Changing Data
DML, and the transactions and locks around it.
- 32INSERT, UPDATE, DELETE, and MERGE
- 33Transactions and Locking
Defining Data
Tables, views, indexes, and every other schema object, with security and the dictionary.
- 34Tables
- 35Special Tables
- 36Views and Materialized Views
- 37Indexes
- 38Sequences, Synonyms, Domains, Assertions, and Other Schema Objects
- 39Users, Roles, and Privileges
- 40The Data Dictionary
PL/SQL
The language, from the first block to SQL macros.
- 41PL/SQL Blocks and Language Basics
- 42SQL in PL/SQL and Cursors
- 43Records and Collections
- 44Exceptions
- 45Procedures and Functions
- 46Packages
- 47Triggers
- 48Dynamic SQL and Bulk Processing
- 49Advanced PL/SQL
Built-in PL/SQL Packages
Nearly 100 supplied packages for developers, each with examples.
- 50Output, Utility, and Session Packages
- 51DBMS_SQL
- 52DBMS_LOB
- 53Raw Data, Encoding, and Text Utilities
- 54Files and Networking
- 55DBMS_SCHEDULER and DBMS_JOB
- 56Queues, Pipes, Alerts, and Change Notification
- 57Security Packages
- 58Metadata and Code Management
- 59JSON and SODA in PL/SQL
- 60XML in PL/SQL
- 61Vector, Search, and Text Packages
- 62DBMS_MLE
- 63Flashback, Comparison, Redefinition, and Parallel Execution
- 64Performance Packages
- 65Generic Types and Polymorphic Table Functions
- 66The PL/SQL Web Toolkit
More Packages, What's New, and Commands
The other supplied packages, the features new since 19c, and a reference of SQL*Plus and SQLcl commands.
- AOther Supplied Packages
- BWhat's New Since Oracle Database 19c
- CSQL*Plus and SQLcl Commands
Everything 26ai adds for developers
Oracle AI Database 26ai is the long-term support release after 19c, with all that 21c and 23ai introduced. The book marks what is new where it is described, and Appendix B lists it all with the chapters.
Run in 26ai
Every example ran in Oracle AI Database 26ai Free while the book was written.
Real output
No output was typed by hand: the book prints exactly what each example returned.
One sample schema
All examples use Nimbus Air, a fictional airline installed with one script.
Free to run
Oracle AI Database 26ai Free, SQLcl, and the code repository cost nothing.
Every SQL function. Every statement. Every developer package. Each with a real example and its real output.
- Paperback, 700 pages
- Kindle edition
- Free code on GitHub
Who is this book for?
Developers who write SQL and PL/SQL for Oracle Database — application and APEX developers, data engineers, and DBAs who write code — from those who know basic SQL to experienced developers moving from 19c to 26ai. Read Part I first, then go to the chapter you need.
Do I need Oracle AI Database 26ai?
The examples ran in Oracle AI Database 26ai Free, which costs nothing; Chapter 2 shows how to install it in a container with Docker or Podman, on Linux, or on Windows. Most of the SQL and PL/SQL also works in 19c. What is new since 19c is marked in the text, and Appendix B lists it.
What exactly does it cover?
Queries of every kind, every family of SQL functions, DML and DDL, the PL/SQL language from blocks to object types and SQL macros, and nearly 100 built-in packages, from DBMS_OUTPUT and DBMS_SQL to UTL_HTTP, DBMS_SCHEDULER, DBMS_CRYPTO, DBMS_VECTOR, and DBMS_MLE. Appendix A describes the other supplied packages, most of them for DBAs.
Is the output really from running the code?
Yes. A runner executed every example with SQLcl on Oracle AI Database 26ai Free, release 23.26, and the book prints what it returned. Where the output depends on when you run an example — the current date, generated identifiers, timings — Chapter 1 says so.
What is Nimbus Air?
The book's sample schema: a fictional airline with 14 tables — airports, routes, flights, aircraft, crew, customers, bookings, tickets, payments, and reviews — with realistic data, including JSON loyalty documents, time zones, and review texts for vector search. It installs with one script from the code repository.
Does it cover AI Vector Search?
Yes. Chapter 21 covers the VECTOR type, the distance functions, vector indexes, and semantic search with an embedding model loaded into the database. Chapter 61 covers DBMS_VECTOR, DBMS_VECTOR_CHAIN, DBMS_HYBRID_VECTOR, and DBMS_SEARCH.
Where is the code?
On GitHub, free: github.com/devvinish/oracle-database-26ai-book-code has all 677 examples with their output, and the scripts that install the Nimbus Air schema.
Is the paperback in color?
The paperback is printed in black and white on white paper, 7.5 by 9.25 inches, 700 pages, with a glossy cover. The Kindle edition shows the code in color.
Paperback or Kindle, on Amazon
Both editions have the same 66 chapters, three appendices, and index. Pick the paperback for your desk and the Kindle edition for code in color on any screen.
- Get the bookFrom Amazon, in the edition you prefer.
- Install the database and Nimbus AirOracle AI Database 26ai Free and the sample schema, as Chapters 2 and 5 describe.
- Run the examplesLook up a feature, run its example, and compare your output with the book's.
Paperback
$39.99on Amazon.com
- 700 pages, 7.5 × 9.25 in
- Black and white on white paper
- Glossy cover
- ISBN 9798177170534
Kindle edition
$12.99on Amazon.com
- Code in color
- Reflowable on any Kindle
- Linked contents and index
- Kindle apps for phone, tablet and PC
The code of the book, free: all 677 examples with the output they produced, and the scripts that install the Nimbus Air schema.
setup/nimbus/the Nimbus Air schema, its data, and its sample filesexamples/one folder per topic, each example with its outputsetup/login.sqlthe SQLcl settings the examples ran with