These are SQL questions of the kind Oracle actually asks — the patterns reported from Oracle's SQL screens and data/SDE interview rounds. My advice: treat this page as a mock test. Attempt every question on paper first, then reveal. If any answer surprises you, the lesson it comes from is linked right below — go read it, then come back.
Oracle SQL query questions
Given a sales table with sale_id, region, sale_date, and amount, write a query using a window function to compute the running total of sales amount per region, ordered by sale date.
Asked in


sales5 rows
| sale_id | region | sale_date | amount |
|---|---|---|---|
| 1 | North | 2026-01-01 | 100 |
| 2 | North | 2026-01-02 | 150 |
| 3 | North | 2026-01-03 | 200 |
| 4 | South | 2026-01-01 | 300 |
| 5 | South | 2026-01-02 | 100 |
Write a query using a CTE to compute a running total of the amount column, ordered by sale_date, from the sales table.
Asked in


sales4 rows
| sale_id | sale_date | amount |
|---|---|---|
| 1 | 2026-01-01 | 100.00 |
| 2 | 2026-01-02 | 150.00 |
| 3 | 2026-01-03 | 200.00 |
| 4 | 2026-01-04 | 50.00 |
Write a query with two CTEs — one computing the total number of orders per customer, another computing the total amount spent per customer — and join them to return each customer's order count and total spend, from the orders table.
Asked in


orders5 rows
| order_id | customer_id | amount |
|---|---|---|
| 1 | 101 | 250.00 |
| 2 | 101 | 300.00 |
| 3 | 102 | 100.00 |
| 4 | 103 | 500.00 |
| 5 | 101 | 150.00 |
How to use this page: Oracle rarely asks a question you've never seen — they ask standard patterns with a twist. Master the pattern in the SQL course lessons, and the twist stops mattering.
Keep practising: SQL Basics, Joins, GROUP BY & HAVING and Subqueries cover what most Oracle SQL rounds test.

