SQL Daily (@sqldaily) 's Twitter Profile
SQL Daily

@sqldaily

Daily Oracle SQL tips from the Oracle Developer Advocates for SQL

ID: 3001841930

linkhttp://blogs.oracle.com/sql calendar_today29-01-2015 17:45:15

2,2K Tweet

25,25K Takipçi

4 Takip Edilen

SQL Daily (@sqldaily) 's Twitter Profile Photo

The difference between two dates in Oracle Database is the number of days between them To see a breakdown of the units, use interval expressions: ( d1 - d2 ) day to second -> days, hours, minutes, seconds ( d1 - d2 ) year to month -> years, months

SQL Daily (@sqldaily) 's Twitter Profile Photo

To find rows matching a #SQL query, the Oracle optimizer can use ACCESS - get all of a subset of rows (usually via an index) FILTER - check a set of rows, discarding unwanted data But how does it pick which to use? Connor loves SQL , 🍸and ☕️ investigates youtube.com/watch?v=HwsRpa…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Tell #SQL stories with SQL Notebooks in Oracle SQL Developer for VS Code Show statements with their results Along with markdown blocks to describe the data SQL.ProductManager.Oracle.Databases shows thatjeffsmith.com/archive/2025/0…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Convert GeoJSON to Oracle Spatial objects and back with SDO_UTIL.FROM_GEOJSON SDO_UTIL.TO_GEOJSON This enables you to use spatial functions on JSON data e.g. to find the distance between two points

Convert GeoJSON to Oracle Spatial objects and back with

SDO_UTIL.FROM_GEOJSON
SDO_UTIL.TO_GEOJSON

This enables you to use spatial functions on JSON data

e.g. to find the distance between two points
SQL Daily (@sqldaily) 's Twitter Profile Photo

When tuning a #SQL query, a key question is Which columns are indexed? You can check this in Oracle Database by looking at the *_IND_COLUMNS views David Fitzjarrell 🟧💙 has built a script to check this and pull in other useful tuning information for a table dfitzjarrell.wordpress.com/2025/07/02/is-…

SQL Daily (@sqldaily) 's Twitter Profile Photo

You can insert rows into updatable views... ...but it's possible to add data contradicting the WHERE clause So the values seem to vanish! Stop this by adding CREATE VIEW ... AS SELECT ... WHERE ... WITH CHECK OPTION And you can only insert rows that satisfy the WHERE clause

SQL Daily (@sqldaily) 's Twitter Profile Photo

Deadlock happens when two or more transactions try to lock the same rows in a different order Usually this involves different tables David Kurtz - /*+Go-Faster*/ Consultancy 🇺🇦 shows it's possible in Oracle #SQL when two UPDATEs use different indexes to change the same rows blog.go-faster.co.uk/2025/07/deadlo…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Oracle Data Pump is the screwdriver in your toolbox for data migration A flexible, easy-to-use tool to export and import data between databases Daniel Overby Hansen runs through the basics of how this works youtube.com/watch?v=5uLDxP…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Run bit AND, OR, and XOR operations across numbers in Oracle #SQL using BIT_AND_AGG BIT_AND_AND BIT_AND_OR functions from 21c These convert numbers to binary, then do bitwise comparisons across rows 3 => 011 5 => 101 3 AND 5 => 001 => 1 3 XOR 5 => 110 => 6 3 OR 5 => 111 => 7

Run bit AND, OR, and XOR operations across numbers in Oracle #SQL using

BIT_AND_AGG
BIT_AND_AND
BIT_AND_OR

functions from 21c

These convert numbers to binary, then do bitwise comparisons across rows

3 => 011
5 => 101

3 AND 5 => 001 => 1
3 XOR 5 => 110 => 6
3 OR 5 => 111 => 7
SQL Daily (@sqldaily) 's Twitter Profile Photo

Users often want tailored reports from their database; requests to customize these can morph the system into #SQL Injection As A Service Ibrahim Diallo charts the story of one such system leading to a user deleting key data idiallo.com/blog/sql-injec… Keep your data safe folks!

SQL Daily (@sqldaily) 's Twitter Profile Photo

The #database is free to run parts of a SQL WHERE clause in any order So how do you stop errors if you know an expression may throw one e.g. the square root of negative numbers? Use CASE to only run it on valid values WHERE CASE WHEN col > 0 THEN sqrt ( col ) ELSE ... END ...

SQL Daily (@sqldaily) 's Twitter Profile Photo

#JSON relational duality views in Oracle Database 23ai are a flexible, performant, and consistent way to access data as Documents Relational tables Both! Anders Swanson shows you how to build basic duality views to do this andersswanson.dev/2025/07/14/7-r…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Multifactor Authentication for users in Oracle Database is here in the July 2025 RU for 19c and 23ai Enable it when logging in with a username/password via tools like SQLcl with ALTER USER <user> ADD FACTOR 'oma_push' AS '<email>' Alan Williams explains blogs.oracle.com/database/post/…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Manipulate #JSON in PL/SQL with the object types added in 12.2 JSON_ELEMENT_T JSON_SCALAR_T JSON_OBJECT_T JSON_ARRAY_T With functions to get, put, and remove you can fetch, add, and delete values from JSON objects and arrays

Manipulate #JSON in PL/SQL with the object types added in 12.2

JSON_ELEMENT_T
JSON_SCALAR_T
JSON_OBJECT_T
JSON_ARRAY_T

With functions to get, put, and remove you can fetch, add, and delete values from JSON objects and arrays
SQL Daily (@sqldaily) 's Twitter Profile Photo

Rolling dice determines the outcome of attacks in D&D So knowing the roll result distribution helps you decide what to do This needs to account for advantage, disadvantage, and luck Sean D. Stuber Sean D. Stuber shows you how to do this in Oracle #SQL seanstuber.com/2025/07/29/usi…

SQL Daily (@sqldaily) 's Twitter Profile Photo

Create many tables in one Oracle DDL statement with CREATE SCHEMA AUTHORIZATION <usr> CREATE TABLE ... CREATE TABLE ... This can also create views and grant access to these objects You must be connected as the <usr> in the AUTHORIZATION clause

SQL Daily (@sqldaily) 's Twitter Profile Photo

Save space in indexes when the leading columns have duplicates with ALTER INDEX ... REBUILD COMPRESS n => deduplicate the first N columns But what is the best value of N? David Kurtz finds it with ANALYZE INDEX … VALIDATE STRUCTURE CASCADE blog.psftdba.com/2025/07/optima…

SQL Daily (@sqldaily) 's Twitter Profile Photo

MCP servers enable you to talk to your database via an LLM Create one for Oracle Database using SQLcl krisrice 🏒🍺📷 and SQL.ProductManager.Oracle.Databases show you how blogs.oracle.com/database/post/… This can run #SQL on your behalf to answer questions - ensure you restrict what it has access to!

SQL Daily (@sqldaily) 's Twitter Profile Photo

Oracle Database enhanced the set operators in release 21c to include INTERSECT ALL => rows in both tables, including duplicates [ MINUS | EXCEPT ] ALL => rows only in the first table, accounting for duplicates Without the ALL clause, these de-duplicate values

Oracle Database enhanced the set operators in release 21c to include

INTERSECT ALL =&gt; rows in both tables, including duplicates
[ MINUS | EXCEPT ] ALL =&gt; rows only in the first table, accounting for duplicates

Without the ALL clause, these de-duplicate values
SQL Daily (@sqldaily) 's Twitter Profile Photo

Database normalization is the process of designing tables to make certain types of data errors impossible This uses normal forms from one to five to remove potential anomalies Learn how to implement them with this video from Decomplexify youtu.be/GFQaEYEc8_8