Study guide · Core notes

Oracle AI Database SQL Associate core notes

Reference notes for Oracle exam 1Z0-171. Each section names the object, and what you check in an Oracle schema you are allowed to drop.

Reviewed November 19, 2026Eleven topic areasCerticab practice allocation

How to read these notes: Unmarked items sit on the public 1Z0-171 topic list or the SQL Language Reference they point at. Items tagged Extra are job context that outline does not require. New to the exam? Start with the overview. Practice in a schema you can remove. Weights below are the official percentages.

Relational Database Concepts

5% editorial study emphasis. Keys, relations, normalization.

Tables and keys

A relation is rows with named columns. A primary key uniquely identifies each row. A foreign key references a parent key to enforce referential integrity.

Normalization

Separate repeating groups to reduce redundant updates. Store mutable facts once and join when you need them.

Integrity

Entity integrity (primary keys) and referential integrity (foreign keys) are the relational guarantees this exam expects you to name.

Scope note

This topic is conceptual. Deep physical storage and RAC design are out of associate SQL depth. Extra Production modeling also considers indexing and partitioning trade-offs.

Retrieving Data using the SQL SELECT Statement and Restricting and Sorting Data

15% editorial study emphasis. Projection, filters, sorts.

SELECT list

Choose columns or expressions. Aliases label output and can appear in ORDER BY. DISTINCT removes duplicate result rows.

WHERE

Filters rows before grouping. Use IS NULL / IS NOT NULL—not = NULL. BETWEEN is inclusive. IN tests membership.

LIKE and ESCAPE

% matches any length; _ matches one character. Use ESCAPE when you need a literal underscore or percent.

ORDER BY

Sorts the final result. ASC/DESC combine with NULLS FIRST/LAST. AND binds tighter than OR—use parentheses.

Using Functions

25% editorial study emphasis. Heaviest topic—drill daily.

Null handlers

NVL substitutes a value for null. NVL2 picks based on nullness of the first argument. NULLIF returns null when two values are equal. COALESCE returns the first non-null argument.

Conversion

TO_CHAR, TO_DATE, and TO_NUMBER need format models that match the string and session NLS. Mismatched separators raise invalid number/date errors.

Single-row helpers

UPPER, LOWER, SUBSTR, INSTR, LENGTH, ROUND, TRUNC, GREATEST/LEAST, NEXT_DAY, ADD_MONTHS, MONTHS_BETWEEN.

Group functions

AVG, SUM, MIN, MAX, and COUNT aggregate rows. COUNT(*) counts rows; COUNT(expr) skips null expr. Mix with non-aggregates only via GROUP BY (or analytics).

Displaying Data from Multiple Tables

10% editorial study emphasis. Join types and pitfalls.

Inner and outer

INNER JOIN keeps matches. LEFT/RIGHT OUTER JOIN preserves one side. FULL OUTER JOIN preserves both. Missing join predicates create Cartesian products.

Oracle (+)

Older equijoin syntax uses (+) on the deficient side. Prefer ANSI JOIN in new SQL, but recognize (+) on the exam.

Self-joins

Alias the same table twice for hierarchies such as employee/manager.

Outer-join trap

Filtering the optional table in WHERE can turn an outer join into an effective inner join. Keep optional-side predicates in ON when you need null-extended rows.

Using Subqueries to Solve Queries

5% editorial study emphasis. Nested queries.

Placement

Subqueries appear in WHERE, HAVING, FROM (inline views), and the SELECT list among other places.

Single vs multi-row

=, <, > need single-row subqueries. Multi-row results need IN, ANY, or ALL.

Correlation

A correlated subquery references outer columns and may run once per candidate outer row.

NULL in IN lists

A NULL in a NOT IN subquery can cause the predicate to return no rows. IN can still match a non-null value; filter NULLs deliberately or use a suitable EXISTS pattern.

Using SET Operators

5% editorial study emphasis. UNION family and MINUS.

UNION vs UNION ALL

UNION returns distinct rows from both queries. UNION ALL keeps duplicates and skips the distinct work.

INTERSECT and MINUS

INTERSECT returns common distinct rows. MINUS returns rows in the first query not in the second. The Oracle checklist names MINUS; current Oracle SQL also accepts EXCEPT as a synonym.

Shape rules

Corresponding expressions must match in count and compatible types. ORDER BY belongs at the end of the compound statement.

When to choose ALL

Auditing and staging loads often want UNION ALL so duplicate rows survive.

Managing Tables using DML statements

5% editorial study emphasis. Row changes.

INSERT / UPDATE / DELETE

INSERT adds rows. UPDATE changes matching rows. DELETE removes matching rows without dropping the table.

MERGE

MERGE conditionally inserts or updates (and can delete) based on a USING source and ON match.

Constraints

Foreign keys can block parent key changes that would orphan children. ON DELETE CASCADE applies to parent deletes, not key updates.

Transaction note

DML is transactional. COMMIT and ROLLBACK control durability. Extra Know your client’s autocommit setting in tools.

Managing Indexes Synonyms and Sequences

5% editorial study emphasis. Supporting schema objects.

Indexes

Speed selective filters and joins. They add write and storage cost. Useless if the column is never used.

Sequences

NEXTVAL advances and returns the next number; CURRVAL returns the current value after NEXTVAL in the session. Common for surrogate keys.

Synonyms

Private synonyms alias objects for the owner. Public synonyms are visible more broadly—watch name resolution surprises.

Resolution

Unqualified names can bind to a local object or a synonym depending on resolution rules. Qualify schema.object when clarity matters.

Use DDL to manage tables and their relationships

15% editorial study emphasis. Structure and constraints.

CREATE / ALTER / DROP

CREATE TABLE defines structure. ALTER TABLE adds columns and constraints. DROP TABLE removes the object. TRUNCATE empties rows quickly while keeping the table.

Constraints

PRIMARY KEY, UNIQUE, NOT NULL, CHECK, and FOREIGN KEY enforce integrity. ON DELETE CASCADE removes children when parents go.

Views

A view is a stored query. It can hide columns and simplify SQL. Not every join view is updatable.

CTAS

CREATE TABLE AS SELECT builds and loads a table from a query. Constraints and indexes are not all copied automatically.

Controlling User Access

5% editorial study emphasis. Privileges and roles.

GRANT / REVOKE

GRANT confers system or object privileges. REVOKE removes them. SELECT on a table does not imply DROP USER.

Roles

Roles group privileges for easier least-privilege administration. Grant roles to users instead of repeating direct grants.

Object privileges

Common object privileges include SELECT, INSERT, UPDATE, DELETE, and REFERENCES on specific objects.

Least privilege

Application accounts get only required statements on required objects. Prefer roles over sprawling direct grants.

Managing Objects with Data Dictionary Views and Data in Different Time Zones

5% editorial study emphasis. Metadata and datetime.

USER_ / ALL_ / DBA_

USER_ shows what you own. ALL_ adds accessible objects. DBA_ is database-wide and privileged.

Useful views

USER_TABLES, USER_CONSTRAINTS, USER_INDEXES, and USER_OBJECTS answer “what exists in my schema?”

Session datetime

CURRENT_DATE is DATE in the session time zone. CURRENT_TIMESTAMP is TIMESTAMP WITH TIME ZONE. LOCALTIMESTAMP is TIMESTAMP without time zone in the session TZ.

INTERVAL

INTERVAL DAY TO SECOND (and YEAR TO MONTH) store durations for datetime arithmetic—not calendar points.

Worked cases: predict rows, null behavior, and transaction effects

Use a disposable schema and tiny tables so you can calculate the expected result by hand. The purpose of these examples is to distinguish a valid statement from a statement that answers the intended question.

Preserve unmatched rows intentionally

Assume departments 10 and 20 exist, but only department 10 has employees. A LEFT JOIN from departments to employees preserves both departments. If you then put WHERE e.active = 'Y' after the join, the null-extended row for department 20 does not satisfy the filter. If the requirement is to list every department and count only active employees, put that employee condition in the join condition and count a non-null employee key.

SELECT d.id, COUNT(e.id) AS active_employees
FROM departments d
LEFT JOIN employees e
  ON e.department_id = d.id AND e.active = 'Y'
GROUP BY d.id;

COUNT(*) would count the preserved row even where no employee matched. COUNT(e.id) gives zero for that case when the employee key is non-null for real employees. Add a second employee and verify that the count changes without removing the empty department. This small dataset tests both cardinality and the treatment of missing matches.

Reason through NOT IN when nulls are present

Suppose a subquery returns the values 10 and NULL. Asking whether 20 is NOT IN that result does not produce a simple true result: comparison with the null introduces unknown. A WHERE clause retains true predicates, so the row may disappear unexpectedly. If the business question is “there is no matching department assignment,” a correlated NOT EXISTS often expresses the intent more directly. Check the treatment of null keys in the outer table as well; two formulations are not interchangeable unless their null semantics match the requirement.

Do not replace missing data with an arbitrary sentinel merely to force a comparison. A sentinel can collide with a valid value or change the meaning of “unknown.” State whether the application allows nulls, whether constraints enforce that rule, and what the report should display when the data is incomplete.

Separate DML rollback from DDL effects

In Oracle, issuing syntactically valid DDL can commit preceding transaction work before the DDL executes, even if that DDL later fails. Successful DDL is followed by an implicit commit as well. This differs from treating every statement as one freely reversible script. In a lab, update a test row, issue a DDL statement, then attempt a rollback and inspect the result. Keep schema changes separate from an application transaction whose earlier DML you expect to undo.

A savepoint is useful within its valid transaction boundary, but it does not survive a commit. Sequence values also should not be treated as a gap-free count of committed business records. Generate identifiers for uniqueness, and design any separate business numbering requirement explicitly. Inferring a missing sale from a gap in a sequence is not justified.

Make date and ordering assumptions visible

A text value such as “03/04/2026” is ambiguous without a format convention. Use an explicit format model when converting text, or an appropriate typed date literal for a known constant. For timestamped data, define which timezone determines the business day. Filtering “today” in one session timezone while reporting another timezone can move records across boundaries.

Finally, specify ORDER BY whenever the result needs a defined order. If several rows share the same sort value and the application requires stable pagination, add a deterministic tie-breaker such as a unique key. An index or a previous execution's row order does not promise the next result order.

Technical reference: Oracle SQL COMMIT and implicit DDL commits. Use the existing SQL language references above to test the independent query examples.

Eight checks in a disposable schema

Say what you expect to see before you change the data. Then drop the objects if they were only for practice.

A null-safe filter

Select rows where commission IS NULL and contrast with commission = NULL.

What to verify: IS NULL returns the null-commission rows; equality to NULL returns none.

A format-model round trip

TO_DATE a string with an explicit model, then TO_CHAR it back with Day and a trimmed comparison.

What to verify: conversion succeeds with matching models, and blank-padded Day does not break equality after FM/trim.

A LEFT JOIN count

Count employees per department including departments with zero employees.

What to verify: departments without employees appear with count 0, not disappear as with INNER JOIN.

A MINUS pair

Build two compatible queries and MINUS the second from the first; repeat with UNION ALL.

What to verify: MINUS drops overlaps; UNION ALL keeps duplicates that UNION would remove.

A MERGE upsert

MERGE a staging row into a target on primary key, updating when matched and inserting when not.

What to verify: one statement covers both paths; a second run updates instead of duplicating the key.

A sequence key

Create a sequence and insert with sequence.NEXTVAL as the surrogate key.

What to verify: NEXTVAL advances; CURRVAL matches the value just taken in the same session.

A foreign key cascade

Create parent/child tables with ON DELETE CASCADE and delete a parent.

What to verify: child rows disappear with the parent; without CASCADE the delete fails when children exist.

A dictionary and timestamp check

Query USER_CONSTRAINTS for your table and select CURRENT_DATE, CURRENT_TIMESTAMP, and LOCALTIMESTAMP.

What to verify: the constraint row appears under USER_, and the three datetime expressions return the expected types/forms.

Frequently asked questions

Which exam do these notes follow?

These notes follow Oracle AI Database SQL Associate exam 1Z0-171 and its eleven published topic areas. Percentages shown here are Certicab’s practice allocation, not Oracle exam weights. This is not 1Z0-071 Oracle Database SQL. Passing either exam does not award the other.

Which set operator removes rows in the first query that appear in the second?

MINUS. Oracle’s checklist names MINUS for set difference; current Oracle SQL also supports EXCEPT as a synonym. UNION removes duplicates across both queries; UNION ALL keeps duplicates.

How do NVL and NULLIF differ?

NVL(expr1, expr2) returns expr2 when expr1 is null. NULLIF(a, b) returns null when a equals b; otherwise it returns a. COALESCE returns the first non-null argument.

What do USER_, ALL_, and DBA_ dictionary views show?

USER_ views show objects you own. ALL_ views add objects you can access. DBA_ views show database-wide metadata and require privileged access.

Continue the Oracle SQL Associate study path

The overview, core notes, flashcards, and practice exams are all published.

Oracle SQL Associate hub →
Available

Overview

Exam format, the eleven topic areas, and a lab plan.

Available · You are here

Core Notes

Reference notes for SELECT, functions, joins, DDL, and privileges.

Available

Practice Exams

200 original questions across the eleven topic areas.

Official exam sources

Notes follow the Oracle Japan 1Z0-171 exam listing, the 1Z0-071 contrast page, the Oracle certification catalog, and the Oracle Database documentation (SQL Language Reference).

Apply concepts in the Scenario Workshop →