SQLDaily's Avatar

SQLDaily

@sqldaily

Daily Oracle SQL tips from the Oracle Developer Advocates for SQL

327
Followers
3
Following
309
Posts
28.11.2024
Joined
Posts Following

Latest posts by SQLDaily @sqldaily

Preview
Stop Making These 3 Database Mistakes πŸ“Β Get my database design guides for many sample databases: https://databasestar.mykajabi.com/lpkj-dbdesign/?video=Rb85G5Fwm4s πŸŽ“Β Learn how to design an effective database and create it using SQL:…

Are you making these 3 database design mistakes?

Using string data types for everything
Inconsistent naming
Aiming for a perfect design from the start

Ben Brumm explains why and what to do instead

06.03.2026 12:02 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Oracle 23ai: JSON Schema Support - Overview: Oracle first introduced the ability to display a JSON schema when they introduced the JSON Data in Oracle 12.2, but without th...

Define schemas to validate #JSON data in Oracle AI Database

CREATE TABLE ... ( col JSON VALIDATE USING '{ <schema> }' )

You can use this to check

If the JSON is an object or array
The name & type of attributes
Constraint their values

Anas Darkal demos buff.ly/n30C2Dx

05.03.2026 12:02 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
πŸ”₯Tutorial GRATIS ♠️ Oracle23ai SQL Firewall ♠️ Para mi esta es una de las funcionalidades novedosas de Oracle23ai, pues en Oracle siempre ha sido complicado prevenir la inyecciΓ³n de SQL o controlar accesos no autorizados desde ciertas IPs o…

Block #SQL injection attempts on Oracle AI Database with the SQL Firewall

This captures a list of permitted statements

The database can then reject statements not on this list, keeping your data safe

@cafedatabase.com shows how it works (in Spanish)

04.03.2026 12:01 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Data Use Case Enumeration Domains (23.4)
Create lists of name-value pairs

Names are identifiers, values are literals. You can omit the value, first = 1, then 2, 3, etc.
Query enum domains as a table to return the list of values

Example days_of_week enum

Data Use Case Enumeration Domains (23.4) Create lists of name-value pairs Names are identifiers, values are literals. You can omit the value, first = 1, then 2, 3, etc. Query enum domains as a table to return the list of values Example days_of_week enum

Use enum domains in Oracle AI Database to create lists of name-value pairs:

CREATE DOMAIN ... AS ENUM ( n1, n2, ... )

With these you can

Use the enum as a column's data type to constrain it to the enum's values
Reference the values by name in #SQL
Query the enum like a table

02.03.2026 12:01 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 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
Preview
Get Started with Oracle Database 23ai AI Vector Search | Thinking Anew Oracle Database 23ai was released recently and now includes the AI Vector Search. In this blog post, I walk thorough the steps needed to get started on an Always Free Oracle Autonomous Database 23ai.

Do semantic search in Oracle AI Database with the VECTOR data type

@adrian.fuzziebrain.com shows you how to

Load a pre-trained LLM model into the database
Vectorize your data with VECTOR_EMBEDDING
Build an APEX app to do AI Vector search

26.02.2026 12:01 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
23ai New Feature: GRANT SELECT ANY TABLE ON SCHEMA Another 23c or 23ai feature that you will be happy embracing!In previous Oracle versions, what did you do when someone requested read only access to a schema?Most likely, as a good DBA, you created…

Giving on database user read access to all the tables in another schema is a common need

Granting this access for every table is a chore

Oracle AI Database 26i simplifies this with

GRANT SELECT ANY TABLE ON SCHEMA ... TO ...

Diana Robete explains

25.02.2026 12:03 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Oracle Database 23ai Automatic Transaction Rollback

In Oracle AI Database 26ai you can set transaction priority:

ALTER SESSION SET txn_priority = { high | medium | low }

When a low priority transaction blocks one with a higher priority, the database can force the lower one to rollback

Gavin Soorma demos buff.ly/K6cZocb

24.02.2026 12:01 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Partition by expression (23.26.1)

Use an expression directly in the PARTITION BY clause

Example of composite list-range partitioning using expressions upper ( country ) and ( quantity * unit_price )

Partition by expression (23.26.1) Use an expression directly in the PARTITION BY clause Example of composite list-range partitioning using expressions upper ( country ) and ( quantity * unit_price )

Want to partition by an expression in Oracle AI Database?

e.g. UPPER ( col )

You can partition on virtual columns containing the expression

From 23.26.1 you can put the expression directly in the PARTITION BY clause

CREATE TABLE ... ( ... ) PARTITION BY ... ( UPPER ( col ) )

23.02.2026 12:02 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
SchemaWars homepage - Battle on Oracle SQL & PL/SQL

SchemaWars homepage - Battle on Oracle SQL & PL/SQL

Test your Oracle #SQL and PL/SQL skills in solo, versus, or tournament battles in

SchemaWars

An online platform with coding challenges by Morten Egan

Work on real schemas, enter your solution, and see your score!

buff.ly/c8Rkvq9

20.02.2026 12:01 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Graph queries enable you to find

Paths and patterns (e.g. flow of money transfers)
Clusters of data

Do this in Oracle AI Database by creating property graphs and querying them with

SELECT * FROM GRAPH_TABLE ( <graph> MATCH ... )

Karin Patenge demos buff.ly/RxCMHZj

19.02.2026 12:03 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Marco Pachaly-Mischke Read all of the posts by Marco Pachaly-Mischke on Marco's DBA Blog

Data usecase domains in Oracle AI Database enable you to describe values

e.g. rules for storing, showing, & sorting phone numbers

CREATE DOMAIN phone# AS ...
CHECK ...
DISPLAY ...
ORDER ...

@dbamarco.bsky.social shows how linking these to columns applies the rules

18.02.2026 12:02 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Optimistic Locking Made Easy: The Power of ETags in Action JSON Relational Duality Views are one of the most remarkable features introduced with Oracle AI Database 26ai. They effortlessly blend the best of both worlds: relational and document, greatly simp…

With #JSON duality views in Oracle AI Database you can build a JSON interface over database tables

These come with lost-update detection via ETags

@martindba.bsky.social shows how this prevents conflicting writes for REST calls by using the if-match header

17.02.2026 12:02 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
DATEDIFF & TIMESTAMPDIFF (23.26.1)

Get the number of unit boundaries crossed (YEAR down to NANOSECOND) between two datetimes
Set start of YEAR, QUARTER, & WEEK with the fourth parameter

Examples of the diff between dates for various units

DATEDIFF & TIMESTAMPDIFF (23.26.1) Get the number of unit boundaries crossed (YEAR down to NANOSECOND) between two datetimes Set start of YEAR, QUARTER, & WEEK with the fourth parameter Examples of the diff between dates for various units

Count the unit boundaries crossed between two datetimes with

DATEDIFF ( <unit>, <dt1>, <dt2> )

Note it's the boundaries crossed, not the duration

e.g. 31-Dec-2025 to 2-Jan-2026 crosses the 1st Jan boundary

=> the year diff = 1

Added to Oracle SQL in 23.26.1

16.02.2026 12:01 πŸ‘ 4 πŸ” 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
Preview
3-Minute Quiz: What do you know about SQL performance? Just 5 questions to see how much you know about SQL performance. Never make these mistakes again.

Think you know about #SQL performance?

Take this 3-minute indexing quiz by @winand.at

A simple test that 60% fail!

buff.ly/5C4XZ7N

Did you pass? Let us know how you did!

13.02.2026 12:02 πŸ‘ 10 πŸ” 3 πŸ’¬ 4 πŸ“Œ 0
Preview
SQL History Monitoring New in Oracle 23ai is a feature to allow tracking and monitoring the last 50 queries per session. Previously, we had other features and tools for doing this, but with SQL History we have some of th…

Struggling to remember which #SQL statements you just ran?

Set

sql_history_enabled = true

in Oracle AI Database 26ai and it records the last 50 statements in each session

Query v$sql_history to find them

@brendan-tierney.bsky.social demos

12.02.2026 12:01 πŸ‘ 3 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
The Moment for Database Documentation has come! Confluent Director Adi Polak posted this tweet earlier today regarding SQL and understanding the data model. I’m in agreement with her on both things, namely SQL is not a difficult thing to l…

Understanding a complex data model is challenging

@connormcd.bsky.social explains how you can make this easier in Oracle AI Database with

Constraints to improve data quality
Usecase domains to describe values
Schema annotations to add metadata

11.02.2026 12:01 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
MERGE and DML RETURNING clause in Oracle 23ai Oracle 23ai finally supports MERGE … RETURNING! A long-awaited feature, but still hard to find in the docs.

MERGE in Oracle AI Database 26ai supports the RETURNING clause:

MERGE INTO ...
USING ...
ON ( ... )
WHEN ...
RETURNING OLD ..., NEW ...
INTO ..., ...

This enables you to get pre (OLD) and post (NEW) merge values from the target

@andrejsql.bsky.social demos

10.02.2026 12:02 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Filter aggregation & window functions (23.26.1)

New FILTER ( WHERE … ) clause to limit rows processed by COUNT, SUM, MAX, etc.

Examples showing using this to filter the result of COUNT as an aggregate and window function

Filter aggregation & window functions (23.26.1) New FILTER ( WHERE … ) clause to limit rows processed by COUNT, SUM, MAX, etc. Examples showing using this to filter the result of COUNT as an aggregate and window function

Limit the rows processed by aggregate and window functions with the FILTER clause

e.g.

COUNT (*) FILTER ( WHERE ... )

The COUNT only includes rows WHERE the condition is true

Each function in a query can have a different FILTER

Available in Oracle AI Database from 23.26.1

09.02.2026 12:02 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
It’s there – Oracle AI Database 26ai is available for download This was a long wait – and finally, it’s there – Oracle AI Database 26ai is available for download on-prem. And as you may remember our announcement from Oracle AI World, Oracle A…

ICYMI

Oracle AI Database 26ai Enterprise Edition, 23.26.1.0.0, is available for on-premises download on Linux x86-64 platforms

@mikedietrichde.com shows you where to get it

06.02.2026 12:02 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
FUZZY_MATCH and PHONIC_ENCODE Data Quality Operators in Oracle Database 23ai/26ai Oracle database 23ai/26ai introduced the FUZZY_MATCH and PHONIC_ENCODE data quality operators to perform fuzzy string matching.

Oracle AI Database 26ai added operators for sounds like/similar to logic:

Sounds like => PHONIC_ENCODE ( <algorithm>, <str> )
Similar to => FUZZY_MATCH ( <algorithm>, <str1>, <str2> )

These help you find related strings

@oraclebase.bsky.social demos

05.02.2026 12:02 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
QUALIFY: The WHERE Condition for Analytic Functions Filtering analytic functions was not straight-forward in Oracle and most other databases. Oracle 26ai now supports the QUALIFY clause in SQL. It works like a WHERE condition, but can be used for an…

The QUALIFY clause enables you to filter rows using window functions

e.g. get the top ranked rows with

SELECT ... FROM ...
QUALIFY RANK () OVER ( ORDER BY ... ) = ...

@danischnider.bsky.social looks at how it works in Oracle AI Database 26ai

04.02.2026 12:01 πŸ‘ 0 πŸ” 2 πŸ’¬ 1 πŸ“Œ 0
Preview
Fast AI Search with GraalVM, Spring Boot, and Oracle Database In this blog post we’ll build a semantic search demo with GraalVM, Spring Boot, and Oracle Database

AI vector search enables you to find rows based on meaning

e.g.

β€œToys for big dogs” can match β€œHeavy Duty Rope for Large Dog Breeds”

@alina-yurenko.bsky.social shows how to build this with GraalVM, Spring Boot, and Oracle AI Database

03.02.2026 12:01 πŸ‘ 4 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0
Assertions (23.26.1)
Declare cross-row, cross-table constraints with simple SQL
Use existential ([NOT] EXISTS) expressions to define rule

Example creating an assertion ensuring that an employee can't have overlapping start-end dates in their job history

Assertions (23.26.1) Declare cross-row, cross-table constraints with simple SQL Use existential ([NOT] EXISTS) expressions to define rule Example creating an assertion ensuring that an employee can't have overlapping start-end dates in their job history

Assertions (23.26.1)
Declare cross-row, cross-table constraints with simple SQL
New universal expressions (ALL-SATISFY) as a clearer way to express rules that apply to every row

Example creating an assertion ensuring that an employee can't have overlapping start-end dates in their job history

Assertions (23.26.1) Declare cross-row, cross-table constraints with simple SQL New universal expressions (ALL-SATISFY) as a clearer way to express rules that apply to every row Example creating an assertion ensuring that an employee can't have overlapping start-end dates in their job history

Create cross-row, cross-table constraints in Oracle AI Database (23.26.1) with

CREATE ASSERTION ... CHECK ( <rule> )

Define the rule as either an

Existential expr

[ NOT ] EXISTS ( <query> )

Universal expr

ALL ( <query> ) alias SATISFY ( <condition> )

02.02.2026 12:01 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Patrick Trainer Personal blog and portfolio site

It's amazing what you can do with #SQL

Patrick has built a SQL-powered Doom clone using DuckDB

30.01.2026 12:02 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Parallel vs Simultaneous Words mean things and we should always strive to use the correct words. Β  Β  I am by no measure perfect at this, but I try my best to use the...

Parallelizing a task can make it faster; this is different to simultaneous:

Simultaneous – Occurring, operating, or done at the same time.
Parallel – Dividing a task into smaller sub-tasks that can be executed concurrently

Ric Van Dyke discusses

29.01.2026 12:02 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
New scripts: vstat.sql & dstat.sql for showing Oracle Sysmetric history with 1-minute granularity - Tanel Poder Blog Here are two scripts for showing GV$SYSMETRIC_HISTORY contents in a simple tabular way: vstat.sql - show up to one hour of current history at 1-minute granularity from memory awr/dstat.sql - show…

The view GV$SYSMETRIC_HISTORY in Oracle AI Database shows all the database metrics available

This can be useful to help troubleshoot performance issues

@tanelpoder.com has built scripts to display these with 1-minute granularity in a tabular way

28.01.2026 12:01 πŸ‘ 1 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
Transactions Aren’t Enough: The Need For End-To-End Thinking Even the strongest safety properties implemented in today’s top databases are not enough to prevent data loss or corruption in all scenarios. We have learned to rely on mechanisms such as…

The ACID properties of database transactions help keep data consistent

But these aren't enough to stop all data errors!

Failures may cause users to keep retrying and duplicating work

Arkadiusz Chmura shows how to avoid this with effectively once processing

27.01.2026 12:02 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Overview of Caching Strategies with Oracle AI Database - andersswanson.dev Recently, I’ve been exploring different caching database caching strategies with Oracle AI Database and came to the following conclusion: Choosing the right mix of caching and read-scaling options…

Caching can improve performance by bringing data closer to the client

@anders-swanson.bsky.social gives an overview of the caches in Oracle AI Database, including

Oracle True Cache
Oracle Active Data Guard
Database In-Memory
Buffer Cache
Server-Side Result Cache

26.01.2026 12:02 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0