1Z0-071 — Oracle Database SQL Quick Review

Quick Review for Oracle Database SQL (1Z0-071): high-yield SQL rules, traps, decision points, and practice focus for Oracle exam candidates.

Quick Review purpose

This Quick Review is for candidates preparing for Oracle Oracle Database SQL (1Z0-071), exam code 1Z0-071. It is IT Mastery review support: use it to refresh high-yield SQL concepts, then validate your understanding with IT Mastery practice, original practice questions, topic drills, mock exams, and detailed explanations.

The exam rewards precision. Many missed questions are not caused by unfamiliar SQL, but by small details: NULL behavior, alias scope, join output, aggregate rules, datatype conversion, transaction control, and Oracle-specific syntax.

High-yield review map

AreaKnow coldCommon trap
SELECT statementsClause order, aliases, sorting, filteringUsing a column alias in WHERE
NULL handlingIS NULL, NVL, COALESCE, NULLIF, NVL2Comparing with = NULL or <> NULL
Single-row functionsCharacter, number, date, conversion, conditionalConfusing ROUND and TRUNC; implicit conversion surprises
Group functionsCOUNT, SUM, AVG, MIN, MAX, GROUP BY, HAVINGSelecting non-grouped columns with aggregates
JoinsInner, outer, self, cross, ON, USING, natural joinsNatural joins matching unintended same-name columns
SubqueriesSingle-row, multiple-row, correlated, EXISTSNOT IN with NULL returning no expected rows
Set operatorsUNION, UNION ALL, INTERSECT, MINUSWrong column count or incompatible datatype groups
DML and transactionsINSERT, UPDATE, DELETE, COMMIT, ROLLBACK, SAVEPOINTForgetting DDL causes implicit commit behavior
DDL and objectsTables, constraints, views, sequences, indexes, synonymsAssuming a synonym grants privileges
PrivilegesGRANT, REVOKE, system vs object privilegesConfusing WITH GRANT OPTION and WITH ADMIN OPTION

Core SELECT processing

Logical clause order

Memorize the logical processing order, not just the written syntax.

Written orderLogical roleCandidate reminder
SELECTChoose expressions to displayAliases are created here
FROMIdentify source tables/viewsJoins are resolved here
WHEREFilter individual rowsCannot use aggregate functions directly here
GROUP BYForm groupsEvery non-aggregate selected expression must be grouped
HAVINGFilter groupsUse for aggregate conditions
ORDER BYSort final resultCan use select-list aliases

Logical evaluation is commonly understood as: FROMWHEREGROUP BYHAVINGSELECTORDER BY.

Alias rules that often appear in exam questions

LocationCan use select-list alias?Example issue
ORDER BYUsually yesORDER BY annual_salary works if alias is in select list
WHERENoAlias does not exist yet logically
GROUP BYDo not rely on it for 1Z0-071-style questionsGroup by the expression or column
HAVINGDo not rely on select aliasUse the aggregate expression

If a question gives a calculated alias such as salary * 12 annual_salary, expect a trap where the alias is reused too early.

Filtering, sorting, and row conditions

Predicates and operators

NeedUseWatch for
Exact match=Case-sensitive for character data unless transformed
RangeBETWEEN low AND highInclusive on both ends
List matchIN (...)Equivalent to multiple OR checks
Pattern matchLIKE% means any length; _ means one character
Null testIS NULL / IS NOT NULLNever = NULL
Negative logicNOT, <>, !=, NOT INNULL can change expected results
Combined logicAND, ORAND has higher precedence than OR

Use parentheses when a condition mixes AND and OR. The exam often checks whether you know how a condition is actually evaluated.

NULL rules

NULL means unknown or unavailable, not zero, blank, or false.

ExpressionResult concept
salary + NULLNULL
commission_pct = NULLNot true; use IS NULL
commission_pct <> NULLNot true; use IS NOT NULL
NVL(commission_pct, 0)Replace null with 0
COALESCE(a, b, c)First non-null expression
NULLIF(a, b)Returns NULL if a = b, else a
NVL2(expr, value_if_not_null, value_if_null)Two-branch null handling

Sorting rules

SyntaxMeaning
ORDER BY col ASCAscending; often default
ORDER BY col DESCDescending
ORDER BY 2Sort by second select-list item
ORDER BY aliasSort by select-list alias
NULLS FIRST / NULLS LASTExplicit null placement

If a query does not include ORDER BY, do not assume output order.

Single-row functions

Single-row functions return one result per input row. They can be nested, used in SELECT, WHERE, and ORDER BY, and often appear in conversion or date questions.

Character functions

FunctionPurposeExample result idea
LOWER, UPPER, INITCAPChange caseUseful for case-insensitive comparisons
CONCAT(a,b)Concatenate two valuesSimilar to `a
SUBSTR(char, start, length)Extract part of a stringOracle positions are character-based
LENGTH(char)Count charactersSpaces count
INSTR(char, search)Find positionReturns position of search string
LPAD, RPADPad to a lengthFormatting output
TRIMRemove leading/trailing charactersDefault trims spaces
REPLACEReplace matching textCharacter substitution

Candidate trap: CONCAT takes two arguments, while || can chain multiple values.

Number functions

FunctionPurposeTrap
ROUND(number, n)Round to n decimal placesNegative n rounds left of decimal
TRUNC(number, n)Truncate to n decimal placesDoes not round
MOD(m, n)RemainderUseful for divisibility checks

Date functions

Oracle DATE values include date and time components.

FunctionPurposeReview point
SYSDATECurrent database server date/timeIncludes time
MONTHS_BETWEEN(d1, d2)Months between datesCan return fractional months
ADD_MONTHS(date, n)Add monthsHandles month boundaries
NEXT_DAY(date, char)Next named weekdayDepends on date language settings
LAST_DAY(date)Last day of monthHigh-yield date function
ROUND(date, fmt)Round date to format unitFormat matters
TRUNC(date, fmt)Truncate date to format unitCommon for removing time portion
EXTRACT(part FROM date)Extract year, month, day, etc.Syntax differs from normal functions

Conversion functions and format models

FunctionConvertsTypical use
TO_CHAR(date, fmt)Date to formatted textDisplay dates
TO_CHAR(number, fmt)Number to formatted textCurrency, decimal display
TO_DATE(char, fmt)Text to dateAvoid implicit date conversion
TO_NUMBER(char, fmt)Text to numberControlled numeric conversion

High-yield format elements include YYYY, YY, RR, MM, MON, MONTH, DD, DAY, DY, HH, HH24, MI, SS, and numeric elements such as 9, 0, comma, decimal, and currency symbols.

Candidate trap: implicit conversion may work in one environment and fail in another because date and numeric formats can depend on session settings. For exam questions, explicit conversion with the correct format model is safer.

Conditional expressions

ExpressionUseNotes
CASEStandard conditional logicSupports searched and simple forms
DECODEOracle-specific conditional comparisonOften shorter but less flexible
NVLReplace NULLTwo arguments
COALESCEFirst non-nullShort-circuits conceptually
NULLIFReturn null when equalUseful for avoiding divide-by-zero patterns
NVL2Null-dependent branchingThree arguments

Group functions and aggregation

Aggregate function essentials

FunctionWhat it doesNull behavior
COUNT(*)Counts rowsIncludes rows with nulls
COUNT(expr)Counts non-null expression valuesIgnores nulls
COUNT(DISTINCT expr)Counts distinct non-null valuesIgnores nulls
SUM(expr)Adds valuesIgnores nulls
AVG(expr)Averages valuesIgnores nulls
MIN(expr)Lowest valueIgnores nulls
MAX(expr)Highest valueIgnores nulls

Important difference:

  • AVG(commission_pct) averages only rows where commission_pct is not null.
  • AVG(NVL(commission_pct, 0)) treats null commission values as zero.

GROUP BY decision rule

If the SELECT list contains both aggregate expressions and non-aggregate expressions, every non-aggregate expression must be included in the GROUP BY.

Select-list itemMust be in GROUP BY?
department_idYes, if selected with aggregates
UPPER(job_id)Yes, as the expression if selected with aggregates
COUNT(*)No
AVG(salary)No
Literal such as 'Total'No

WHERE vs HAVING

ClauseFiltersCan use group functions?
WHERERows before groupingNo
HAVINGGroups after groupingYes

Example decision:

  • Need employees with salary > 10000 before calculating department average? Use WHERE.
  • Need departments with AVG(salary) > 10000? Use HAVING.

Joins

Join types

Join typePurposeTrap
Inner joinRows with matching valuesNonmatching rows disappear
Left outer joinAll rows from left table plus matchesPredicate placement can turn it into an inner join
Right outer joinAll rows from right table plus matchesSame predicate trap
Full outer joinAll matching and nonmatching rows from both sidesNulls appear for missing side
Self-joinTable joined to itselfRequires aliases
Cross joinCartesian productUsually wrong unless intentional
Natural joinJoins same-name columns automaticallyDangerous if multiple same-name columns exist

ON, USING, and natural joins

SyntaxBest useWatch for
JOIN ... ON t1.col = t2.colMost explicit and safestQualify columns clearly
JOIN ... USING (col)Same column name in both tablesThe joined column is referenced once
NATURAL JOINQuick join on all same-name columnsCan silently join on unintended columns

For exam safety, prefer reasoning with ON because it makes the join condition explicit.

Outer join predicate trap

A common missed question places an outer join in the FROM clause but then filters the optional table in the WHERE clause.

PatternEffect
Left join plus WHERE right_table.status = 'A'Often removes null-extended rows
Left join with condition in ON clausePreserves left rows while limiting matches
WHERE right_table.col IS NULL after left joinFinds unmatched rows

When reading an outer join question, ask: “Is this condition part of the match, or is it filtering the final result?”

Subqueries

Subquery types

TypeReturnsOperators
Single-row subqueryOne row, one column=, >, <, >=, <=, <>
Multiple-row subqueryMultiple rows, one columnIN, ANY, ALL
Multiple-column subqueryMultiple columnsTuple-style comparisons
Correlated subqueryDepends on outer query rowOften used with EXISTS
Scalar subqueryOne valueCan appear where a single expression is valid

Operator decision table

If the subquery can return…Use
Exactly one valueSingle-row operator such as =
Multiple valuesIN, ANY, ALL, or EXISTS
Existence only mattersEXISTS
Nonexistence mattersNOT EXISTS is often safer than NOT IN with nullable data

NOT IN and NULL

This is one of the highest-yield traps.

If a subquery used with NOT IN returns a NULL, the comparison can become unknown and return no rows that you expected. When nulls are possible, NOT EXISTS is often the safer logical pattern.

Correlated subquery reading method

For each row in the outer query:

  1. Substitute the outer row’s relevant value into the inner query.
  2. Evaluate the inner query.
  3. Decide whether the outer row qualifies.

This mental model helps with questions using department averages, maximum salary by group, or existence checks.

Set operators

Set operators combine result sets from separate queries.

OperatorResult
UNIONCombined distinct rows
UNION ALLCombined rows including duplicates
INTERSECTRows common to both result sets
MINUSRows in first result set but not second

Set operator rules

RuleCandidate reminder
Same number of columnsEach query must return matching column count
Compatible datatype groupsCharacter with character, numeric with numeric, etc.
Column namesTaken from the first query
ORDER BYAppears at the end for the combined result
DuplicatesRemoved unless UNION ALL is used
Mixed operatorsUse parentheses to make intent clear

Do not assume each individual query can have its own final sort. The final ORDER BY applies to the combined result.

DML and transaction control

DML statements

StatementPurposeExam focus
INSERTAdd rowsColumn order, default values, subquery inserts
UPDATEModify rowsMissing WHERE updates all qualifying rows
DELETERemove rowsMissing WHERE deletes all qualifying rows
MERGEInsert/update based on match logicUnderstand match vs not-match behavior if tested

Transaction control

StatementEffect
COMMITMakes transaction changes permanent
ROLLBACKUndoes uncommitted transaction changes
SAVEPOINT nameMarks a point to roll back to
ROLLBACK TO SAVEPOINT nameUndoes changes after that savepoint

High-yield distinction:

ActionTransaction impact
DML such as INSERT, UPDATE, DELETERequires transaction control
DDL such as CREATE, ALTER, DROP, TRUNCATEHas implicit commit behavior in Oracle
DELETEDML; can be rolled back before commit
TRUNCATEDDL; not the same transactional behavior as DELETE

Candidate trap: DELETE FROM table_name and TRUNCATE TABLE table_name may both remove rows, but they are not equivalent.

DDL, data types, and constraints

Common Oracle data types

Data typeUseReview point
VARCHAR2(size)Variable-length character dataCommon text type
CHAR(size)Fixed-length character dataPads to fixed length
NUMBER(p,s)Numeric dataPrecision and scale matter
DATEDate and time to secondsNot just date-only
TIMESTAMPMore precise date/timeFractional seconds
CLOBLarge character dataLarge text
BLOBBinary large objectBinary data

Constraint types

ConstraintPurposeKey trap
NOT NULLColumn must have valueColumn-level only in typical syntax
UNIQUEValues must be uniqueMultiple nulls may be allowed depending on columns
PRIMARY KEYUnique row identifierImplies uniqueness and not null
FOREIGN KEYEnforces parent-child relationshipChild value must match parent or be null if allowed
CHECKEnforces conditionCannot rely on invalid expressions
DEFAULTSupplies value when omittedNot the same as inserting explicit NULL

Foreign key delete actions

ClauseEffect
No special clauseParent delete blocked if child rows exist
ON DELETE CASCADEDeletes dependent child rows
ON DELETE SET NULLSets child foreign key values to null

Schema objects

Views

A view is a stored query. It can simplify complex joins, restrict displayed columns, or present derived data.

View conceptReview point
Simple viewOften based on one table; may be updatable if rules are met
Complex viewIncludes joins, groups, functions, or aggregates; update restrictions likely
WITH CHECK OPTIONPrevents changes through the view that violate the view condition
WITH READ ONLYPrevents DML through the view

Candidate trap: a view does not automatically store a separate copy of ordinary query data like a table. It is generally a query definition unless materialized view concepts are explicitly involved.

Sequences

Sequences generate numeric values, commonly for surrogate keys.

PseudocolumnMeaning
sequence_name.NEXTVALGets next sequence value
sequence_name.CURRVALCurrent value in session after NEXTVAL has been used

Review sequence options conceptually: START WITH, INCREMENT BY, MAXVALUE, MINVALUE, CYCLE, NOCYCLE, CACHE, and NOCACHE.

Candidate traps:

  • Sequence numbers can have gaps.
  • Rolling back a transaction does not necessarily “put back” a sequence value.
  • CURRVAL is not available in a session before that session has used NEXTVAL.

Indexes and synonyms

ObjectPurposeTrap
IndexSpeeds access paths and supports uniquenessToo many indexes can affect DML overhead conceptually
Unique indexEnforces uniqueness when used for constraintsConstraint and index are related but not identical concepts
SynonymAlternative name for an objectDoes not grant object privileges
Private synonymAvailable to its ownerName scope matters
Public synonymAvailable database-wide by nameStill requires privileges

Data dictionary and metadata

Oracle data dictionary views are frequently grouped by prefix.

PrefixMeaning
USER_Objects owned by the current user
ALL_Objects accessible to the current user
DBA_Database-wide administrative views, if privileged

Examples you may see conceptually include table, column, constraint, view, sequence, index, and synonym metadata. Know the difference between owning an object and merely having access to it.

Privileges and security basics

Privilege types

TypeExamplesGranted on
System privilegeCREATE SESSION, CREATE TABLECapability in the database
Object privilegeSELECT, INSERT, UPDATE, DELETESpecific object
RoleNamed collection of privilegesGranted to users or other roles depending on rules

Grant option distinctions

ClauseApplies toMeaning
WITH GRANT OPTIONObject privilegesRecipient can grant that object privilege to others
WITH ADMIN OPTIONSystem privileges or rolesRecipient can administer/grant it further

Candidate trap: revoking a privilege can have cascading effects for object privileges granted onward through WITH GRANT OPTION.

Common 1Z0-071 mistake checklist

Before answering, check these items:

  1. Is there an ORDER BY? If not, do not assume row order.
  2. Is NULL involved? Replace normal comparison thinking with three-valued logic.
  3. Is an alias used too early? WHERE cannot see select-list aliases.
  4. Are aggregate and non-aggregate columns mixed? Check GROUP BY.
  5. Is the filter row-level or group-level? Choose WHERE vs HAVING.
  6. Is the join natural? Look for unintended same-name columns.
  7. Is an outer join filtered in WHERE? It may remove null-extended rows.
  8. Can a subquery return multiple rows? Use the right operator.
  9. Can a NOT IN subquery return null? Consider the null trap.
  10. Do set operator queries align? Same column count and compatible datatype groups.
  11. Is a date literal or conversion format ambiguous? Prefer explicit conversion.
  12. Is the statement DML or DDL? Transaction behavior differs.
  13. Does a synonym exist? That does not mean the user has privileges.
  14. Is a sequence expected to be gap-free? Do not assume that.
  15. Is COUNT(*) being confused with COUNT(column)? Null handling differs.

Fast decision tables

Which clause should solve the problem?

RequirementLikely clause
Choose displayed columns or expressionsSELECT
Choose source tablesFROM
Connect tablesJOIN ... ON or USING
Filter rows before groupingWHERE
Group rowsGROUP BY
Filter groupsHAVING
Sort final outputORDER BY

Which SQL feature should solve the problem?

RequirementFeature
Replace null commission with zeroNVL or COALESCE
Display date as textTO_CHAR
Convert text to dateTO_DATE
Compare to department averageSubquery or analytic logic if provided
Return departments with no employeesOuter join plus null check or NOT EXISTS
Combine two result sets and remove duplicatesUNION
Combine two result sets and keep duplicatesUNION ALL
Find rows in first query but not secondMINUS
Generate new numeric key valuesSequence
Prevent invalid child rowsForeign key constraint
Restrict DML through a viewWITH CHECK OPTION or WITH READ ONLY

Practice plan after this review

Use this page as a final concept pass, then move into active recall:

  1. Topic drills: Work in focused sets: joins, subqueries, group functions, DML, DDL, and set operators.
  2. Original practice questions: Prioritize questions that require predicting output or identifying invalid SQL.
  3. Detailed explanations: For every missed item, identify the exact rule: alias scope, null behavior, datatype conversion, grouping rule, transaction behavior, or privilege rule.
  4. Mixed question bank sessions: After topic drills, use mixed sets to practice switching between concepts under time pressure.
  5. Mock exams: Use full-length practice only after your weak topics are improving; otherwise, mock exams mostly confirm the same gaps.

Final quick review routine

In your last study block before more practice, review in this order:

  1. NULL rules and conditional functions.
  2. Group functions, GROUP BY, and HAVING.
  3. Join types and outer join predicate placement.
  4. Subquery operators, especially IN, ANY, ALL, EXISTS, and NOT IN.
  5. Set operator alignment rules.
  6. DML vs DDL transaction behavior.
  7. Constraints, views, sequences, synonyms, and privileges.

Next step: move from reading to doing—start a focused 1Z0-071 question bank session with topic drills and detailed explanations, then use your missed questions to drive the next review pass.

Continue in IT Mastery

Use this Quick Review as a final concept map, then move into IT Mastery for focused topic drills, mixed practice sets, timed mock exams, and detailed explanations. The practice questions are original IT Mastery practice items; they are not official Oracle questions, copied live-exam content, or exam dumps.

Browse Certification Practice Tests by Exam Family