Chris Saxon's Avatar

Chris Saxon

@chrisrsaxon

Oracle Developer Advocate for SQL. Lover of quizzes and games of all kinds. Any views expressed belong to me. chrissaxon.co.uk

696
Followers
35
Following
263
Posts
01.09.2023
Joined
Posts Following

Latest posts by Chris Saxon @chrisrsaxon

We're working on them - if there's any you think could be clearer please let me and Toon know.

We're aware of ORA-08697 when you use JOIN syntax

07.03.2026 16:54 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Assertions for data integrity on a less-than-ideal data model 25-30 years ago I worked a lot with the Danish developed ERP system called Concorde XAL. It ran on top of a database (choice of several, mos...

Assertions for data integrity on a less-than-ideal data model.

www.kibeha.dk/2026/03/asse...

Or "How I could have used assertions 25 years ago when I worked with Concorde XAL"...

#OrclDB #SQL #Assertions #OracleACE

06.03.2026 15:50 πŸ‘ 5 πŸ” 4 πŸ’¬ 2 πŸ“Œ 0

Combining all into one should still be efficient; I'd have to check the details though.

Specific errors is a plus.

06.03.2026 13:34 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Filter in the ALL query, then check exists the one corresponding table in SATISFY

06.03.2026 11:43 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Could you create a separate assertion for each table?

06.03.2026 11:42 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

the join columns must be non-null - either via a constraint or where clause

06.03.2026 10:29 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

So like a conditional foreign key?

This should be possible with assertions, though it depends on the details

06.03.2026 10:05 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

What couldn't?

06.03.2026 09:35 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
SQL statement:
select use_cases from assertions where creator = 'Oracle ACE'
order by real_world_applicability + complexity + novelty desc
fetch first 3 rows only

SQL statement: select use_cases from assertions where creator = 'Oracle ACE' order by real_world_applicability + complexity + novelty desc fetch first 3 rows only

We're still looking for interesting assertions use cases

Just over two weeks left for #OracleACE to get your entries in

Bounty closes 15th March

For full details read blogs.oracle.com/sql/assertio...

27.02.2026 09:56 πŸ‘ 4 πŸ” 3 πŸ’¬ 2 πŸ“Œ 0

I saw, thanks! You're welcome to submit as many as you want :)

27.02.2026 14:52 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
SQuizL for 27 Feb 2026. 

Guess the SQL statement in the top left which ends "pokemon_trainers" using the clues provided below.

SQuizL for 27 Feb 2026. Guess the SQL statement in the top left which ends "pokemon_trainers" using the clues provided below.

Stretch your #SQL skills with #SQuizL

A free guess the SQL statement quiz

Every day there's a new Oracle SQL statement to solve in six tries or less

Pick from the fragments below to complete the statement on the top left

Can you get it in one?

buff.ly/hpGFuBa

27.02.2026 12:02 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
SQL statement:
select use_cases from assertions where creator = 'Oracle ACE'
order by real_world_applicability + complexity + novelty desc
fetch first 3 rows only

SQL statement: select use_cases from assertions where creator = 'Oracle ACE' order by real_world_applicability + complexity + novelty desc fetch first 3 rows only

We're still looking for interesting assertions use cases

Just over two weeks left for #OracleACE to get your entries in

Bounty closes 15th March

For full details read blogs.oracle.com/sql/assertio...

27.02.2026 09:56 πŸ‘ 4 πŸ” 3 πŸ’¬ 2 πŸ“Œ 0
Preview
Brand new to Oracle AI Database? StartΒ Here Many Oracle guides are written for DBAs or long-time developers, and as a newcomer it feels like you’re expected to already know the jargon. I started in the same place, learning the as I went, and I’m still learning each day. If you're considering using Oracle AI Database, I'm here to make this easy for you. Prefer code samples over blogs?

Brand new to Oracle AI Database? StartΒ Here

Many Oracle guides are written for DBAs or long-time developers, and as a newcomer it feels like you’re expected to already know the jargon. I started in the same place, learning the as I went, and I’m still learning each day. If you're considering using…

23.02.2026 21:56 πŸ‘ 5 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0
Post image

Aggregation Filters in Oracle AI Database 26ai

oracle-base.com/articles/26/...

24.02.2026 09:37 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Enforcing Acyclic Hierarchies With SQL Assertions Introduction Referential integrity constraints have been available since version 7 of the Oracle Database. While these constraints ensure that referenced rows exist, they cannot express more complex i...

Hierarchies should be trees and not loops.

Learn how SQL Assertions in Oracle AI Database 23.26.1 can help prevent cycles in hierarchical data.

www.salvis.com/blog/2026/02...

23.02.2026 16:36 πŸ‘ 8 πŸ” 3 πŸ’¬ 0 πŸ“Œ 0
Preview
Reading List – February 2026Β #4 Lots of good 26 (and) ai content

πŸ“š New Reading List is out!

This week, we got a lot of great β­• #Oracle AI #Database and πŸ€– #AI content!

πŸ“– Happy reading!

23.02.2026 14:00 πŸ‘ 3 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0

The recording for this session is now avaiable

www.youtube.com/watch?v=ulLy...

19.02.2026 17:16 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Example SQL statement in 23.26.1 with the FILTER clause for aggregates

select sum ( salary ) filter ( 
         where job_id = 'IT_PROG' 
       ) total_programmer_salaries,
       avg ( salary ) filter ( 
         where job_id like '%CLERK' 
       ) mean_clerk_salaries
from   employees;

Example SQL statement in 23.26.1 with the FILTER clause for aggregates select sum ( salary ) filter ( where job_id = 'IT_PROG' ) total_programmer_salaries, avg ( salary ) filter ( where job_id like '%CLERK' ) mean_clerk_salaries from employees;

You can conditionally filter aggregates in Oracle AI Database 23.26.1 with

fn ( col ) FILTER ( WHERE ... )

In earlier releases use

fn ( CASE WHEN ... THEN col END )

Both these filter the rows as part of the aggregration

Read more in my latest post blogs.oracle.com/sql/conditio...

19.02.2026 14:36 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
A SQL statement finding the top three assertions use cases

A SQL statement finding the top three assertions use cases

Calling #OracleACE: we want your assertion use cases!

We’re opening a bounty for creative, real-world solutions using assertions

Submit your blog post, video, script or slide deck the contribution app by the end of 15 March

Full details at buff.ly/fNgDHQv

13.02.2026 15:05 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Great work by the top 3 players in the Weekly DB comp on Oracle Dev Gym for January

1st mentzel.iudith
2st Mahamoutou
3rd Andrey Zaytsev

πŸ‘πŸ†

Thanks to all who took part

See the full rankings at devgym.oracle.com/pls/apex/f?p...

09.02.2026 17:04 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

To learn about this, join us Tues 17th Feb at 2pm UK time asktom.oracle.com/ords/r/tech/...

06.02.2026 14:04 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

In Feb's Ask TOM Live we're looking at fourth normal form:

"A table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X β†  Y, X is a superkey"

To help you understand this, would you prefer

A description of these technical terms?
Something more informal?

06.02.2026 14:04 πŸ‘ 3 πŸ” 0 πŸ’¬ 2 πŸ“Œ 1
Aggregation Filters - @DBoriented New in Oracle 26ai: the FILTER clause allows to restrict the rows considered by aggregate functions

New in Oracle Database #26ai - Aggregation Filters using the FILTER clause in #SQL.
db-oriented.com/2026/02/06/a...
@oracleace.bsky.social @sym42.bsky.social

06.02.2026 13:48 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

I've added a check constraint to the required list to be explicit

05.02.2026 14:28 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Congratulations Chris!

I learned a lot reading Troubleshooting Oracle Performance many years ago; hope pre-retirement suits you well

05.02.2026 14:07 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

In particular, all expressions you can use in WHERE are valid in QUALIFY, but you should strongly prefer to put them in WHERE to ensure optimal plans

05.02.2026 14:03 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

It's not quite what you would write manually

The QUALIFY clauses get wrapped as a Boolean expression. So if you have

QUALIFY p1 AND p2 AND p3

it becomes

SELECT * FROM (
SELECT ( p1 AND p2 AND p3 ) qexpr ...
) WHERE qexpr IS TRUE

So yes, a manual rewrite may give better optimizations

05.02.2026 14:01 πŸ‘ 1 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0
Post image

Yep - use a check constraint

05.02.2026 13:52 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
Use Oracle FreeSQL.com as a remote testΒ database FreeSQL.com lets you use a free, hosted Oracle AI Database instance right from your browser. But, FreeSQL can also be used as a remote database for testing, POCs, and more! In this article, we'll walk though how to connect to a FreeSQL database from your local machine, no database setup required. Login to FreeSQL.com To use FreeSQL as a remote database, you'll need to login using your Oracle account.

Use Oracle FreeSQL.com as a remote testΒ database

FreeSQL.com lets you use a free, hosted Oracle AI Database instance right from your browser. But, FreeSQL can also be used as a remote database for testing, POCs, and more! In this article, we'll walk though how to connect to a FreeSQL database from…

04.02.2026 20:02 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Examples of valid and invalid time periods when checking for overlapping ranges with respect to a reference period

Examples of valid and invalid time periods when checking for overlapping ranges with respect to a reference period

Preventing overlapping start-end dates in history tables is a common challenge

Oracle AI Database gives you two ways to do this:

Guarantee consecutive ranges with foreign keys
Stop overlapping ranges with assertions

Find out how in my latest post blogs.oracle.com/sql/how-to-s...

05.02.2026 10:17 πŸ‘ 6 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0