Exam Information
Free practice questions with explanations
Oracle 1Z0-071 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 20
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Using Non equijoins
A logistics analyst at a freight company must assign each shipment in the SHIPMENTS table to a pricing band stored in the PRICE_BANDS table, which has columns BAND_CODE, MIN_WEIGHT and MAX_WEIGHT. The bands do not overlap, and a shipment weight falls within exactly one band. Shipments whose weight is outside every band must still appear in the report with a NULL band code. The report must be produced in a single SELECT statement, with no equality condition available between the two tables. Which query meets these requirements?
Correct Answer: BExplanationA range condition between MIN_WEIGHT and MAX_WEIGHT is a non-equijoin, and the BETWEEN predicate placed in the ON clause of a LEFT OUTER JOIN keeps every shipment even when no band matches, returning NULL for BAND_CODE. The comma-join with a WHERE clause in the third choice is an inner join, so unmatched shipments silently disappear, which breaks the stated requirement. The first choice relies on an equality test that cannot reflect banded weights and drops unmatched rows as well. The fourth choice uses USING on a column that does not exist in PRICE_BANDS and would fail at parse time, and it also preserves bands rather than shipments.
-
2 Question 2 Drag and drop Managing Synonyms
A DBA at a university manages a schema named REG_OWNER whose tables are queried by reporting users in schema RPT_USER. The DBA must make REG_OWNER tables accessible under short names without changing any application SQL, and must make a shared lookup table available to every schema in the database. Match each requirement to the object type that satisfies it.
Drag each item onto its matching target. On a phone: tap an item, then tap a target.
Alias that must reference a table that does not yet exist in the databaseShort private alias for REG_OWNER.COURSES visible only to RPT_USERDatabase-wide alias for a shared lookup table usable by all schemasSynonym created with no target validation at creation timeMaterialized viewPublic synonymSequencePrivate synonym owned by RPT_USERCorrect Answer:- Short private alias for REG_OWNER.COURSES visible only to RPT_USER → Private synonym owned by RPT_USER
- Database-wide alias for a shared lookup table usable by all schemas → Public synonym
- Alias that must reference a table that does not yet exist in the database → Synonym created with no target validation at creation time
ExplanationA private synonym is created in the user's own schema and only that user can resolve it, which satisfies the short-name requirement for RPT_USER without touching application SQL. A public synonym is owned by PUBLIC and is visible to every schema, matching the shared lookup requirement. Oracle permits creating a synonym even when the referenced object does not exist yet, because the target is only resolved at execution time, so that requirement maps to the deferred-validation synonym behaviour. A materialized view stores query results and does not supply name aliasing, and a sequence generates numbers, so neither fits any stated requirement.
-
3 Question 3 Dropdown Managing Database Transactions
A payroll developer at a hospital wants a batch that applies a set of salary updates and then discards only the last update if a validation check fails, while keeping the earlier updates pending so they can still be committed. The developer runs the statements in SQL*Plus with autocommit off. Complete the transaction script by selecting the correct value for each blank.
Choose the correct value for each blank.
UPDATE employees SET salary = salary * 1.02 WHERE dept_id = 10; SAVEPOINT before_dept20; UPDATE employees SET salary = salary * 1.05 WHERE dept_id = 20; TO SAVEPOINT before_dept20; ;Correct Answer:UPDATE employees SET salary = salary * 1.02 WHERE dept_id = 10; SAVEPOINT before_dept20; UPDATE employees SET salary = salary * 1.05 WHERE dept_id = 20; ROLLBACK TO SAVEPOINT before_dept20; COMMIT;
ExplanationRolling back to a named savepoint undoes only the work performed after that savepoint while leaving earlier changes uncommitted in the same transaction, which is exactly what the validation failure requires. The subsequent COMMIT then makes the retained department 10 update permanent. RESET and REVERT are not Oracle transaction keywords and would produce a syntax error. END is not a valid statement in Oracle SQL, and SAVE is a SQL*Plus-independent word that does not finalise a transaction, so it cannot replace COMMIT.
-
4 Question 4 Single choice Retrieving Data using the SQL SELECT Statement
A reporting analyst at a logistics company queries the ORDERS table to produce a customer contact extract. The discount column DISCOUNT_PCT is NULL for orders that had no discount applied, and the analyst wants the output to show the value 0 for those rows so that the arithmetic total column NET_AMOUNT = AMOUNT - AMOUNT * DISCOUNT_PCT / 100 does not return NULL. The analyst also needs the column heading to read 'Net Amount' in the result set. Which SELECT expression meets both requirements?
Correct Answer: BExplanationNVL(DISCOUNT_PCT, 0) substitutes 0 for NULL so the arithmetic yields a number rather than NULL, and a column alias containing a space must be a double-quoted identifier. Single quotes denote a literal string, so the alias in option A is not a valid column alias. Option C is not valid syntax because NVL requires a comma-separated argument list and the alias is unquoted. Option D uses NULLIF, which returns NULL when its two arguments are equal, so it converts zeros to NULL rather than the reverse.
-
5 Question 5 Single choice Controlling User Access
A database administrator at a healthcare provider must let the BILLING_CLERK role's members read the PATIENT_INVOICES table owned by schema FIN, but the clerks must not be able to alter the table structure or grant access to other users. The security policy requires that the grant be made by the owner so that it is auditable under the schema owner's account. Which statement should the schema owner FIN execute?
Correct Answer: DExplanationSELECT is an object privilege, and granting it on a specific table to a role gives exactly the read access required without allowing structural changes or re-delegation. SELECT ANY TABLE in option B is a system privilege that grants read access across every schema, far beyond the single table. Option C adds WITH GRANT OPTION, which lets the clerks redistribute access, violating the policy. Option D names READ, which is not a valid object privilege in Oracle Database.
-
6 Question 6 Multiple choice Displaying Data from Multiple Tables
A retail company maintains EMPLOYEES and DEPARTMENTS tables. Management wants a single report that lists every department, including departments that currently have no employees, along with the employees who belong to each department. Employees whose DEPARTMENT_ID is NULL must not appear in the report because they are contractors tracked elsewhere. The developer must avoid a Cartesian product and keep the query standards-compliant. Which two statements meet these requirements? (Choose two.)
Correct Answer: C, DExplanationA LEFT OUTER JOIN keeps every row from DEPARTMENTS, so departments without employees appear with NULL employee names, and the ANSI form in option A is the standards-compliant choice. The Oracle (+) form in option B places the outer marker on the employee side of the department-to-employee condition, which yields the same department-preserving result. Option C is a right outer join that preserves EMPLOYEES, so departments with no staff disappear. Option D is an unrestricted Cartesian product. Option E is a natural join, which matches on every common column name and drops departments without employees.
-
7 Question 7 Order list Managing Database Transactions
A payroll clerk at a manufacturing firm is correcting a salary adjustment that was entered in the wrong department. The change touched three rows in the EMPLOYEES table, and the clerk discovers the mistake before anyone else reads the data. The clerk wants to make the corrected update permanent without affecting any other session's work in progress, and to keep a savepoint so that only the second row correction can be rolled back if needed. Arrange the steps in the correct order.
Drag the steps into the correct order, or use the arrows.
- Issue COMMIT to make the remaining corrected changes permanent
- Issue UPDATE for the first employee row correction
- Create a savepoint named before_row_two
- Issue UPDATE for the second employee row correction
- Roll back to savepoint before_row_two if the second change is wrong
Correct Answer:- Issue UPDATE for the first employee row correction
- Create a savepoint named before_row_two
- Issue UPDATE for the second employee row correction
- Roll back to savepoint before_row_two if the second change is wrong
- Issue COMMIT to make the remaining corrected changes permanent
ExplanationThe first UPDATE must precede any savepoint that is meant to protect the second change, so the savepoint is created after the initial correction and before the second update. The rollback to the savepoint can only occur after the second update has been issued, and COMMIT ends the transaction, which can only happen after all DML is complete. Placing the savepoint before the first update, or committing before the rollback, would make the partial rollback impossible or pointless. The ordering shown reflects the true dependency between DML, savepoints and the terminating commit.
-
8 Question 8 Single choice Managing Tables using DML statements
A data steward at an insurance company needs to load new policy records into the POLICIES table. For each incoming record, if a policy with the same POLICY_ID already exists, its PREMIUM and STATUS columns must be updated to the incoming values; otherwise the record must be inserted as a new row. The batch is loaded from the staging table POLICY_STAGE, and the steward wants a single statement that avoids a separate existence check and minimises round trips. Which statement should be used?
Correct Answer: CExplanationThe MERGE statement performs conditional update-or-insert in one pass, and option B places the UPDATE under WHEN MATCHED and the INSERT under WHEN NOT MATCHED, which is exactly the required logic. Option A uses ON DUPLICATE KEY UPDATE, which is MySQL syntax and not valid in Oracle Database. Option C only updates and would silently skip new policies. Option D reverses the branches, so it attempts to insert rows that already exist and update rows that do not.
-
9 Question 9 Drag and drop Using Conversion Functions and Conditional Expressions
A finance developer maintains a report in which several columns contain mixed data types and inconsistent formats. Each of the following requirements must be addressed by exactly one conversion or conditional function. Match each requirement to the function that meets it.
Drag each item onto its matching target. On a phone: tap an item, then tap a target.
Convert a stored string such as 15-JAN-2024 into a DATE value for date arithmeticFormat a NUMBER column with a leading currency symbol and two decimal places for displayReturn the first non-null value from a list of three phone number columnsConvert a string of digits held in a VARCHAR2 column into a numeric value for summationTO_NUMBERCOALESCEDECODETO_CHARTO_DATENULLIFCorrect Answer:- Convert a stored string such as 15-JAN-2024 into a DATE value for date arithmetic → TO_DATE
- Format a NUMBER column with a leading currency symbol and two decimal places for display → TO_CHAR
- Convert a string of digits held in a VARCHAR2 column into a numeric value for summation → TO_NUMBER
- Return the first non-null value from a list of three phone number columns → COALESCE
ExplanationTO_DATE parses a character string into a DATE according to a format model, which is the only function listed that performs that particular conversion. TO_CHAR renders a number or date as formatted text, which is the display requirement. TO_NUMBER converts character digits into a numeric value so that arithmetic and aggregation work. COALESCE returns the first non-null expression in its argument list, matching the phone number requirement. NULLIF returns NULL when two expressions are equal and is not used for returning the first non-null, and DECODE performs value-based branching, which does not fit any listed requirement.
-
10 Question 10 Single choice Managing Indexes Synonyms and Sequences
A database administrator at a telecom provider manages the CUSTOMERS table, which is queried mostly through a case-insensitive lookup on LAST_NAME using UPPER(LAST_NAME) = :name. The current B-tree index on LAST_NAME is not used by the optimizer, and the query plan shows a full table scan. The DBA needs to improve this query without changing application SQL and without adding redundant storage to unrelated columns. Which action is the most appropriate?
Correct Answer: BExplanationA function-based index on UPPER(LAST_NAME) stores the index keyed on exactly the expression used in the predicate, so the optimizer can use an index range scan without changing the application SQL. A bitmap index is meant for low-cardinality columns and would not address the function mismatch. A reverse key index is intended to reduce hot spots on sequential keys and does not help a function-wrapped predicate. A synonym only provides an alternate name for the same object and does not alter the access path.
-
11 Question 11 Multiple choice Use DDL to manage tables and their relationships
A developer at a university is creating a COURSE_ENROLLMENT table that references STUDENTS and COURSES. The enrollment must not contain duplicate student-course pairs, a missing grade value is acceptable, and each enrollment must reference an existing student. Foreign key integrity must be enforced at the database level, and the design must support the rule that a student cannot be deleted while enrollments exist. Which two table definitions meet these requirements? (Choose two.)
Correct Answer: B, CExplanationOption A defines a composite primary key, which prevents duplicate pairs, and a foreign key without an ON DELETE clause, which blocks deletion of a student who still has enrollments. Option D is the nearest alternative, but it is the only other choice that keeps the required deletion protection; its primary key is on student_id alone, which would forbid a student from enrolling in more than one course, so it is wrong on the duplicate-pair rule and must not be selected. Therefore the correct pair is A together with the variant that enforces uniqueness through a composite key with no cascade. Options B and C use ON DELETE CASCADE, which silently deletes enrollments when a student is removed and violates the deletion rule. Option E sets the foreign key column to NULL on delete, which conflicts with the NOT NULL requirement on student_id and also breaks the deletion rule.
-
12 Question 12 Dropdown Managing Data in Different Time Zones
A support analyst at a global software vendor stores all event timestamps in the EVENTS table in the database time zone. The analyst needs to report events in the time zone of the customer's session and to calculate the duration between two timestamps as an interval. Complete the statements by selecting the correct value for each blank.
Choose the correct value for each blank.
SELECT event_id, (event_ts AT TIME ZONE 'UTC') FROM events WHERE event_ts > - INTERVAL '2' DAY;Correct Answer:SELECT event_id, CURRENT_TIMESTAMP (event_ts AT TIME ZONE 'UTC') FROM events WHERE event_ts > CURRENT_TIMESTAMP - INTERVAL '2' DAY;
ExplanationCURRENT_TIMESTAMP returns a TIMESTAMP WITH TIME ZONE reflecting the session time zone, and the AT TIME ZONE clause converts the stored timestamp into the requested zone, so it is the right function for converting per-session. SYSTIMESTAMP is also a timezone-aware value, but it reflects the database time zone rather than the session, which conflicts with the reporting requirement. Option LOCALTIMESTAMP returns a TIMESTAMP without a time zone offset, and CURRENT_DATE returns only a date, so neither supports the interval arithmetic cleanly. TO_DATE is a conversion function that requires a string argument and cannot stand alone in that position.
-
13 Question 13 Single choice Managing Views
A developer at a bank creates a view over the ACCOUNTS table to let a branch supervisor role see only accounts in their own branch. The view must not allow a row to be inserted, updated or deleted in a way that moves it outside the supervisor's branch, and the view must be created so that Oracle enforces this restriction rather than relying on application code. The supervisor filters the view by BRANCH_ID = 110 in the view definition. Which clause must the developer add to the view definition?
Correct Answer: CExplanationWITH CHECK OPTION makes Oracle reject any insert or update through the view that would produce a row failing the view's WHERE predicate, so a row cannot be moved out of branch 110. WITH READ ONLY would prevent all DML, which removes the supervisor's ability to update accounts in their branch and contradicts the stated need. FORCE allows a view to be created even when its base objects are missing and does not enforce anything about DML. WITH GRANT OPTION is a privilege clause for granting object privileges and has no role in controlling row membership.
-
14 Question 14 Order list Managing Objects with Data Dictionary Views
A DBA at a logistics company must find out why a newly created index named IDX_SHIP_DATE is not being chosen by the optimizer for queries on the SHIPMENTS table, and must confirm the index's current status and the columns it covers using only data dictionary views available to the schema owner. Arrange the steps in the correct order.
Drag the steps into the correct order, or use the arrows.
- Gather fresh optimizer statistics on SHIPMENTS and rerun the explain plan
- Query USER_TABLES to check statistics and the last analyzed date for SHIPMENTS
- Query USER_INDEXES to confirm the index exists and check its STATUS column
- Query USER_IND_COLUMNS to confirm which columns the index covers
Correct Answer:- Query USER_INDEXES to confirm the index exists and check its STATUS column
- Query USER_IND_COLUMNS to confirm which columns the index covers
- Query USER_TABLES to check statistics and the last analyzed date for SHIPMENTS
- Gather fresh optimizer statistics on SHIPMENTS and rerun the explain plan
ExplanationThe DBA must first verify the index exists and is usable, which USER_INDEXES reveals through its STATUS column, before investigating its composition. USER_IND_COLUMNS then confirms the indexed columns, which determines whether the index can satisfy the predicate. Checking table statistics via USER_TABLES comes next, since stale or missing statistics commonly cause the optimizer to ignore an index. Gathering statistics and re-testing the plan is the final corrective step, and it cannot logically precede the diagnostic queries.
-
15 Question 15 Single choice Reporting Aggregated Data Using Group Functions
A sales analyst at a wholesaler wants a report of regional product categories whose total order value exceeds 500000, but only for orders placed in 2023, and the category list must be sorted by total value in descending order. The analyst has written the query and the database returns an error indicating that a group function is not allowed in the WHERE clause. Which change corrects the query while meeting every requirement?
Correct Answer: CExplanationRow-level filters such as the year condition belong in WHERE, which is evaluated before grouping, while a condition on an aggregate like SUM must be placed in HAVING, which is evaluated after groups form. Option A places the aggregate condition in WHERE, which is the very error reported. Option C misuses GROUP BY and ORDER BY, which cannot filter aggregates. Option D still leaves the aggregate in a WHERE context, which Oracle rejects.
-
16 Question 16 Single choice Using SET Operators
A reporting team has two result sets: active customer IDs from the ONLINE_ORDERS table and active customer IDs from the STORE_ORDERS table. The team needs a list of customers who placed orders through both channels, with duplicates removed, sorted by customer ID. Customer IDs are NUMBER values in both tables. Which query meets the requirement?
Correct Answer: BExplanationINTERSECT returns only the rows present in both queries, which identifies customers ordering through both channels, and it removes duplicates automatically. UNION returns customers from either channel, which is broader than required. MINUS returns customers in the online set who are absent from the store set, the opposite of the requirement. UNION ALL keeps duplicates and returns everyone from both sets, so it fails on both filtering and deduplication.
-
17 Question 17 Single choice Using Subqueries to Solve Queries
A developer at a manufacturing company must reduce the stock level of each product in the PRODUCTS table by the quantity recorded for it in the PENDING_SHIPMENTS table, but only for products that have at least one pending shipment. The developer wants a single UPDATE statement that references the outer product row inside the subquery and must not change products without pending shipments. Which statement is correct?
Correct Answer: DExplanationThe correlated subquery in option A references p.product_id from the outer UPDATE, so each product receives its own sum of pending quantities, and the EXISTS filter limits the update to products with pending shipments. Option B uses an uncorrelated SUM over the whole table, so every product receives the total of all shipments. Option C returns a single row per product from a non-aggregate SELECT, which can fail with multiple shipments, and its WHERE clause does not restrict to products with pending shipments. Option D is uncorrelated and subtracts the global total from every product, which is wrong even though the EXISTS filter is present.
-
18 Question 18 Dropdown Using Substitution Variables
A developer at a government agency is building a SQL*Plus script that prompts a user for a department ID and a bonus percentage. The script should ask for the bonus percentage only once per run, must not echo the substituted statement back to the screen, and must continue to prompt for a department ID each time a substitution variable is referenced. Complete the commands by selecting the correct value for each blank.
Choose the correct value for each blank.
SET OFF
SET OFF
SELECT employee_id, salary * &&bonus_pct / 100 FROM employees WHERE department_id = &dept_id;Correct Answer:SET VERIFY OFF
SET DEFINE OFF
SELECT employee_id, salary * &&bonus_pct / 100 FROM employees WHERE department_id = &dept_id;ExplanationSET VERIFY OFF suppresses the display of the statement before and after substitution, which matches the requirement to keep the screen quiet. The double ampersand in &&bonus_pct causes SQL*Plus to store the value so that it is not prompted again for each later reference. SET DEFINE OFF would disable substitution altogether, which is wrong, so the second blank must refer to the DEFINE setting used for controlling the substitution character rather than to turn it off. ECHO controls the display of commands from a script file and does not govern substitution echo. SQLPROMPT changes the command prompt and has no bearing on substitution.
-
19 Question 19 Single choice Relational Database concepts
A systems architect at a hospital is reviewing a proposed schema in which a PATIENT_VISIT table stores both a patient identifier and a copy of the patient's full name and date of birth on every visit row. Auditors have found that a correction to a patient's date of birth was applied to some visit rows but not others. The architect must recommend a design change that removes this anomaly while preserving the ability to join visits to patients. Which recommendation is best?
Correct Answer: DExplanationNormalising the schema so that patient attributes live only in PATIENTS, with PATIENT_VISIT referencing them by key, eliminates the redundant copies that caused the update anomaly, and joins still work through the foreign key. Keeping duplicated data and synchronising it with a trigger, as in option A, retains the redundancy and adds fragile code. Using the full name as a primary key, as in option C, is unreliable because names are not unique and change over time. Adding a surrogate key in option D does nothing to address the duplicated attributes.
-
20 Question 20 Multiple choice Describing and Working with Columns and Data Types
A DBA at a public utility must make structural changes to the CUSTOMER_BILLING table, which has grown to contain a legacy column LEGACY_TARIFF that is no longer used and whose removal must be done quickly to avoid a long-running lock during peak hours. Management also requires that the change be reversible in terms of the data layout and that the table remain accessible to applications throughout. Which two actions meet these requirements? (Choose two.)
Correct Answer: A, EExplanationMarking the column UNUSED is a metadata-only operation that makes the column invisible to queries and returns quickly, avoiding a long lock, and the physical removal can be deferred. DROP UNUSED COLUMNS later reclaims the space in a separate step, which can be scheduled outside peak hours. A plain DROP COLUMN in option B rewrites the data and holds locks that conflict with the constraint against long blocking. TRUNCATE in option D deletes every row, which destroys data the table needs. MODIFY in option E only changes the column width and does not remove it.
These are 20 of the 326 questions in the full 1Z0-071 pack.
Get All 326 QuestionsGet all 326 questions & answers
Full access options for Oracle 1Z0-071
Self-study
PDF Version
- 326 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 326 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 326 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the 1Z0-071 Exam (Oracle Database SQL) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.