sqldaily's profile picture. Daily Oracle SQL tips from the Oracle Developer Advocates for SQL

SQL Daily

@sqldaily

Daily Oracle SQL tips from the Oracle Developer Advocates for SQL

고정된 트윗

Want to learn a new skill in 2024? Make it #SQL! Oracle Dev Gym has a series of FREE classes to help you do this Start with Databases for Developers: Foundations Join at devgym.oracle.com/pls/apex/dg/cl…

sqldaily's tweet image. Want to learn a new skill in 2024?

Make it #SQL!

Oracle Dev Gym has a series of FREE classes to help you do this

Start with Databases for Developers: Foundations

Join at

devgym.oracle.com/pls/apex/dg/cl…

SQL Case Files Learn #SQL while tackling detective investigations Write queries to learn about suspects, uncover evidence, and close the cases Play at sqlcasefiles.com

sqldaily's tweet image. SQL Case Files

Learn #SQL while tackling detective investigations

Write queries to learn about suspects, uncover evidence, and close the cases

Play at sqlcasefiles.com

Schema annotations in Oracle AI Database enable you to add key-value metadata on Tables Views Indexes Domains These help document your objects @MartinDBA shows how to add them to view columns with ALTER VIEW ... MODIFY ( <col> ANNOTATIONS ( ... ) ) martincarstenbach.com/2025/11/24/cre…


Real-time SQL Plan Management in Oracle AI Database can Detect plan changes in #SQL queries Identify which of these plans is best Ensure future runs use the best plan @PrashantTdixit shows it in action fatdba.com/2025/11/23/how…


You can run code in the BEGIN/END block of a PL/SQL package CREATE PACKAGE BODY ... AS ... BEGIN do_stuff(); END; Take care: this only runs when initializing the package @petefinnigan shows how security checks here can fail petefinnigan.com/weblog/archive…


Access attributes of JSON data stored in Oracle AI Database Simple dot-notation - <alias>.<column>.<path>.<to><attr> JSON_VALUE ( column, '$.<path>.<to><attr>' ) Dot-notation returns NULL if it can't process the attribute, JSON_VALUE gives full control over the behaviour #SQL

sqldaily's tweet image. Access attributes of JSON data stored in Oracle AI Database

Simple dot-notation - &amp;lt;alias&amp;gt;.&amp;lt;column&amp;gt;.&amp;lt;path&amp;gt;.&amp;lt;to&amp;gt;&amp;lt;attr&amp;gt;
JSON_VALUE ( column, &apos;$.&amp;lt;path&amp;gt;.&amp;lt;to&amp;gt;&amp;lt;attr&amp;gt;&apos; )

Dot-notation returns NULL if it can&apos;t process the attribute,
JSON_VALUE gives full control over the behaviour

#SQL

Aggregate functions in #SQL report totals across many rows Common ones are COUNT, SUM, AVG, MAX, MIN Baraa Khatib Salkini explains how these work and how to use them to answer questions like How many orders are there? What's their total sales value? youtube.com/watch?v=AsuPVZ…

sqldaily's tweet card. SQL Aggregate Functions | COUNT, SUM, AVG, MAX, MIN | #SQL Course 21

youtube.com

YouTube

SQL Aggregate Functions | COUNT, SUM, AVG, MAX, MIN | #SQL Course 21


AI agents can help you build schemas and create test data Chris Hoina shares an example prompt to store data about cars, trucks, motorcycles and their manufacturers Then shows you how to use it with SQLcl MCP Server and Cline to make the tables blogs.oracle.com/database/promp…


SQL Daily 님이 재게시함

The wait is (nearly) over! Oracle AI Database 26ai EE for Linux x86-64 will be released on premises in the next RU (23.26.1), due January 2026 Read full details at blogs.oracle.com/database/oracl…


Mouhamadou Diaw examines the differences between functions & procedures in PL/SQL Functions Return a value Can be called in #SQL - DML must be in an autonomous transaction Procedures Use OUT parameters to return values Can't be called in SQL directly mouhamadoudiaw.wordpress.com/2025/11/15/ove…


Tracking changes to values over time is a common requirement For example, recording price fluctuations for goods Alexey Makhotkin steps through designing tables to store these changes, proposing template tables with Anchor Value Valid from/to dates kb.databasedesignbook.com/posts/historiz…


Change the partitioning method for an Oracle table with: ALTER TABLE ... MODIFY PARTITION BY ... This can change The partition method (RANGE/LIST/HASH) The partition columns Add/remove subpartitioning Add the ONLINE clause to allow writes to continue while changing

sqldaily's tweet image. Change the partitioning method for an Oracle table with:

ALTER TABLE ... MODIFY PARTITION BY ...

This can change

The partition method (RANGE/LIST/HASH) 
The partition columns
Add/remove subpartitioning

Add the ONLINE clause to allow writes to continue while changing

Like #SQL? Like puzzles? Try #SQuizL A free, daily guess-the-SQL statement quiz You have up to six attempts to complete the statement on the top left using the fragments below There's a new statement to guess at every day at midnight UTC Play now at devgym.oracle.com/pls/apex/f?p=1…

sqldaily's tweet image. Like #SQL?

Like puzzles?

Try #SQuizL

A free, daily guess-the-SQL statement quiz

You have up to six attempts to complete the statement on the top left using the fragments below

There&apos;s a new statement to guess at every day at midnight UTC

Play now at devgym.oracle.com/pls/apex/f?p=1…

You can run in-database AI inference on Oracle Active Data Guard @ludodba shows you how to do this to find images with semantic search Loading an ONNX model & pictures Creating PL/SQL to generate embeddings Running this proc and searches on the standby blogs.oracle.com/maa/onnx-on-ac…


When tuning #SQL, focus on the estimates for how many rows each operation will return If these are off by an order of magnitude or more, there's a good chance a different plan is faster @TanelPoder has built scripts to show misestimates in Oracle plans tanelpoder.com/posts/xb-sql-s…


Oracle AI Database 23.26.0 developer features include QUALIFY clause GraphQL Table Function for SQL SQL Objects and Collections in MLE JavaScript PL/SQL RESETTABLE clause to avoid ORA-04068: existing state of packages has been discarded @GeraldVenzl geraldonit.com/whats-new-for-…


Define schema-only accounts in Oracle AI Database with CREATE USER ... NO AUTHENTICATION => you can't connect as this user To run scripts as-if you're a schema-only account, use a proxy user ALTER USER schema_only GRANT CONNECT THROUGH proxy CONN proxy[schema_only]/<pwd>

sqldaily's tweet image. Define schema-only accounts in Oracle AI Database with

CREATE USER ... NO AUTHENTICATION

=&amp;gt; you can&apos;t connect as this user

To run scripts as-if you&apos;re a schema-only account, use a proxy user

ALTER USER schema_only GRANT CONNECT THROUGH proxy

CONN proxy[schema_only]/&amp;lt;pwd&amp;gt;

Want to find the Nth highest value in a table? e.g. the 3rd highest salary/department? Number the values with DENSE_RANK () OVER ( PARTITION BY ... ORDER BY ... DESC ) Then filter where the output of this is 3 @RebellionRider demos youtube.com/watch?v=Pg4ox7…

sqldaily's tweet card. What's The BEST Way to Find the 3rd HIGHEST Salary in SQL?

youtube.com

YouTube

What's The BEST Way to Find the 3rd HIGHEST Salary in SQL?


How do the data types of join columns affect query performance? Dani Schnider compares using Hashes as CHAR(32) and RAW(16) Sequences as NUMBER And finds in Oracle #SQL NUMBER is faster than RAW RAW is faster than CHAR danischnider.wordpress.com/2018/12/11/dat…


Triggered by traumatic DML errors? Mike Smithers shows how to recover in Oracle AI Database when you accidentally remove data with FLASHBACK TABLE ... TO BEFORE DROP => restore a dropped table TIMESTAMP => revert to a point in time mikesmithers.wordpress.com/2025/10/15/fix…


In PL/SQL EXCEPTION WHEN OTHERS THEN Catches all errors Filling your code with this without reraising the error hides unexpected issues So the compiler raises PLW-6009 to warn you If you reraise in custom logging procedures use PRAGMA SUPPRESSES_WARNING_6009 To skip this

sqldaily's tweet image. In PL/SQL

EXCEPTION WHEN OTHERS THEN

Catches all errors

Filling your code with this without reraising the error hides unexpected issues

So the compiler raises PLW-6009 to warn you

If you reraise in custom logging procedures use

PRAGMA SUPPRESSES_WARNING_6009

To skip this

Loading...

Something went wrong.


Something went wrong.