By Vinish Kapoor
Oracle SQL Tutorials
Every Oracle SQL tutorial on vinish.dev: queries and joins, grouping and analytic functions, tables and indexes, JSON and XML, and 210+ SQL function guides, organized so you can find the one you need in seconds.
- 398 tutorials
- 23 topics
- 4 learning paths
- Updated October 2026
Browse by topic
- SQL Basics & DML20
- SQL Developer, SQLcl & SQL*Plus6
- Fixing SQL Errors (ORA-)41
- Grouping & Aggregation6
- Subqueries, CTEs & Hierarchies9
- Joins & Query Recipes14
- Analytic (Window) Functions12
- PIVOT, MATCH_RECOGNIZE & Advanced SQL8
- Tables, Constraints & Partitioning20
- Indexes, Views & Materialized Views11
- Performance & Execution Plans14
- Transactions, Locking & Flashback6
- Users, Privileges & Data Dictionary8
- JSON in SQL17
- XML Functions11
- String Functions29
- Numeric Functions27
- Date & Time Functions35
- Conversion Functions43
- Aggregate & Statistical Functions24
- NULL, Comparison & Other Functions25
- Machine Learning in SQL9
- Interview Prep & Books3
Learning paths
Ordered series you can follow from the first lesson to the last. Your progress is saved in this browser.
Beginner · 15 lessons
SQL Essentials
Create a table, then query, change, and join data, step by step.
·
- How to Create a Table in Oracle 23ai
- Understanding Data Types in Oracle Database 23ai
- How to Insert Data into a Table in Oracle 23ai
- How to Use SELECT Queries in Oracle Database 23ai
- How to Use WHERE Clause in Oracle Database 23ai Queries
- How to Use ORDER BY in Oracle Database 23ai Queries
- How to Use GROUP BY in Oracle Database 23ai
- Using UPDATE Statement in Oracle Database 23ai
- Using DELETE Statement in Oracle Database 23ai
- Using MERGE Statement in Oracle Database 23ai
- Oracle SQL INNER JOIN: Complete Guide to Matching Records Between Tables
- Oracle SQL Query to Use LEFT OUTER JOIN to Include All Records from Left Table
- Oracle SQL Query to Use Full Outer Join for Data Reconciliation
- Oracle SQL Query to Use EXPLAIN PLAN for Join Analysis
- Synonym in Oracle Database
Tip: Ctrl-click a lesson to open it in a new tab. It still counts toward your progress.
Intermediate · 18 lessons
Beyond the Basics
Grouping and subtotals, subqueries and CTEs, hierarchies, window functions, PIVOT, and pattern matching.
·
- How to Filter Groups with HAVING in Oracle SQL
- How to Add Subtotals with ROLLUP in Oracle SQL
- How to Summarize Every Combination with CUBE in Oracle SQL
- How to Use GROUPING SETS in Oracle SQL
- How to Use Subqueries in Oracle SQL
- How to Write Correlated Subqueries in Oracle SQL
- How to Use Set Operators in Oracle SQL
- How to Use the WITH Clause in Oracle SQL
- How to Write Recursive Queries with Recursive WITH in Oracle
- How to Query Hierarchies with CONNECT BY in Oracle
- How to Write Semi-Joins with EXISTS in Oracle
- How to Use LATERAL Inline Views with CROSS APPLY in Oracle
- How to Define Window Frames in Oracle Analytic Queries
- How to Filter Analytic Results with QUALIFY in Oracle
- How to Pivot Rows into Columns with PIVOT in Oracle
- How to Turn Columns into Rows with UNPIVOT in Oracle
- How to Find Row Patterns with MATCH_RECOGNIZE in Oracle
- How to Do Spreadsheet Calculations with the MODEL Clause
Tip: Ctrl-click a lesson to open it in a new tab. It still counts toward your progress.
Beginner · 19 lessons
Most-Used SQL Functions
The functions you will reach for every day: dates, text, numbers, NULL handling, and conversions.
·
- Oracle TO_CHAR (Date) Function: A Simple Guide to Formatting Dates
- Oracle TO_DATE Function: A Simple Guide to Converting Strings to Dates
- Oracle SYSDATE Function: A Simple Guide
- Oracle ADD_MONTHS Function: A Simple Guide
- Oracle MONTHS_BETWEEN Function: A Simple Guide
- Oracle TRUNC (Date) Function: A Simple Guide
- Oracle SUBSTR Function: A Simple Guide
- Oracle INSTR Function: A Simple Guide to Finding Substrings
- Oracle REPLACE Function: A Simple Guide
- Oracle TRIM Function: A Simple Guide
- Oracle REGEXP_REPLACE Function: A Simple Guide
- Oracle ROUND Function (Number): A Simple Guide
- Oracle NVL Function: A Simple Guide
- Oracle COALESCE Function: A Simple Guide
- Oracle DECODE Function: A Simple Guide
- Oracle TO_NUMBER Function: A Simple Guide
- Oracle CAST Function: A Simple Guide
- Oracle JSON_VALUE Function
- Oracle JSON_TABLE Function
Tip: Ctrl-click a lesson to open it in a new tab. It still counts toward your progress.
Practical · 12 lessons
SQL Query Recipes
Analytics patterns you can reuse: running totals, cohorts, churn, gaps and islands.
·
- Oracle SQL Query to Calculate Business Days Excluding Holidays
- Oracle SQL Query to Find Overlapping Date Ranges
- Oracle SQL Query to Implement Cohort Analysis for Customer Retention
- Oracle SQL Query to Identify and Handle Duplicate Records
- Oracle SQL Query to Parse and Extract JSON Data with JSON_TABLE
- Oracle SQL Query to Calculate Churn Rate and Retention Metrics
- Oracle SQL Query to Perform ABC Analysis for Inventory Management
- Oracle SQL Query to Calculate Running Totals
- Oracle SQL Query to Find Gaps and Islands in Sequential Data
- Oracle SQL Query to Use LISTAGG for String Aggregation
- How to Convert Oracle Database Tables to JSON Format
- Oracle SQL Query to Implement Lead/Lag Analysis for Time Series Data
Tip: Ctrl-click a lesson to open it in a new tab. It still counts toward your progress.
Latest tutorials
- Performance & Execution Plans
How to Use Direct-Path INSERT in Oracle
- Performance & Execution Plans
How to Reduce Hard Parsing with Bind Variables
- Performance & Execution Plans
How Bind Variables Affect Execution Plans: Bind Peeking and Adaptive Cursor Sharing
- Performance & Execution Plans
How to Use Optimizer Hints in Oracle
- Performance & Execution Plans
How to Use Extended Statistics for Correlated Columns in Oracle
- Performance & Execution Plans
How to Find and Fix Stale Statistics in Oracle
- Performance & Execution Plans
How to Use Histograms for Skewed Data in Oracle
- Performance & Execution Plans
How to Find Unused Indexes with DBA_INDEX_USAGE
Books & free tools
Go deeper with the books, or try the free tools.
- Book
Oracle Database 26ai SQL and PL/SQL
700 pages, 66 chapters, 677 examples with their real output, from first query to production PL/SQL.
- Free tool
SQL Formatter
Format and beautify SQL instantly in your browser, for Oracle, MySQL, PostgreSQL, T-SQL, and more.
- Free tool
CSV to SQL Insert Converter
Convert CSV data into SQL INSERT statements for Oracle, MySQL, PostgreSQL, or SQLite, with customization options.
- Free tool
Oracle SQL Script Browser
Explore SQL script files, extract the database objects in them, and view them in an interactive Oracle code viewer.
- Roadmap
Oracle Database Learning Roadmap
A structured path from SQL basics to advanced PL/SQL and database features. Tick off topics as you go.
- Book
AI Applications with Oracle Database 26ai and APEX 26.1
409 pages, 29 chapters, 237 examples: vectors, semantic search, RAG, and LLM calls from SQL and PL/SQL.
All tutorials by topic
SQL Basics & DML 20
Create tables, query with SELECT and WHERE, sort and group, and change data with INSERT, UPDATE, DELETE, and MERGE.
How to Create a Table in Oracle 23ai
Creating tables is the foundation of database development in Oracle. A table defines how your data will be structured, stored, and managed. In Oracle Database 23ai, the…
Understanding Data Types in Oracle Database 23ai
Every value stored in an Oracle Database must follow a data type. A data type defines what kind of data can be stored, how much space it takes, and what operations you…
How to Insert Data into a Table in Oracle 23ai
When you start working with Oracle Database 23ai, one of the first things you need to learn is how to add data into your tables. Inserting data is a basic yet powerful…
How to Use SELECT Queries in Oracle Database 23ai
Working with a database is all about getting useful information out of it. Oracle Database 23ai gives you a powerful way to do this with the SELECT statement. This…
How to Use WHERE Clause in Oracle Database 23ai Queries
The WHERE clause tells Oracle which rows to keep and which to skip. This tutorial shows practical ways to filter data using comparisons, ranges, pattern matching, NULL…
How to Use ORDER BY in Oracle Database 23ai Queries
The ORDER BY clause in Oracle Database 23ai lets you sort the rows returned by a query. Without it, the database can return results in any order. ORDER BY helps you…
How to Use GROUP BY in Oracle Database 23ai
The GROUP BY clause in Oracle Database 23ai is used when you want to organize rows into groups and then apply aggregate functions such as COUNT, SUM, AVG, MIN, or MAX.…
Using UPDATE Statement in Oracle Database 23ai
The UPDATE statement in Oracle Database 23ai is used to change existing data in a table. Instead of inserting new rows, UPDATE helps you adjust or fix information that…
Using DELETE Statement in Oracle Database 23ai
The DELETE statement in Oracle Database 23ai is used to remove existing rows from a table. Unlike DROP TABLE, which removes the entire table, DELETE only takes away…
Using MERGE Statement in Oracle Database 23ai
The MERGE statement in Oracle Database is a powerful command that combines the functionality of both INSERT and UPDATE. Instead of writing separate SQL commands, MERGE…
Synonym in Oracle Database
If you work with multiple schemas or long object names, synonyms in Oracle Database can make your SQL cleaner and your apps easier to maintain. A synonym is a friendly…
Oracle Create Table Examples
In Oracle SQL, the CREATE TABLE statement is used to define a new table in the database. A table consists of rows and columns, where each column has a specific data type…
CREATE TABLE in Oracle with Auto Increment ID
If you have worked with MySQL or SQL Server, you are probably used to AUTO_INCREMENT or IDENTITY columns that generate unique IDs automatically. Oracle does things a…
How NULL Works in Oracle Conditions
Learn why comparisons with NULL are unknown, how that drops rows from results, and how to avoid the NOT IN trap and other NULL surprises.
How to Use Pseudocolumns in Oracle
Learn what ROWNUM, ROWID, ORA_ROWSCN, and COLUMN_VALUE return, why ROWNUM is assigned before ORDER BY, and when to use FETCH instead.
Oracle Boolean Literals and Expressions in SQL
Store TRUE and FALSE in BOOLEAN columns, select conditions as values, and group, sort, and test BOOLEAN data safely with IS TRUE.
How to Use Multitable INSERT ALL in Oracle
Route the rows of one query into several tables in a single statement with INSERT ALL and INSERT FIRST, with conditions or without.
How to Use Direct-Path INSERT in Oracle
Speed up bulk loads and archiving with direct-path INSERT and the APPEND hint, and confirm the load path with LOAD AS SELECT in the plan.
How to Log DML Errors in Oracle
Keep a bulk INSERT or UPDATE going when some rows fail: log the bad rows to an error table with LOG ERRORS and load the rest.
How to Use RETURNING OLD in Oracle DML
Get the values before and after an update in the same statement with RETURNING OLD and NEW, for a single row or many with BULK COLLECT.
SQL Developer, SQLcl & SQL*Plus 6
Set up and use Oracle's SQL tools: SQL Developer, SQLcl formatting and aliases, and SQL*Plus reports.
Oracle SQL Developer Guide
If you work with Oracle databases, you need a reliable tool that makes querying, building, and managing your data feel effortless. Oracle SQL Developer is exactly that…
How to Format Query Output in SQLcl (SET SQLFORMAT)
Turn any query into CSV, JSON, INSERT statements, or delimited text in SQLcl with one SET SQLFORMAT command.
How to Create Command Aliases in SQLcl
Give frequent queries short names in SQLcl, pass arguments to their bind variables, and keep them across sessions.
How to Set Up login.sql for SQLcl
Make every SQLcl and SQL*Plus session start with your settings: output format, NLS formats, time zone, and server output.
How to Use Substitution Variables in SQL*Plus
Reuse scripts with different values through DEFINE, ampersand references, and variables filled from query results.
How to Format Reports with COLUMN in SQL*Plus (BREAK, COMPUTE)
Turn a query into a readable report with column headings and formats, grouped rows, and subtotals, without changing the SQL.
Fixing SQL Errors (ORA-) 41
What the common ORA- errors in SQL mean and how to fix them, from ORA-00001 to ORA-30926, with tested examples.
How to Fix ORA-00001: Unique Constraint Violated in Oracle
Find which constraint, column, and value caused ORA-00001, and load data without duplicates using MERGE or NOT EXISTS.
How to Fix ORA-00054: Resource Busy and Acquire with NOWAIT Specified or Timeout Expired in Oracle
Reproduce the lock conflict with two sessions, and fix it with WAIT, SKIP LOCKED, DDL_LOCK_TIMEOUT, or by ending the blocking transaction.
How to Fix ORA-00904: Invalid Identifier in Oracle
Find the name Oracle cannot resolve in ORA-00904 and fix typos, case-sensitive quoted columns, and misplaced aliases.
How to Fix ORA-00907: Missing Right Parenthesis in Oracle
Use the error position to find where Oracle expected a closing parenthesis, and fix unbalanced lists and subqueries.
How to Fix ORA-00911: Invalid Character in Oracle
Find the character behind ORA-00911, often syntax from MySQL or JDBC, and rewrite it the Oracle way.
How to Fix ORA-00913: Too Many Values in Oracle
Count the values and columns in INSERT statements and subquery comparisons, and fix ORA-00913 when there are too many.
How to Fix ORA-00917: Missing Comma in Oracle
Find the missing comma in an INSERT column list or VALUES list from the position in the ORA-00917 error.
How to Fix ORA-00918: Column Ambiguously Defined in Oracle
Tell Oracle which table a shared column name belongs to, with table aliases or a join with USING, and fix ORA-00918.
How to Fix ORA-00923: FROM Keyword Not Found Where Expected in Oracle
Find what ended the select list too early in ORA-00923: a missing comma, a reserved word as alias, or SELECT TOP.
How to Fix ORA-00932: Inconsistent Datatypes in Oracle
Make data types agree in comparisons, CASE branches, and NVL calls, and fix ORA-00932 with explicit conversions.
How to Fix ORA-00933: SQL Command Not Properly Ended in Oracle
Fix statements Oracle reads as finished too early, and understand the ORA-03048 and ORA-03049 messages 26ai shows instead.
How to Fix ORA-00934: Group Function Is Not Allowed Here in Oracle
Move conditions on SUM, AVG, or COUNT out of WHERE and into HAVING or a subquery, and fix ORA-00934.
How to Fix ORA-00936: Missing Expression in Oracle
Find where Oracle expected a value or column in ORA-00936: trailing commas, empty lists, and comparisons with no right side.
How to Fix ORA-00937: Not a Single-Group Group Function in Oracle
Fix queries that mix SUM or COUNT with plain columns and no GROUP BY, by grouping, dropping the column, or using OVER ().
How to Fix ORA-00942: Table or View Does Not Exist in Oracle
Find out why Oracle cannot see a table in ORA-00942: wrong schema, missing grant, quoted name, or a dropped object.
How to Fix ORA-00947: Not Enough Values in Oracle
Match the number of values to the number of columns in INSERT statements, and let unlisted columns take their defaults.
How to Fix ORA-00955: Name Is Already Used by an Existing Object in Oracle
Find which object already has the name, and make install scripts repeatable with IF NOT EXISTS and OR REPLACE.
How to Fix ORA-00979: Not a GROUP BY Expression in Oracle
Fix grouped queries that use a column outside GROUP BY, by grouping by it or aggregating it, as the 26ai message suggests.
How to Fix ORA-00984: Column Not Allowed Here in Oracle
Fix INSERT statements where unquoted text or a column name sits in the VALUES list, and copy values with INSERT SELECT.
How to Fix ORA-01002: Fetch Out of Sequence in Oracle
See why committing inside a FOR UPDATE cursor loop breaks the next fetch, and how to commit after the loop or chunk the work.
How to Fix ORA-01031: Insufficient Privileges in Oracle
Find which system privileges the session really has, and grant the missing one, directly when views or PL/SQL need it.
How to Fix ORA-01400: Cannot Insert NULL in Oracle
Find the NOT NULL column named in ORA-01400 and fix the INSERT, or let DEFAULT ON NULL fill missing and NULL values.
How to Fix ORA-01407: Cannot Update to NULL in Oracle
Find where the NULL in an UPDATE comes from, and keep the old value or skip rows so NOT NULL columns stay filled.
How to Fix ORA-01427: Single-Row Subquery Returns More Than One Row in Oracle
Fix subqueries that return more rows than = expects: pick the row you mean, aggregate, or switch to IN or a join.
How to Fix ORA-01438: Value Larger Than Specified Precision in Oracle
Understand how NUMBER precision and scale limit digits, why some values round silently, and how to fix ORA-01438.
How to Fix ORA-01439: Column to Be Modified Must Be Empty to Change Datatype in Oracle
Change the data type of a column that already holds data, by adding a new column, copying, dropping, and renaming.
How to Fix ORA-01476: Divisor Is Equal to Zero in Oracle
Protect ratios and percentages from zero divisors with NULLIF or CASE, and decide what the result should be.
How to Fix ORA-01722: Invalid Number in Oracle
Find the value behind ORA-01722, avoid implicit conversions, and convert text to numbers safely in Oracle SQL.
How to Fix ORA-01779: Cannot Modify a Column Which Maps to a Non Key-Preserved Table in Oracle
Understand key-preserved tables in join views, see how Oracle AI Database 26ai behaves, and update the right table.
How to Fix ORA-01789: Query Block Has Incorrect Number of Result Columns in Oracle
Give every branch of a UNION or MINUS the same number of columns, filling gaps with NULL, and fix ORA-01789.
How to Fix ORA-01790: Expression Must Have Same Datatype as Corresponding Expression in Oracle
Make every branch of a UNION, INTERSECT, or MINUS return the same data type in each column, NULL placeholders included.
How to Fix ORA-01830: Date Format Picture Ends Before Converting Entire Input String in Oracle
Fix TO_DATE calls whose input carries more than the format describes, usually a time, by extending the format or cutting the string.
How to Fix ORA-01843: Not a Valid Month in Oracle
Fix TO_DATE calls where the month is invalid: swapped day and month, months above 12, and month names in another language.
How to Fix ORA-01858: A Non-Numeric Character Was Found Where a Numeric Was Expected in Oracle
Fix TO_DATE strings with letters where the format expects digits, and convert dirty data safely with a default.
How to Fix ORA-01861: Literal Does Not Match Format String in Oracle
Line up date strings with their format models, handle ISO timestamps and FX, and stop comparing dates with strings.
How to Fix ORA-02291: Integrity Constraint Violated - Parent Key Not Found in Oracle
Fix child rows that point to missing parents: insert in the right order, find orphans first, or defer the foreign key.
How to Fix ORA-02292: Integrity Constraint Violated - Child Record Found in Oracle
Delete a parent row that still has children: remove the children first, or let ON DELETE CASCADE or SET NULL handle them.
How to Fix ORA-02449: Unique/Primary Keys in Table Referenced by Foreign Keys in Oracle
Find which tables still reference a table before dropping it, and drop it safely or with CASCADE CONSTRAINTS.
How to Fix ORA-08002: Sequence CURRVAL Is Not Yet Defined in This Session in Oracle
Understand why CURRVAL belongs to the session, call NEXTVAL first, and capture generated keys with RETURNING INTO.
How to Fix ORA-12899: Value Too Large for Column in Oracle
Read the actual and maximum lengths in ORA-12899, see why accented text needs more bytes, and size columns in characters.
How to Fix ORA-30926: Unable to Get a Stable Set of Rows in the Source Tables in Oracle
Fix MERGE statements whose source has duplicate keys, by reducing the source to one row per target row before merging.
Grouping & Aggregation 6
HAVING, ROLLUP, CUBE, GROUPING SETS, the FILTER clause, and KEEP FIRST/LAST.
How to Filter Groups with HAVING in Oracle SQL
Keep only the groups you need by filtering on counts, sums, and other aggregates, and learn when a condition belongs in WHERE instead.
How to Add Subtotals with ROLLUP in Oracle SQL
Compute detail rows, subtotals, and a grand total in one grouped query with ROLLUP, and learn how to read, sort, and label the extra rows.
How to Summarize Every Combination with CUBE in Oracle SQL
Get detail rows, totals for every dimension, and a grand total in one query with CUBE, then filter or label the total rows with GROUPING_ID.
How to Use GROUPING SETS in Oracle SQL
List exactly the groupings you need in one query, replace UNION ALL chains, and identify subtotal rows with GROUPING, GROUPING_ID, and GROUP_ID.
How to Filter Aggregates with the FILTER Clause in Oracle
Compute several counts and totals over different subsets of rows in one query with FILTER (WHERE ...), instead of CASE inside aggregates.
How to Use KEEP FIRST in Oracle Aggregates
Get values from the first or last row of each group, such as the earliest hire's salary, with KEEP (DENSE_RANK FIRST ORDER BY ...).
Subqueries, CTEs & Hierarchies 9
Subqueries, EXISTS, set operators, the WITH clause, recursive queries, and CONNECT BY.
How to Use Subqueries in Oracle SQL
Nest one query inside another to supply a value, a list, pairs of values, or a whole table, and avoid ORA-01427 and the NOT IN trap.
How to Write Correlated Subqueries in Oracle SQL
Compare every row with its own group, compute per-row values in the select list, and see the analytic alternative to a correlated subquery.
How to Use Set Operators in Oracle SQL
Stack, intersect, and subtract query results with UNION, INTERSECT, MINUS, and EXCEPT, including the duplicate-counting ALL versions.
How to Write Semi-Joins with EXISTS in Oracle
Find rows that have a match, or none, with EXISTS and NOT EXISTS, without the duplicates of a join or the NULL trap of NOT IN.
How to Use LATERAL Inline Views with CROSS APPLY in Oracle
Run a subquery once for each row with LATERAL, CROSS APPLY, and OUTER APPLY to get top N per row and several columns per row.
How to Use the WITH Clause in Oracle SQL
Name subqueries at the top of a statement so long queries read step by step, chain common table expressions, and reuse them.
How to Write Recursive Queries with Recursive WITH in Oracle
Walk hierarchies and networks to any depth with a recursive common table expression, order the rows with SEARCH, and stop loops with CYCLE.
How to Define PL/SQL Functions in the WITH Clause
Use procedural logic in a single query without creating stored functions, run it in SQLcl, and call it from UPDATE with the WITH_PLSQL hint.
How to Query Hierarchies with CONNECT BY in Oracle
Walk trees down and up with START WITH and CONNECT BY, show paths, roots, and leaves, prune branches, and handle loops with NOCYCLE.
Joins & Query Recipes 14
Joins and analytics recipes: running totals, cohorts, gaps and islands, and business days.
Oracle SQL INNER JOIN: Complete Guide to Matching Records Between Tables
Have you ever wondered how to efficiently retrieve data that exists in multiple related tables within your Oracle database? The INNER JOIN operation stands as one of the…
Oracle SQL Query to Use LEFT OUTER JOIN to Include All Records from Left Table
Are you finding it challenging to retrieve all records from your primary table while still including related data from secondary tables, even when no matches exist? The…
Oracle SQL Query to Use Full Outer Join for Data Reconciliation
Are you struggling to identify discrepancies and missing records when comparing data between different systems or databases? The FULL OUTER JOIN operation in Oracle SQL…
Oracle SQL Query to Calculate Business Days Excluding Holidays
How do you accurately calculate the number of working days between two dates while accounting for weekends and company holidays in Oracle SQL? This fundamental business…
Oracle SQL Query to Find Overlapping Date Ranges
Have you ever wondered how to identify when two or more date ranges overlap in your Oracle database? Whether you're managing employee schedules, booking systems, or…
Oracle SQL Query to Implement Cohort Analysis for Customer Retention
How do you measure customer loyalty and retention patterns across different time periods using Oracle SQL? Cohort analysis represents one of the most powerful techniques…
Oracle SQL Query to Identify and Handle Duplicate Records
Have you ever discovered that your database contains multiple identical records, causing data integrity issues and skewing your business reports? Duplicate records…
Oracle SQL Query to Calculate Churn Rate and Retention Metrics
Customer churn represents one of the most critical metrics for subscription-based businesses, SaaS companies, and any organization focused on customer retention.…
Oracle SQL Query to Perform ABC Analysis for Inventory Management
Inventory management often feels like solving a complex puzzle where you need to identify which products deserve your maximum attention and resources. ABC analysis…
Oracle SQL Query to Calculate Running Totals
Running totals, also known as cumulative sums, are essential for financial reporting, inventory tracking, and data analysis tasks where you need to see accumulated…
Oracle SQL Query to Find Gaps and Islands in Sequential Data
What exactly are gaps and islands when working with sequential data in Oracle databases? Gaps and islands represent a fundamental pattern recognition problem in SQL…
Oracle SQL Query to Use LISTAGG for String Aggregation
Have you ever needed to combine multiple row values into a single concatenated string in Oracle SQL? String aggregation is a common requirement in database reporting…
Oracle SQL Query to Implement Lead/Lag Analysis for Time Series Data
The LEAD and LAG analytical functions in Oracle SQL provide powerful capabilities for accessing data from subsequent or preceding rows within the same result set without…
How to Fill Gaps with Partitioned Outer Joins in Oracle
Densify sparse data so every group gets every month or category, by adding PARTITION BY to the sparse side of an outer join.
Analytic (Window) Functions 12
Window frames, QUALIFY, ROW_NUMBER, RANK, NTILE, FIRST_VALUE, and the other analytic functions.
How to Define Window Frames in Oracle Analytic Queries
Control which rows an analytic function sees with PARTITION BY and ROWS, RANGE, or GROUPS frames, and reuse windows with the WINDOW clause.
How to Filter Analytic Results with QUALIFY in Oracle
Filter rows on ROW_NUMBER, RANK, and other analytic results in one query block with QUALIFY, new in Oracle AI Database 26ai.
Oracle CUME_DIST Function
Find what fraction of each group falls at or below every row with CUME_DIST, and select the top or bottom percent of the rows.
Oracle DENSE_RANK Function
Rank rows without gaps after ties with DENSE_RANK, and use it to find the second- or Nth-highest distinct value in each group.
Oracle FIRST_VALUE Function
Show the value from the first row of each group on every row with FIRST_VALUE, and compare each row with its group's starting value.
Oracle LAST_VALUE Function
Get the value from the last row of each group with LAST_VALUE, and avoid the default frame that makes it return the current row instead.
Oracle NTH_VALUE Function
Get the value from any position in a window, such as the second hire or the second most recent row, counting from the first or the last.
Oracle NTILE Function
Divide ordered rows into quartiles, deciles, or any number of equal-sized buckets with NTILE, and describe the range of each bucket.
Oracle PERCENT_RANK Function
Express each row's position as a fraction from 0 to 1 within its group, and compare relative standing across groups of any size.
Oracle RANK Function
Rank rows like places in a competition, where ties share a place and the next place skips, overall or within each group.
Oracle RATIO_TO_REPORT Function
Compute each value's share of the total, such as revenue by payment method, overall or within groups, in one analytic function.
Oracle ROW_NUMBER Function
Number the rows of each group with ROW_NUMBER for top-N-per-group queries and deduplication, and make the numbering repeatable.
PIVOT, MATCH_RECOGNIZE & Advanced SQL 8
PIVOT and UNPIVOT, pattern matching, the MODEL clause, property graphs, and JavaScript in SQL.
How to Pivot Rows into Columns with PIVOT in Oracle
Build cross-tab reports in one query with PIVOT, compute several aggregates, control the grouping, and avoid ORA-56902 when rounding.
How to Turn Columns into Rows with UNPIVOT in Oracle
Turn side-by-side columns into rows with UNPIVOT, replace UNION ALL chains, keep NULLs when you need them, and unpivot column groups.
How to Find Row Patterns with MATCH_RECOGNIZE in Oracle
Find runs, V shapes, and other sequences in ordered rows with MATCH_RECOGNIZE, using PATTERN, DEFINE, MEASURES, and AFTER MATCH SKIP.
How to Do Spreadsheet Calculations with the MODEL Clause
Treat query results as arrays of cells and compute projections with spreadsheet-like rules, using UPSERT, CV, PRESENTV, and ITERATE.
How to Sample Rows with the SAMPLE Clause in Oracle
Read a random percentage of a table's rows for quick estimates or test data, make samples repeatable with SEED, and choose row or block sampling.
How to Query Property Graphs with SQL/PGQ in Oracle
Define vertices and edges over existing tables and query connections with GRAPH_TABLE patterns, either direction, and variable-length paths.
How to Run JavaScript in Oracle with MLE Modules
Run JavaScript inside the database: store it in an MLE module and call its exported functions from SQL and PL/SQL like ordinary functions.
How to Create Inline JavaScript Functions in Oracle
Write short JavaScript functions directly in CREATE FUNCTION with MLE, call them from SQL, and know when a full module is the better choice.
Tables, Constraints & Partitioning 20
Identity and virtual columns, constraints, domains, special table types, and partitioning.
How to Create Identity Columns in Oracle
Generate surrogate keys automatically with identity columns, choose between ALWAYS and BY DEFAULT, and restart after loading data.
How to Create Virtual Columns in Oracle
Define computed values such as a fare with tax once in the table with virtual columns, which take no space and can be indexed.
How to Use Invisible Columns in Oracle
Add columns that SELECT * and INSERT without a column list ignore, so existing code keeps working, and reorder columns along the way.
How to Use Sequences as Column Defaults in Oracle
Fill keys from a sequence with DEFAULT sequence.NEXTVAL, share one series of numbers across tables, and set sequence options.
How to Use Deferrable Constraints in Oracle
Check constraints at commit instead of after each statement, so rows that reference each other or swap values can be saved together.
How to Use Foreign Key ON DELETE Actions in Oracle
Decide what happens to child rows when their parent is deleted: refuse the delete, cascade it, or keep the children and clear the reference.
How to Create Domains in Oracle
Define phone numbers, e-mail addresses, and other kinds of values once with data use case domains, and reuse them in many columns.
How to Use Enumeration Domains in Oracle
Replace code columns and CHECK constraints with enumeration domains: named values that columns accept and SQL refers to by name.
How to Create Assertions in Oracle 26ai
Declare rules that span several rows or tables with CREATE ASSERTION, checked by Oracle on every change, without triggers.
How to Add Annotations to Oracle Tables
Store display labels, units, owners, and other metadata on tables and columns as annotations that any application or tool can read.
How to Use IF NOT EXISTS in Oracle DDL
Make installation scripts safe to run twice with CREATE ... IF NOT EXISTS and DROP ... IF EXISTS, without PL/SQL checks around DDL.
How to Use Private Temporary Tables in Oracle
Create tables that exist only in your session and vanish by themselves, without committing the transaction, and compare them with GTTs.
How to Create External Tables in Oracle
Query CSV and other files on the database server as tables without loading them, with an external table or an inline EXTERNAL clause.
How to Create Index-Organized Tables in Oracle
Store rows inside the primary key index with ORGANIZATION INDEX for fast key lookups and range scans, and know when an IOT fits.
How to Partition Tables by Range in Oracle
Store each month of a large table in its own partition with range and interval partitioning, and read only the partitions a query needs.
How to Partition Tables by List in Oracle
Divide tables by region or type with list partitioning, spread rows evenly with hash partitioning, and handle values that fit no list.
How to Maintain Partitions in Oracle
Split, truncate, drop, merge, and exchange single partitions of large tables, and address them by name or with PARTITION FOR.
How to Create Immutable Tables in Oracle
Protect audit and compliance data with insert-only immutable tables that refuse updates and delay deletes and drops by retention periods.
How to Create Blockchain Tables in Oracle
Keep provably unaltered records with insert-only blockchain tables, whose rows are chained by cryptographic hashes in hidden columns.
How to Restore Dropped Tables from the Recycle Bin in Oracle
Bring back a dropped table from the recycle bin, restore it under a new name, and rewind a table's rows after a wrong DELETE or UPDATE.
Indexes, Views & Materialized Views 11
Composite, function-based and bitmap indexes, views, and materialized views with refresh and rewrite.
How to Create Composite Indexes in Oracle
Index several columns together, enforce unique combinations such as one ticket per seat, and order the columns the way queries filter.
How to Create Function-Based Indexes in Oracle
Index expressions such as UPPER(last_name) or JSON paths so queries that filter on them use an index, and learn when they do not.
How to Use Bitmap Indexes in Oracle
Index low-cardinality columns such as status or cabin with tiny bitmap indexes for fast counts, and avoid them on busy transactional tables.
How to Use Reverse-Key Indexes in Oracle
Spread sequential keys across the index with REVERSE to reduce insert contention, and store columns in descending order for mixed sorts.
How to Use Invisible Indexes in Oracle
Test a new index in one session, or see what dropping an index would do, with invisible indexes that the optimizer ignores by default.
How to Index Partitioned Tables in Oracle
Choose between local and global indexes on partitioned tables, and keep global indexes usable when partitions are dropped or exchanged.
How to Use WITH CHECK OPTION on Oracle Views
Stop inserts and updates through a view from producing rows the view cannot see, make views read-only, and update through join views.
How to Create Materialized Views in Oracle
Store the results of expensive queries in materialized views, choose how they are built and refreshed, and let other queries use them.
How to Refresh Materialized Views with DBMS_MVIEW
Bring stale materialized views up to date with DBMS_MVIEW.REFRESH, completely or fast, one at a time or several as a consistent set.
How to Set Up Fast Refresh on Commit for Materialized Views
Keep materialized views always current by applying only the changes with materialized view logs and REFRESH FAST ON COMMIT.
How to Use Query Rewrite with Materialized Views
Speed up existing reports without changing them: let the optimizer answer queries from materialized views through query rewrite.
Performance & Execution Plans 14
Read execution plans, access paths and join methods, find out why an index is not used, and find slow SQL with V$SQL.
How to Read an Execution Plan in Oracle
Get a plan with EXPLAIN PLAN and DBMS_XPLAN, read its operations in the right order, and compare the estimates with actual rows.
How to Read Table and Index Access Paths in Oracle Execution Plans
See every common Oracle access path in a real plan, learn when the optimizer picks it, and why a full scan is sometimes faster than an index.
How to Read Join Methods in Oracle Execution Plans: Nested Loops, Hash Join, and Merge Join
See nested loops, hash joins and sort-merge joins in real Oracle plans, learn when each is chosen, and compare their cost on one query.
How to Find and Fix Stale Statistics in Oracle
See how stale statistics mislead the optimizer on new data, find stale and missing statistics, and gather them again with DBMS_STATS.
How to Use Histograms for Skewed Data in Oracle
See how skewed data fools the optimizer without histograms, how SIZE AUTO creates them, and how frequency and hybrid histograms fix plans.
How to Use Extended Statistics for Correlated Columns in Oracle
See how correlated columns fool the optimizer, create a column group with DBMS_STATS, and make sure the optimizer really uses it.
How to Reduce Hard Parsing with Bind Variables
Measure hard parses, time, and shared pool memory for literal SQL and bind variables, and see what CURSOR_SHARING = FORCE changes.
How Bind Variables Affect Execution Plans: Bind Peeking and Adaptive Cursor Sharing
Watch bind peeking and adaptive cursor sharing on a skewed column, read the child cursors in V$SQL, and see when the first plan sticks.
Why Oracle Is Not Using Your Index
Six common reasons Oracle does a full scan despite an index, each shown in a real plan with the change that makes the index work.
How to Find Unused Indexes with DBA_INDEX_USAGE
Read index usage from DBA_INDEX_USAGE, see why sampled tracking can miss rare uses, and remove unused indexes safely.
How to Use Optimizer Hints in Oracle
Write optimizer hints that work, find the ones Oracle ignores with the Hint Report, and see why forcing a plan can make queries slower.
How to Use Direct-Path INSERT in Oracle
Compare conventional and direct-path inserts of 500,000 rows by time, redo, and undo, and see when the APPEND hint really pays off.
How to Find Slow SQL Statements with V$SQL and V$SQLSTATS
Rank SQL statements by total and per-execution time with V$SQLSTATS, read child cursors in V$SQL, and show the top statement's plan.
Oracle SQL Query to Use EXPLAIN PLAN for Join Analysis
The EXPLAIN PLAN statement in Oracle SQL provides detailed insights into how the database optimizer executes join operations, revealing the specific algorithms, access…
Transactions, Locking & Flashback 6
Savepoints, isolation levels, row locking, deadlocks, lock-free reservations, and Flashback Query.
How to Use SAVEPOINT in Oracle Transactions
Mark points in a transaction with SAVEPOINT and undo only the changes made after one with ROLLBACK TO SAVEPOINT, keeping earlier work.
How to Set Transaction Isolation Levels in Oracle
Choose between READ COMMITTED, SERIALIZABLE, and READ ONLY transactions in Oracle, and know what each query sees and when ORA-08177 appears.
How to Lock Rows with SELECT FOR UPDATE in Oracle
Lock the rows you read until you update them with SELECT FOR UPDATE, and use NOWAIT, WAIT, and SKIP LOCKED to control waiting.
How to Find Deadlocks in Oracle
See how a deadlock happens and how Oracle breaks it with ORA-00060, where it is recorded, and how to keep deadlocks from recurring.
How to Use Lock-Free Reservations in Oracle
Let many transactions update seats, stock, or balances on the same row at once with reservable columns, while constraints still hold.
How to Query Past Data with Flashback Query in Oracle
See data as it was minutes ago, put back rows changed by mistake, and list every committed version of a row with VERSIONS BETWEEN.
Users, Privileges & Data Dictionary 8
Create users, grant privileges and roles, explore the data dictionary and V$ views, and use database links.
How to Create Users with Profiles in Oracle
Create application users with passwords and quotas, let them connect, and enforce password rules and session limits with profiles.
How to Grant Object Privileges in Oracle
Give application users exactly the access they need with GRANT, down to single columns, and take it back with REVOKE when it is no longer needed.
How to Grant Schema Privileges in Oracle
Give users access to every table of one schema, including future ones, with schema privileges instead of per-table or database-wide grants.
How to Use DB_DEVELOPER_ROLE in Oracle
Give developers exactly the privileges to build application objects with DB_DEVELOPER_ROLE, instead of CONNECT, RESOURCE, or DBA.
How to Explore the Oracle Data Dictionary
Answer questions about your schema in SQL with the data dictionary: find the right view, list objects and columns, and read comments.
How to Query Constraints from the Data Dictionary
Find every constraint of a table, what each foreign key references, and which tables point to a table, with USER_CONSTRAINTS.
How to Query V$ Views in Oracle
See the live state of the database with V$ views: find your session, read parameter values, check the version, and list the PDBs.
How to Create Database Links in Oracle
Query, join, and change tables in another Oracle database through a database link, and keep the stored credentials and performance in check.
JSON in SQL 17
JSON functions, JSON_TABLE, and generating JSON from tables.
How to Convert Oracle Database Tables to JSON Format
How do you convert traditional relational data into JSON format using Oracle SQL? JSON has become the de facto standard for data exchange in modern applications, and…
Oracle JSON Type Constructor
Important Prerequisite: The JSON type constructor is a modern feature. To use it, your database compatible parameter must be set to 20 or higher. If you are on an older…
Oracle JSON_ARRAY Function
The JSON_ARRAY function in Oracle SQL is a "constructor" function. Its job is the opposite of JSON_VALUE or JSON_QUERY. Instead of extracting data from JSON, JSON_ARRAY…
Oracle JSON_ARRAYAGG Function
The JSON_ARRAYAGG function in Oracle SQL is an aggregate function. Its job is to take all the values from a single column across multiple rows and combine (or…
Oracle JSON_DATAGUIDE Function
The JSON_DATAGUIDE function in Oracle SQL is a powerful aggregate function used for data analysis. Its job is not to extract data, but to analyze a collection of JSON…
Oracle JSON_EQUAL Function
Compare JSON documents by their content rather than their text, and learn which differences JSON_EQUAL ignores and which it reports.
Oracle JSON_EXISTS Function
Check whether a JSON document has a field or matches a filter, and pass values into path filters as variables instead of literals.
Oracle JSON_MERGEPATCH Function
Replace, add, and delete fields of a JSON document with a merge patch, and learn why arrays are replaced whole and nulls mean delete.
Oracle JSON_OBJECT Function
The JSON_OBJECT function in Oracle SQL is a "constructor" function. Its job is the opposite of JSON_VALUE or JSON_QUERY. Instead of extracting data from JSON…
Oracle JSON_OBJECTAGG Function
The JSON_OBJECTAGG function in Oracle SQL is an aggregate function. Its job is to take all the rows in a group and combine them into a single JSON object. This is the…
Oracle JSON_QUERY Function
When working with JSON data in Oracle, you have two main functions for extracting data: JSON_VALUE and JSON_QUERY. This tutorial focuses on JSON_QUERY, which you use…
Oracle JSON_SCALAR Function
The JSON_SCALAR function in Oracle SQL is a constructor function that converts a single SQL scalar value (like a NUMBER, VARCHAR2, or DATE) into its equivalent JSON…
Oracle JSON_SERIALIZE Function
The JSON_SERIALIZE function in Oracle SQL is a conversion function that takes JSON data (stored as a JSON type, VARCHAR2, CLOB, or BLOB) and converts it back into a…
Oracle JSON_TABLE Function
The JSON_TABLE function in Oracle SQL is the most powerful and complex of Oracle's JSON functions. Its job is to "shred" a JSON document and present it as a regular…
Oracle JSON_TRANSFORM Function
The JSON_TRANSFORM function is Oracle's most powerful tool for modifying JSON data directly within a SQL query. While JSON_VALUE and JSON_QUERY are used to read data…
Oracle JSON_VALUE Function
When working with JSON data in Oracle, you have two main functions for extracting data: JSON_VALUE and JSON_QUERY. The difference is simple but critical: This tutorial…
Oracle SQL Query to Parse and Extract JSON Data with JSON_TABLE
Have you ever found yourself staring at a column full of JSON data in your Oracle database, wondering how to extract specific values without writing complex string…
XML Functions 11
Generate, query, and transform XML in SQL with XMLELEMENT, XMLAGG, XMLTABLE, and the other XML functions.
Oracle SYS_XMLGEN Function
Turn values and objects into XML documents with Oracle's SYS_XMLGEN, rename them with XMLFormat, and aggregate them with SYS_XMLAGG.
Oracle XMLAGG Function
Aggregate the rows of each group into ordered XML child elements, and nest XMLAGG calls to build a complete document in one query.
Oracle XMLCAST Function
Convert XML query results into SQL numbers, dates, and strings with XMLCAST, and avoid the trap of paths that match several nodes.
Oracle XMLCONCAT Function
Join XML values into one fragment with XMLCONCAT, and create comments, processing instructions, and CDATA sections in SQL.
Oracle XMLDIFF Function
Compare two XML documents, list the changed nodes as xdiff operations, and rebuild the new version from the old one with XMLPATCH.
Oracle XMLELEMENT Function
Turn table rows into well-formed XML elements with XMLELEMENT, add attributes with XMLATTRIBUTES, and create element runs with XMLFOREST.
Oracle XMLEXISTS Condition
Test whether an XML document contains an element or value, and filter rows in WHERE by the content of their XML with bound variables.
Oracle XMLQUERY Function
Run XQuery paths, functions, and FLWOR expressions against XML inside SQL with XMLQUERY, and turn results into values or text.
Oracle XMLSERIALIZE Function
Convert XML to indented or compact text of the type you need with XMLSERIALIZE, and parse text into XMLType documents or fragments.
Oracle XMLTABLE Function
Shred XML documents into relational rows and typed columns with XMLTABLE, including attributes, row numbers, and namespaced XML.
Oracle XMLTRANSFORM Function
Apply XSLT stylesheets to XML inside the database with XMLTRANSFORM, turning table data into HTML, text, or another XML layout.
String Functions 29
SUBSTR, INSTR, REPLACE, REGEXP, fuzzy matching, collation, and every other character function.
A Simple Guide to the CHR Function in Oracle
If you've ever needed to use a special character in Oracle SQL, like a line break or a copyright symbol (©), the CHR function is the tool you need. This guide will…
How to Get Substring from a String in Oracle SQL?
In Oracle SQL, you get a substring from a string using the SUBSTR function. The SUBSTR function is one of the most versatile and commonly used string manipulation…
Oracle ASCII Function: A Simple Guide
The ASCII function in Oracle SQL is the reverse of the CHR function. It takes a character string and returns the numeric code (like ASCII, EBCDIC, etc.) for its very…
Oracle Character Set Functions
Convert between character set names and numbers, find the database's character sets, and size NCHAR columns with NLS_CHARSET_DECL_LEN.
Oracle Collation Functions
See which collation applies to an expression, convert collation names and numbers, and compare text without regard to case or accents.
Oracle CONCAT Function: A Simple Guide to Joining Strings
When working with data in Oracle SQL, you'll often need to combine or "join" strings together. The CONCAT function is a built-in tool specifically for this purpose. This…
Oracle FUZZY_MATCH Function
Find misspelled and similar names in SQL by scoring string similarity with Levenshtein, Jaro-Winkler, bigram, and other algorithms.
Oracle INITCAP Function: A Simple Guide to Capitalizing Words
When you have text data in your Oracle database that is messy—like all lowercase or all uppercase—it can look unprofessional in reports. The INITCAP function is a simple…
Oracle INSTR Function: A Simple Guide to Finding Substrings
Ever needed to find the exact position of a word or letter within a string in Oracle SQL? The INSTR function is the perfect tool for the job. This simple guide will…
Oracle LENGTH Function: A Simple Guide
The LENGTH function in Oracle SQL is one of the most fundamental string functions. It simply tells you the number of characters in a given string. It's an essential…
Oracle LOWER Function: A Simple Guide to Converting Text
When you're working with text data in an Oracle database, you'll often find that the capitalization is inconsistent. You might have 'Admin', 'admin', and 'ADMIN' all in…
Oracle LPAD Function: A Simple Guide to Left-Padding Strings
Have you ever needed to format your query results so they line up perfectly? For example, making all your ID numbers a fixed length (like 001, 023, 100)? The Oracle LPAD…
Oracle LTRIM Function: A Simple Guide to Trimming Characters
When working with data, you'll often find strings with unwanted characters at the beginning, especially leading spaces. The Oracle LTRIM function is a simple and…
Oracle NLSSORT Function
Sort and compare strings by linguistic rules instead of byte values, ignoring case with BINARY_CI and accents with BINARY_AI.
Oracle PHONIC_ENCODE Function
Find names that sound alike despite different spellings by comparing Double Metaphone codes, with primary and alternate pronunciations.
Oracle REGEXP_COUNT Function
Count how many times a pattern occurs in a string, from words and search terms to digits and groups, with case-insensitive options.
Oracle REGEXP_INSTR Function
Find the position of a regular expression match in a string, choose which match, get the position after it, and locate a single group.
Oracle REGEXP_LIKE Function
Match strings against regular expressions in WHERE, CASE, and CHECK constraints, and avoid the bracket mistake with \d in Oracle patterns.
Oracle REGEXP_REPLACE Function: A Simple Guide
When you need to find and replace text in Oracle, you might think of the REPLACE function. But what if you need to find a pattern, not just a fixed string? For this…
Oracle REGEXP_SUBSTR Function: A Simple Guide
While REGEXP_REPLACE is for changing text, what if you just want to extract text that matches a pattern? For this, Oracle provides the powerful REGEXP_SUBSTR function.…
Oracle REPLACE Function: A Simple Guide
When you need to do a simple "find and replace" on a string, the Oracle REPLACE function is the perfect tool for the job. Unlike REGEXP_REPLACE, which searches for…
Oracle RPAD Function: A Simple Guide
The RPAD function in Oracle is the mirror image of LPAD. It "Right Pads" a string, adding characters to the end of it until it reaches a specified total length. This…
Oracle RTRIM Function: A Simple Guide
The RTRIM function in Oracle is a powerful tool for cleaning data. It "Right Trims" a string, meaning it removes all specified characters from the end (or right side) of…
Oracle SOUNDEX Function: A Simple Guide
The SOUNDEX function in Oracle is a special phonetic tool that helps you find words that "sound alike" in English, even if they are spelled differently. It converts a…
Oracle SUBSTR Function: A Simple Guide
The SUBSTR function (short for "Substring") is one of the most powerful and commonly used string functions in Oracle SQL. It allows you to extract or "cut out" a…
Oracle TRANSLATE Function: A Simple Guide
The TRANSLATE function in Oracle SQL is a powerful tool for performing multiple, single-character substitutions all at once. It works like a find-and-replace for…
Oracle TRANSLATE USING Function: A Simple Guide
The TRANSLATE USING function in Oracle SQL is a specialized function used to convert a string from one character set to another. Specifically, it converts a string to…
Oracle TRIM Function: A Simple Guide
The TRIM function in Oracle SQL is a flexible and powerful tool for cleaning strings. It allows you to remove unwanted characters from the beginning (leading), the end…
Oracle UPPER Function: A Simple Guide
The UPPER function in Oracle SQL is a straightforward and widely used function that converts all letters in a string to uppercase. It's an essential tool for…
Numeric Functions 27
ROUND, TRUNC, MOD, CEIL, FLOOR, POWER, and the math functions.
Oracle ABS Function: A Simple Guide
The ABS function in Oracle SQL is a straightforward mathematical function. Its one and only job is to return the absolute value of a number. In simple terms, it makes…
Oracle ACOS Function: A Simple Guide
The ACOS function in Oracle SQL is a trigonometric function that stands for Arc Cosine. It does the opposite of the COS (Cosine) function. While COS takes an angle and…
Oracle ASIN Function: A Simple Guide
The ASIN function in Oracle SQL is a trigonometric function that stands for Arc Sine. It is the opposite of the SIN (Sine) function. While SIN takes an angle and gives…
Oracle ATAN Function: A Simple Guide
The ATAN function in Oracle SQL is a trigonometric function that stands for Arc Tangent. It is the opposite of the TAN (Tangent) function. While TAN takes an angle and…
Oracle ATAN2 Function: A Simple Guide
The ATAN2 function in Oracle SQL is a powerful trigonometric function. It's the "2-argument" version of the arc tangent. While ATAN(n) calculates the arc tangent of a…
Oracle BITAND Function: A Simple Guide
The BITAND function in Oracle SQL is a bitwise function. It compares two numbers (or numeric columns) on a bit-by-bit basis and returns a new number as the result of a…
Oracle CEIL Function: A Simple Guide
The CEIL function in Oracle SQL is a mathematical function that "rounds up" a number to the smallest integer that is greater than or equal to that number. The name CEIL…
Oracle COS Function: A Simple Guide
The COS function in Oracle SQL is a trigonometric function that returns the cosine of a given angle. It's important to remember that this function, like all…
Oracle COSH Function: A Simple Guide
The COSH function in Oracle SQL is a mathematical function that returns the hyperbolic cosine of a given number. This is a technical function used in engineering…
Oracle EXP Function: A Simple Guide
The EXP function in Oracle SQL is a mathematical function that returns the value of the constant e (approximately 2.71828183) raised to the power of a given number. This…
Oracle FLOOR Function: A Simple Guide
The FLOOR function in Oracle SQL is a mathematical function that returns the largest integer equal to or less than a given number. In simple terms, it always rounds a…
Oracle LN Function: A Simple Guide
The LN function in Oracle SQL is a mathematical function that returns the natural logarithm of a number. The natural logarithm is the logarithm to the base e, where e is…
Oracle LOG Function: A Simple Guide
The LOG function in Oracle SQL is a mathematical function that returns the logarithm of a number to a specific base. While the LN function is always base e, the LOG…
Oracle MOD Function: A Simple Guide
The MOD function in Oracle SQL is a mathematical function that returns the remainder of one number divided by another. It's also known as the "modulus" function. This…
Oracle NANVL Function: A Simple Guide
The NANVL function in Oracle SQL is a specialized function used to handle NaN (Not a Number) values. NaN is a special marker used in floating-point arithmetic…
Oracle POWER Function: A Simple Guide
The POWER function in Oracle SQL is a straightforward mathematical function that raises one number to the power of another number. This is the standard function to use…
Oracle REMAINDER Function: A Simple Guide
The REMAINDER function in Oracle SQL, like the MOD function, calculates the remainder of a division. However, it uses a different internal formula, which can lead to…
Oracle ROUND Function (Number): A Simple Guide
The ROUND function in Oracle SQL is one of the most common mathematical functions. It is used to round a number to a specified number of decimal places. You can use it…
Oracle ROUND_TIES_TO_EVEN Function
Round exact halves to the nearest even number with banker's rounding, and keep totals of many rounded values from drifting upward.
Oracle SIGN Function: A Simple Guide
The SIGN function in Oracle SQL is a simple mathematical function that tells you the sign of a number. It doesn't return the number itself, but rather an indicator of…
Oracle SIN Function: A Simple Guide
The SIN function in Oracle SQL is a trigonometric function that calculates the sine of a given angle. The most important thing to remember is that the SIN function, like…
Oracle SINH Function: A Simple Guide
The SINH function in Oracle SQL is a mathematical function that returns the hyperbolic sine of a number. This is an exponential function used in engineering, physics…
Oracle SQRT Function: A Simple Guide
The SQRT function in Oracle SQL is a straightforward mathematical function that returns the square root of a given number. It's important to note that the SQRT function…
Oracle TAN Function: A Simple Guide
The TAN function in Oracle SQL is a trigonometric function that calculates the tangent of a given angle. Like all trigonometric functions in Oracle, TAN requires the…
Oracle TANH Function: A Simple Guide
The TANH function in Oracle SQL is a mathematical function that returns the hyperbolic tangent of a number. This is an exponential function, different from the standard…
Oracle TRUNC Function: A Simple Guide
The TRUNC function (for numbers) in Oracle SQL is a mathematical function that cuts off (truncates) a number to a specified number of decimal places. This is different…
Oracle WIDTH_BUCKET Function: A Simple Guide
The WIDTH_BUCKET function in Oracle SQL is a powerful analytical function that lets you group data into "buckets" of equal size. It's most commonly used to build…
Date & Time Functions 35
SYSDATE, ADD_MONTHS, DATEDIFF, TIME_BUCKET, calendars, time zones, and format models.
How to Handle Daylight Saving Time Gaps in Oracle
Avoid ORA-01878 in the spring gap, resolve the repeated autumn hour with TZD, and keep timestamp arithmetic correct across clock changes.
Oracle ADD_MONTHS Function: A Simple Guide
Working with dates in SQL can be tricky, especially when you need to add or subtract months. Oracle provides a powerful and straightforward function for this exact task…
Oracle CALENDAR_ Functions
Name the quarter, month, or week of a date, find the first and last day of any period, and move dates by whole periods in one call.
Oracle CALENDAR_SINCE Function
Show dates the way user interfaces do, such as 3 days ago, 6 weeks ago, or in 2 hours, directly in SQL with a long or short form.
Oracle CEIL (Date) Function: A Simple Guide
The CEIL function in Oracle SQL can be used on numbers, but it also has a powerful version for DATE and TIMESTAMP values. In this context, CEIL "rounds up" a datetime…
Oracle CURRENT_DATE Function: A Simple Guide
The CURRENT_DATE function in Oracle SQL is a simple function that returns the current date and time based on your session's time zone. A common point of confusion is its…
Oracle CURRENT_TIMESTAMP Function: A Simple Guide
The CURRENT_TIMESTAMP function in Oracle SQL returns the exact current date, time, and time zone of your SQL session. Its key feature is that it returns a TIMESTAMP WITH…
Oracle DATEADD Function
Add any unit from years to nanoseconds to a date or timestamp with DATEADD, and see how it differs from ADD_MONTHS at month ends.
Oracle DATEDIFF Function
Count the days, weeks, months, or years between two dates in one function, and understand why DATEDIFF counts boundaries, not whole units.
Oracle Datetime Format Models Explained
Format and read dates with the right elements, use FM, FX, TH, and SP, understand RR versus YY, and avoid session format surprises.
Oracle DBTIMEZONE Function: A Simple Guide
The DBTIMEZONE function in Oracle SQL is a simple function that returns the time zone setting of the database itself. This is different from SESSIONTIMEZONE, which…
Oracle EXTRACT (Date/Time) Function: A Simple Guide
The EXTRACT function in Oracle SQL is a powerful tool for "pulling out" a single, specific part from a date or timestamp. Want just the YEAR from a DATE? Or the HOUR…
Oracle FISCAL_ Functions
Compute fiscal years, quarters, and period start and end dates for a year that starts in April, October, or any day you choose.
Oracle FLOOR (Date) Function: A Simple Guide
The FLOOR function in Oracle SQL can be used on numbers, but it also has a version for DATE and TIMESTAMP values. For dates, FLOOR "rounds down" the datetime to the unit…
Oracle FROM_TZ Function: A Simple Guide
The FROM_TZ function in Oracle SQL is a straightforward conversion function. Its one and only job is to convert a TIMESTAMP value (which has no time zone information)…
Oracle LAST_DAY Function: A Simple Guide
The LAST_DAY function in Oracle SQL is a very convenient datetime function that returns the date of the last day of the month for a given date. It's an essential tool…
Oracle LOCALTIMESTAMP Function: A Simple Guide
The LOCALTIMESTAMP function in Oracle SQL returns the current date and time (including fractional seconds) based on your session's time zone. The most important thing to…
Oracle MONTHS_BETWEEN Function: A Simple Guide
The MONTHS_BETWEEN function in Oracle SQL calculates the precise number of months between two dates. This function is essential for any business logic that involves…
Oracle NEW_TIME Function: A Simple Guide
The NEW_TIME function in Oracle SQL is a specific-purpose function used to convert a date and time from one time zone to another. Important Note: This is an older Oracle…
Oracle NEXT_DAY Function: A Simple Guide
The NEXT_DAY function in Oracle SQL is a handy date function that helps you find the date of the next specified day of the week. For example, if it's a Wednesday, you…
Oracle NUMTODSINTERVAL Function: A Simple Guide
When working with DATE or TIMESTAMP values in Oracle, you'll often need to add or subtract a specific duration, like "90 days" or "4 hours." While you can add days by…
Oracle NUMTOYMINTERVAL Function: A Simple Guide
When you need to perform date arithmetic in Oracle involving years or months, the NUMTOYMINTERVAL function is the right tool for the job. This function is the companion…
Oracle ORA_DST_AFFECTED Function: A Simple Guide
The ORA_DST_AFFECTED function in Oracle SQL is a highly specialized diagnostic tool used by Database Administrators (DBAs). This function is not used in regular…
Oracle ORA_DST_CONVERT Function: A Simple Guide
The ORA_DST_CONVERT function in Oracle SQL is a highly specialized tool used by Database Administrators (DBAs) during a database time zone file upgrade. This function is…
Oracle ORA_DST_ERROR Function: A Simple Guide
The ORA_DST_ERROR function in Oracle SQL is another highly specialized diagnostic tool used by Database Administrators (DBAs). It is part of the toolkit for managing…
Oracle RETAIL_ Functions
Report by the 4-5-4 retail calendar of whole weeks, with retail month and week names and their start and end dates, without a table.
Oracle ROUND (Date) Function: A Simple Guide
The ROUND function in Oracle SQL is not just for numbers; it's also a powerful tool for DATE and TIMESTAMP values. When used with dates, ROUND "rounds" a datetime value…
Oracle SESSIONTIMEZONE Function: A Simple Guide
The SESSIONTIMEZONE function in Oracle SQL is a simple function that returns the time zone of your current SQL session or connection. This is different from DBTIMEZONE…
Oracle SYS_EXTRACT_UTC Function: A Simple Guide
The SYS_EXTRACT_UTC function in Oracle SQL is a simple and powerful tool for standardizing time. Its one and only job is to convert a TIMESTAMP WITH TIME ZONE value into…
Oracle SYSDATE Function: A Simple Guide
The SYSDATE function is one of the most popular and frequently used functions in Oracle SQL. Its purpose is simple: it returns a single DATE value representing the…
Oracle SYSTIMESTAMP Function: A Simple Guide
The SYSTIMESTAMP function in Oracle SQL is the high-precision version of SYSDATE. It returns the exact current date, time (including fractional seconds), and time zone…
Oracle TIME_BUCKET Function
Group events into periods of any length, from fifteen-minute slots to six-hour blocks, by placing each timestamp in a fixed-size bucket.
Oracle TIMESTAMPDIFF Function
Get the hours, minutes, seconds, or milliseconds between two timestamps as a number, correctly across time zones and clock changes.
Oracle TRUNC (Date) Function: A Simple Guide
The TRUNC function (for dates) in Oracle SQL is one of the most important and frequently used date functions. It "truncates" or "cuts off" a DATE or TIMESTAMP value down…
Oracle TZ_OFFSET Function: A Simple Guide
The TZ_OFFSET function in Oracle SQL is a simple utility that returns the current time zone offset from UTC for a given time zone name. For example, it can tell you that…
Conversion Functions 43
TO_CHAR, TO_DATE, TO_NUMBER, CAST, TO_BOOLEAN, and every conversion function.
Oracle ASCIISTR Function: A Simple Guide
The ASCIISTR function in Oracle SQL is a special-purpose utility that converts a string from any character set into a "safe" 7-bit ASCII representation. Its main purpose…
Oracle BIN_TO_NUM Function: A Simple Guide
The BIN_TO_NUM function in Oracle SQL is a mathematical function that converts a binary "bit vector" (represented as a list of 0s and 1s) into its equivalent decimal…
Oracle CAST Function: A Simple Guide
The CAST function in Oracle SQL is a powerful and standard way to convert a value from one data type to another. Think of it as a universal translator for your data. If…
Oracle CHARTOROWID Function: A Simple Guide
The CHARTOROWID function in Oracle SQL is a specialized conversion function. Its one and only job is to convert a string of text (like CHAR or VARCHAR2) that is…
Oracle COMPOSE Function: A Simple Guide
The COMPOSE function in Oracle SQL is a specialized Unicode function. Its job is to take a base character plus a "combining mark" (like an accent or an umlaut) and merge…
Oracle CONVERT Function: A Simple Guide
The CONVERT function in Oracle SQL is a specialized function used to convert a character string from one character set to another (e.g., from WE8ISO8859P1 to US7ASCII).…
Oracle DECOMPOSE Function: A Simple Guide
The DECOMPOSE function in Oracle SQL is a specialized Unicode function. It does the opposite of COMPOSE. Its job is to take a single, pre-composed character (like ö or…
Oracle HEXTORAW Function: A Simple Guide
The HEXTORAW function in Oracle SQL is a data type conversion function. Its one and only job is to convert a string of hexadecimal digits (like '4A', 'FF', '7D') into…
Oracle Number Format Models Explained
Format and read numbers with 9, 0, G, D, L, MI, PR, and other elements, keep leading zeros, and follow each locale's separators.
Oracle RAWTOHEX Function: A Simple Guide
The RAWTOHEX function in Oracle SQL is a data type conversion function. It is the direct opposite of HEXTORAW. Its one and only job is to take a RAW binary value and…
Oracle RAWTONHEX Function: A Simple Guide
The RAWTONHEX function in Oracle SQL is a character set-specific version of RAWTOHEX. Its job is to convert a RAW binary value into a human-readable hexadecimal string…
Oracle ROWIDTOCHAR Function: A Simple Guide
The ROWIDTOCHAR function in Oracle SQL is a simple conversion function. Its one and only job is to convert a ROWID data type into a human-readable text string…
Oracle ROWIDTONCHAR Function: A Simple Guide
The ROWIDTONCHAR function in Oracle SQL is a character set-specific version of ROWIDTOCHAR. Its one and only job is to convert a ROWID data type into a human-readable…
Oracle SCN_TO_TIMESTAMP Function: A Simple Guide
The SCN_TO_TIMESTAMP function in Oracle SQL is a special function used to find the approximate timestamp associated with a given System Change Number (SCN). An SCN is a…
Oracle TIMESTAMP_TO_SCN Function: A Simple Guide
The TIMESTAMP_TO_SCN function in Oracle SQL is a special function that does the exact opposite of SCN_TO_TIMESTAMP. It takes a TIMESTAMP value as an argument and returns…
Oracle TO_BINARY_DOUBLE Function: A Simple Guide
The TO_BINARY_DOUBLE function in Oracle SQL is a conversion function that changes a value (like a NUMBER or a VARCHAR2 string) into a double-precision floating-point…
Oracle TO_BINARY_FLOAT Function: A Simple Guide
The TO_BINARY_FLOAT function in Oracle SQL is a conversion function that changes a value (like a NUMBER or a VARCHAR2 string) into a single-precision floating-point…
Oracle TO_BLOB (bfile) Function: A Simple Guide
The TO_BLOB (bfile) function in Oracle SQL is a conversion function used to move data from an external file into the database. It reads a BFILE (a data type that points…
Oracle TO_BLOB (raw) Function: A Simple Guide
The TO_BLOB (raw) function in Oracle SQL is a conversion function that "upgrades" a RAW or LONG RAW data type into a BLOB (Binary Large Object). This is useful when you…
Oracle TO_BOOLEAN Function
Turn yes and no flags, true and false strings, and numbers into the BOOLEAN data type, with a default for values it does not recognize.
Oracle TO_CHAR (bfile|blob) Function: A Simple Guide
The TO_CHAR (bfile|blob) function in Oracle SQL is a special conversion function. Its job is to read binary data from a BFILE (an external file) or a BLOB (an internal…
Oracle TO_CHAR (character) Function: A Simple Guide
The TO_CHAR (character) function in Oracle SQL is a conversion function used to convert data from "large object" (CLOB, NCLOB) or "national character" (NCHAR, NVARCHAR2)…
Oracle TO_CHAR (Date) Function: A Simple Guide to Formatting Dates
The TO_CHAR function (when used with dates) is one of the most essential and commonly used functions in Oracle SQL. Its job is to take a DATE, TIMESTAMP, or INTERVAL and…
Oracle TO_CHAR (Number) Function: A Simple Guide to Formatting Numbers
The TO_CHAR function for numbers is one of the most important formatting functions in Oracle SQL. Its job is to take a NUMBER (or BINARY_FLOAT, BINARY_DOUBLE) and…
Oracle TO_CLOB (bfile|blob) Function: A Simple Guide
The TO_CLOB (bfile|blob) function in Oracle SQL is a conversion function. Its job is to take binary data, either from an external file (BFILE) or an internal binary…
Oracle TO_CLOB (character) Function: A Simple Guide
The TO_CLOB (character) function in Oracle SQL is a conversion function. Its primary job is to convert various character data types—specifically those in the national…
Oracle TO_DATE Function: A Simple Guide to Converting Strings to Dates
The TO_DATE function is one of the most essential and widely used functions in Oracle SQL. Its one and only job is to convert a text string (like '2025-01-30' or…
Oracle TO_DSINTERVAL Function: A Simple Guide
The TO_DSINTERVAL function in Oracle SQL is a conversion function that converts a text string (a CHAR or VARCHAR2) into an INTERVAL DAY TO SECOND data type. This…
Oracle TO_LOB Function: A Simple Guide
The TO_LOB function in Oracle SQL is a very specialized function used for data migration. Its one and only purpose is to convert old, deprecated LONG and LONG RAW data…
Oracle TO_MULTI_BYTE Function: A Simple Guide
The TO_MULTI_BYTE function in Oracle SQL is a specialized character set function. Its job is to convert single-byte (or "half-width") characters into their corresponding…
Oracle TO_NCHAR (character) Function: A Simple Guide
The TO_NCHAR (character) function in Oracle SQL is a conversion function. Its primary job is to convert various character data types (like CHAR, VARCHAR2, or CLOB) into…
Oracle TO_NCHAR (datetime) Function: A Simple Guide
The TO_NCHAR (datetime) function in Oracle SQL is a conversion function that formats DATE or TIMESTAMP values. It works almost identically to the standard…
Oracle TO_NCHAR (number) Function: A Simple Guide
The TO_NCHAR (number) function in Oracle SQL is a conversion function for formatting numbers. It works almost identically to the standard TO_CHAR(number) function, with…
Oracle TO_NCLOB Function: A Simple Guide
The TO_NCLOB function in Oracle SQL is a conversion function. Its primary job is to convert various character data types (like CHAR, VARCHAR2, or CLOB) into an NCLOB…
Oracle TO_NUMBER Function: A Simple Guide
The TO_NUMBER function in Oracle SQL is an essential conversion function. Its primary job is to convert a text string (like a VARCHAR2 or CHAR) into an actual NUMBER…
Oracle TO_SINGLE_BYTE Function: A Simple Guide
The TO_SINGLE_BYTE function in Oracle SQL is a specialized character set function. It is the direct opposite of TO_MULTI_BYTE. Its job is to convert multibyte (or…
Oracle TO_TIMESTAMP Function: A Simple Guide
The TO_TIMESTAMP function in Oracle SQL is a powerful conversion function. Its job is to take a text string (like '2025-01-20 15:30:00') and convert it into a TIMESTAMP…
Oracle TO_TIMESTAMP_TZ Function: A Simple Guide
The TO_TIMESTAMP_TZ function in Oracle SQL is a powerful conversion function. Its job is to take a text string (like '2025-11-20 10:30:00 -05:00') and convert it into a…
Oracle TO_UTC_TIMESTAMP_TZ Function
Read ISO 8601 dates and timestamps from JSON and REST services without a format model, and get the UTC time with SYS_EXTRACT_UTC.
Oracle TO_YMINTERVAL Function: A Simple Guide
The TO_YMINTERVAL function in Oracle SQL is a conversion function that converts a text string (a CHAR or VARCHAR2) into an INTERVAL YEAR TO MONTH data type. This…
Oracle TREAT Function: A Simple Guide
The TREAT function in Oracle SQL is an advanced function used to change the declared type of an expression. It is most commonly used in two specific scenarios: This…
Oracle UNISTR Function: A Simple Guide
The UNISTR function in Oracle SQL is a powerful tool for creating text strings in the national character set. Its most important feature is its ability to create Unicode…
Oracle VALIDATE_CONVERSION Function: A Simple Guide to Safely Test Data
The VALIDATE_CONVERSION function in Oracle SQL is a powerful "safety check" function. Its one and only job is to test if a value (like a text string) can be successfully…
Aggregate & Statistical Functions 24
COUNT, SUM, AVG, MEDIAN, percentiles, statistics, and approximate aggregates.
Oracle ANY_VALUE Function
Select a column that has the same value in every row of a group without adding it to GROUP BY or wrapping it in MAX, and avoid ORA-00979.
Oracle APPROX_COUNT Function
Answer top-N questions such as the busiest routes or best-selling cabins quickly with APPROX_COUNT, APPROX_SUM, and APPROX_RANK.
Oracle APPROX_COUNT_DISTINCT Function
Estimate the number of distinct values in huge tables quickly, and store mergeable sketches so distinct counts add up correctly.
Oracle APPROX_MEDIAN Function
Estimate medians and percentiles of very large data quickly, make the result repeatable with DETERMINISTIC, and check its accuracy.
Oracle AVG Function
Average the values of each group with AVG, understand how NULLs change the divisor, and average intervals in Oracle AI Database 26ai.
Oracle BIT_AND_AGG Function
Combine flag integers bit by bit over a group to find options common to all rows or available in any, and decode them with BITAND.
Oracle BITMAP_ Functions for Exact Distinct Counts
Count distinct integers exactly with bitmaps that can be stored per group and merged, so distinct counts over any period stay correct.
Oracle BOOLEAN_AND_AGG Function
Check whether all or any rows of a group are true, such as all passengers checked in, with BOOLEAN_AND_AGG, BOOLEAN_OR_AGG, and EVERY.
Oracle CHECKSUM Function
Detect whether data changed or differs between databases by comparing order-independent checksums of column values over groups.
Oracle CORR Function
Measure how closely two columns move together with Pearson, Spearman, and Kendall correlation, and why per-group results can differ.
Oracle COUNT Function
Learn the difference between COUNT(*), COUNT(column), and COUNT(DISTINCT), and how to count matches correctly after an outer join.
Oracle COVAR_POP Function
Measure whether two columns rise and fall together with COVAR_POP and COVAR_SAMP, and see how units change covariance but not correlation.
Oracle MAX Function
Find the largest value, latest date, or worst delay in each group with MAX, and learn when GREATEST is the function you need.
Oracle MEDIAN Function
Find the middle value of each group with MEDIAN, and see why it describes skewed data such as salaries better than the average.
Oracle MIN Function
Find the smallest number, the earliest date, or the first name alphabetically in each group with MIN, and get other columns of that row.
Oracle PERCENTILE_CONT Function
Compute medians, quartiles, and 90th percentiles of each group with PERCENTILE_CONT, which interpolates between the nearest values.
Oracle PERCENTILE_DISC Function
Get percentiles that are actual values from the data with PERCENTILE_DISC, and see how they differ from interpolated PERCENTILE_CONT.
Oracle REGR_ Functions
Fit a least-squares line through pairs of values with REGR_SLOPE and REGR_INTERCEPT, measure the fit with REGR_R2, and predict values.
Oracle SKEWNESS Function
Describe the shape of your data beyond mean and spread: measure lopsidedness with SKEWNESS and the weight of the tails with KURTOSIS.
Oracle STATS_ Test Functions
Test whether differences between groups are real with t-tests, ANOVA, and chi-squared tests run directly in SQL with the STATS_ functions.
Oracle STATS_MODE Function
Find the most frequent value in each group, such as the usual base airport or cabin, with STATS_MODE, and know how it handles ties.
Oracle STDDEV Function
Measure how spread out the values of each group are with STDDEV, and choose between the population and sample versions correctly.
Oracle SUM Function
Add up values per group with SUM, total intervals of time in Oracle AI Database 26ai, and handle NULLs and empty groups correctly.
Oracle VARIANCE Function
Measure the spread of each group as the mean squared deviation with VARIANCE, and choose between the population and sample versions.
NULL, Comparison & Other Functions 25
NVL, COALESCE, DECODE, GREATEST, hashing, identifiers, collections, and LOB functions.
How to Use Multiset Operators in Oracle
Unite, intersect, and subtract nested tables like sets, and test membership and subsets, in PL/SQL and SQL without loops.
Oracle BFILENAME Function: A Simple Guide
The BFILENAME function in Oracle SQL is a special function used to work with external files. Its job is to create a BFILE locator, which is a pointer to a physical file…
Oracle CARDINALITY Function
Count the elements of a nested table collection in SQL, and see how empty collections, NULL collections, and NULL elements behave.
Oracle COALESCE Function: A Simple Guide
The COALESCE function in Oracle SQL is a powerful and flexible function used to handle NULL values. Its job is to return the first non-NULL expression it finds in a list…
Oracle COLLECT Function
Gather the values of each group into a nested table collection with COLLECT and CAST, and avoid the ORA-00932 element type mismatch.
Oracle CON_ Functions
Translate between container names, container IDs, DBIDs, UIDs, and GUIDs in a container database with the eight CON_ functions.
Oracle DECODE Function: A Simple Guide
The DECODE function in Oracle SQL is a powerful and concise way to write conditional logic (like an IF...THEN...ELSE statement) directly within your SQL query. It…
Oracle DOMAIN_ Functions
Format, sort, and validate values by the rules of a data use case domain with DOMAIN_DISPLAY, DOMAIN_ORDER, and DOMAIN_CHECK.
Oracle DUMP Function: A Simple Guide
The DUMP function in Oracle SQL is a powerful diagnostic tool. It's not used for normal reporting but is essential for debugging and internal analysis. Its purpose is to…
Oracle EMPTY_BLOB Function: A Simple Guide
The EMPTY_BLOB() function in Oracle SQL is a special function used to create an "empty" BLOB (Binary Large Object). This is a crucial first step when you want to add…
Oracle EMPTY_CLOB Function: A Simple Guide
The EMPTY_CLOB() function in Oracle SQL is a special function used to create an "empty" CLOB (Character Large Object). This is a crucial first step when you want to add…
Oracle GREATEST Function: A Simple Guide
The GREATEST function in Oracle SQL is a simple utility that looks at a list of values you provide and returns the one that is the largest. It's an incredibly useful…
Oracle LEAST Function: A Simple Guide
The LEAST function in Oracle SQL is the direct opposite of the GREATEST function. It looks at a list of values you provide and returns the one that is the smallest. It's…
Oracle LNNVL Function: A Simple Guide
The LNNVL function in Oracle SQL is a special logical function. Its name stands for "Logical Not NULL-Value Logic," and it's used to simplify conditions that involve…
Oracle NULLIF Function: A Simple Guide
The NULLIF function in Oracle SQL is a simple but powerful control-flow function. It compares two expressions. If they are equal, it returns NULL. If they are not equal…
Oracle NVL Function: A Simple Guide
The NVL function in Oracle SQL is one of the most common and essential functions for handling NULL values. A NULL value in a database means "unknown" or "empty," and it…
Oracle NVL2 Function: A Simple Guide
The NVL2 function in Oracle SQL is a powerful "if-then-else" function for handling NULL values. It's an extension of the basic NVL function. NVL2 checks an expression.…
Oracle ORA_HASH Function: A Simple Guide
The ORA_HASH function in Oracle SQL is a powerful function used to compute a consistent "hash value" (a number) for any given expression. Its main purpose is to help you…
Oracle POWERMULTISET Function
List every subset of a collection, or only the pairs or triples, with POWERMULTISET and POWERMULTISET_BY_CARDINALITY.
Oracle SET Function
Remove duplicate elements from a nested table collection, the collection version of DISTINCT, and use it after MULTISET UNION.
Oracle STANDARD_HASH Function: A Simple Guide
The STANDARD_HASH function in Oracle SQL is a powerful security function. It computes a "hash value" (also known as a "fingerprint" or "checksum") for a given…
Oracle SYS_CONTEXT Function
Find out who is logged in, where they connect from, and which module is running, with SYS_CONTEXT and the built-in USERENV context.
Oracle SYS_GUID Function
Generate globally unique 16-byte identifiers for keys, use SYS_GUID as a column default, and see when a random UUID is the better choice.
Oracle UUID Functions
Generate random UUIDs, convert between RAW and the hyphenated text form, validate strings, and store UUIDs efficiently as RAW(16).
Oracle VSIZE Function: A Simple Guide
The VSIZE function in Oracle SQL is a simple utility function that tells you the number of bytes used to store a specific expression. This is different from the LENGTH…
Machine Learning in SQL 9
Score models in SQL: predictions, probabilities, anomaly detection, feature extraction, and evaluation.
How to Explain Predictions with PREDICTION_DETAILS in Oracle
Build a classification model in the database, score rows in SQL, and explain each prediction with its most important attributes.
How to Get All Class Probabilities with PREDICTION_SET
See how likely every class is for each row, not only the top prediction, and use the probabilities in your decisions.
How to Use Cost-Sensitive Predictions in Oracle (cost matrix)
Tell a classification model that some mistakes cost more than others, and let predictions choose the cheapest outcome.
How to Predict Ranges with PREDICTION_BOUNDS in Oracle
Predict a number with a generalized linear model and get a 95 percent range around each prediction, not just one value.
How to Extract Features with FEATURE_ID in Oracle
Compress several attributes into a few features with a feature extraction model, and see which feature describes each row best.
How to Detect Anomalies with One-Class SVM in Oracle
Train a one-class support vector machine on normal data and rank rows by how likely they are to be anomalies.
How to Score Without a Saved Model in Oracle (dynamic scoring)
Let a single query build a temporary model from its own rows and score them, with the analytic form of PREDICTION.
How to Evaluate Models with COMPUTE_CONFUSION_MATRIX in Oracle
Score held-out rows, then measure a classification model with a confusion matrix, its accuracy, and the area under the ROC curve.
How to Find Important Attributes with DBMS_PREDICTIVE_ANALYTICS
Rank every column of a table by how much it explains a target column, in one call and without building a model.
Interview Prep & Books 3
SQL interview questions, tricky queries, and the SQL and PL/SQL book.
Oracle Database 26ai SQL and PL/SQL Book
700 pages, 66 chapters, 677 examples with their real output: SQL and PL/SQL on Oracle AI Database 26ai.
Tricky Oracle SQL Queries for Interview: Top Questions and Answers
Oracle SQL interviews do not just test whether you know the syntax. They test whether you can think through a problem and construct the right query under pressure.…
Top 50 Oracle SQL Interview Questions (2026 Edition)
Getting ready for an Oracle SQL interview can feel overwhelming, especially when the role covers everything from basic queries to advanced performance tuning. The good…
No tutorials match your search.
Try a shorter word, or search all of vinish.dev.
