SQL Daily
@sqldaily
Followers
26K
Following
122
Media
1K
Statuses
3K
Daily Oracle SQL tips from the Oracle Developer Advocates for SQL
Joined January 2015
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 https://t.co/k8dYUDTwwo
0
35
114
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 https://t.co/Cp2o4SflIJ
kb.databasedesignbook.com
Author: Alexey Makhotkin [email protected]. (Word count: 3200). A common problem in business-oriented database design: keeping the history of values of a certain data attribute. For example, we may...
0
2
7
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
1
6
15
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 https://t.co/L2cjHVO9i2
0
3
19
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 https://t.co/lv4ozKDyvv
blogs.oracle.com
Offload AI inference to Oracle Active Data Guard for improved scalability, cost-efficiency, and security without external APIs or added complexity. This practical walkthrough explains how to run...
0
3
16
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 https://t.co/lU91tclnDf
1
9
22
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
For more information on what’s new in Oracle Database 23.9, see: What’s new for Developers in Oracle Database 23.9 Oracle AI Database 23.26.0 brings some fantastic new features to developers—again!…
0
10
18
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>
1
6
16
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
0
5
16
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 https://t.co/ht7zpEsCIX
danischnider.wordpress.com
The data type of primary key and foreign key columns has an impact on the query performance. This should be considered in the design decision of keys in a Data Vault schema.
0
4
18
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 https://t.co/Qd9PsktLfI
mikesmithers.wordpress.com
Triggered by traumatic DML errors ? Well, here’s one flashback you won’t mind having…
0
4
15
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
0
9
21
Get free access to Oracle AI Database at https://t.co/GfUNgDcdbw This browser-based tool enables you to run and share #SQL statements Even better, you can now connect to your schema from clients on your machine using SQL*Net So you can run SQL from your favourite IDE
2
10
29
Oracle Virtual Private Database enables you to transparently add WHERE clauses to restrict what users can see See what was added with DBMS_UTILITY.EXPAND_SQL_TEXT But this may expose sensitive values! @connor_mc_d shows how to hide them with contexts https://t.co/TpK6Sq09YR
connor-mcdonald.com
Since way back in version 8.1 of the database, there has been a cool feature in Oracle called Virtual Private Database (VPD), which essentially lets you force predicates into SQL statements run by …
0
10
22
Want to find the fastest-growing tables or LOBs in Oracle AI Database? @viniciusdba has built a script that analyzes AWR data to show The 20 segments with the largest total size increases A breakdown of the increase per month for each Get it at
github.com
Some Scripts that I use on my daily basis. Contribute to vinidba/dba_scripts development by creating an account on GitHub.
0
9
30
Poorly written #SQL can lead to slow, hard-to-maintain queries Jordan Goodman covers common anti-patterns you should avoid, including Case expressions instead of tables Functions on indexed columns Overusing DISTINCT to “fix” duplicates https://t.co/DqEpZSLs42
0
7
21
Macros in Oracle #SQL enable you to define expression templates as text At parse time the database merges these with the parent query, replacing parameters with the actual values passed Macros come in two types Scalar - use in SELECT, WHERE, ORDER BY, etc. Table - use in FROM
1
7
27
Oracle wins the multilingual text-to-SQL Archer Challenge by combining planning and #SQL agents Understanding Archer queries requires Arithmetic reasoning Commonsense inference Hypotheticals and counterfactuals Bilingual execution (English + Chinese) https://t.co/WiGBmZ0hb2
blogs.oracle.com
Oracle AI wins 🥇 at the 2025 Archer NL2SQL Challenge, leading global competitors by 9+ pts in execution accuracy. Our Reasoning-based NL2SQL solution achieves English–Chinese parity and >99% SQL...
0
4
17
The KEEP clause - aka FIRST/LAST functions - in Oracle #SQL enables you to get the min/max row for one column sorted by another MIN ( sal ) KEEP ( DENSE_RANK FIRST ORDER BY hire ) => Get the lowest sal for the first hire @quanwen_zhao explores
quanwenzhao.wordpress.com
A few days ago I’ve noticed that Tim Hall have announced the fabulous Oracle community activity about writing the several blog notes on the same day that is Oct 15th this year (on the 2nd or …
1
8
22
Create a flashback archive in Oracle AI Database to record all changes to a table CREATE FLASHBACK ARCHIVE ... RETENTION ... ALTER TABLE ... FLASHBACK ARCHIVE Then view the changes with SELECT * FROM ... VERSIONS BETWEEN ... @Matt_Mulvaney demos
0
10
27
Storing UUIDs as RAW values is more efficient than strings But RAW can lead to implicit conversions => poor row estimates If you're stuck with string comparisons @Andrej_SQL shows how to improve row estimates with Extended stats Virtual columns https://t.co/9SPPa3NhmG
blog.sqlora.com
Learn how implicit RAW-to-VARCHAR2 conversions in Oracle break histograms, hurt optimizer estimates, and how to fix them safely.
0
7
19