2 packs: 15% off with code BUY2. 3 or more: 20% off with code BUY3.

Free Oracle 1Z0-071 Practice Questions

68 free Oracle 1Z0-071 practice questions from the CertStash pack of 272, each with the correct answer and a full explanation. The rule is the same for every exam: ten free on the product page, 68 free here, all 272 in the pack, and each step includes the one before it.

Question 1

What is true about non-equijoin statement performance? (Choose two.)

  1. The BETWEEN condition always performs less well than using the >= and <= conditions.
  2. The BETWEEN condition always performs better than using the >= and <= conditions.
  3. The Oracle join syntax performs better than the SQL:1999 compliant ANSI join syntax.
  4. Table aliases can improve performance.
  5. The join syntax used makes no difference to performance.
Show answer and explanation

Correct answer: D, E. Table aliases can improve performance; The join syntax used makes no difference to performance.

Table aliases can improve performance by reducing parsing overhead and making queries more efficient. The join syntax used (Oracle vs ANSI) makes no difference to performance; the Oracle optimizer produces equivalent execution plans regardless of syntax style. BETWEEN and >= <= conditions perform equivalently when properly optimized.

Why the other options are wrong

  • A. BETWEEN and >= <= conditions perform identically when optimized by the Oracle engine.
  • B. BETWEEN does not inherently perform better than separate >= and <= conditions.
  • C. Oracle syntax and ANSI SQL:1999 syntax produce identical performance after optimization.

Question 2

Which two are true? (Choose two.)

  1. ADD_MONTHS adds a number of calendar months to a date.
  2. CEIL requires an argument which is a numeric data type.
  3. CEIL returns the largest integer less than or equal to a specified number.
  4. LAST_DAY returns the date of the last day of the current month only.
  5. LAST_DAY returns the date of the last day of the month for the date argument passed to the function.
  6. LAST_DAY returns the date of the last day of the previous month only.
Show answer and explanation

Correct answer: A, E. ADD_MONTHS adds a number of calendar months to a date; LAST_DAY returns the date of the last day of the month for the date argument passed to the function.

ADD_MONTHS correctly adds a number of calendar months to a date value. LAST_DAY returns the date of the last day of the month for whichever date argument is passed to the function, making it flexible for any date input. CEIL returns the smallest integer greater than or equal to a number (not the largest less than or equal to), and CEIL can accept numeric expressions beyond just numeric data types.

Why the other options are wrong

  • B. CEIL does not strictly require a numeric data type argument; it can work with numeric expressions.
  • C. CEIL returns the smallest integer greater than or equal to a number, not the largest less than or equal.
  • D. LAST_DAY returns the last day of the month for any date passed, not only the current month.
  • F. LAST_DAY returns the last day of the current month for the date argument, not the previous month.

Question 3

Which three statements are true about Oracle synonyms? (Choose three.)

  1. A synonym cannot be created for a PL/SQL package.
  2. A synonym can be available to all users.
  3. A SEQUENCE can have a synonym.
  4. Any user can drop a PUBLIC synonym.
  5. A synonym created by one user can refer to an object belonging to another user.
Show answer and explanation

Correct answer: B, C, E. A synonym can be available to all users; A SEQUENCE can have a synonym; A synonym created by one user can refer to an object belonging to another user.

Synonyms can be created as PUBLIC, making them available to all users in the database. A SEQUENCE can have a synonym created for it, allowing easier reference. A synonym created by one user can refer to an object owned by another user, enabling cross-schema access. Only the creator or DBA can drop a synonym; regular users cannot drop PUBLIC synonyms. Synonyms can be created for PL/SQL packages.

Why the other options are wrong

  • A. Synonyms can be created for PL/SQL packages; there is no such restriction.
  • D. Only the owner or DBA can drop a PUBLIC synonym; regular users cannot drop them.

Question 4

Which two are true? (Choose two.)

  1. CONCAT joins two character strings together.
  2. CONCAT joins two or more character strings together.
  3. FLOOR returns the largest positive integer less than or equal to a specified number.
  4. INSTR finds the offset within a character string, starting from position 0.
  5. INSTR finds the offset within a string of a single character only.
  6. FLOOR returns the largest integer less than or equal to a specified number.
Show answer and explanation

Correct answer: A, F. CONCAT joins two character strings together; FLOOR returns the largest integer less than or equal to a specified number.

CONCAT joins exactly two character strings together (not more than two). FLOOR returns the largest integer less than or equal to a specified number, working with both positive and negative values. INSTR finds the offset within a character string, starting from position 1 (not 0), and it can find any substring, not just single characters.

Why the other options are wrong

  • B. CONCAT in Oracle joins exactly two strings, not two or more.
  • C. FLOOR is not limited to positive integers; it returns the largest integer ≤ the number for any value.
  • D. INSTR starts counting from position 1, not position 0.
  • E. INSTR can find any substring, not just single characters.

Question 5

Which two statements are true about TRUNCATE and DELETE? (Choose two.)

  1. DELETE can use a WHERE clause to determine which row(s) should be removed.
  2. TRUNCATE can use a WHERE clause to determine which row(s) should be removed.
  3. TRUNCATE leaves any indexes on the table in an UNUSABLE state.
  4. The result of a TRUNCATE can be undone by issuing a ROLLBACK.
  5. The result of a DELETE can be undone by issuing a ROLLBACK.
Show answer and explanation

Correct answer: A, E. DELETE can use a WHERE clause to determine which row(s) should be removed; The result of a DELETE can be undone by issuing a ROLLBACK.

DELETE can use a WHERE clause to selectively remove specific rows based on conditions. The result of a DELETE statement can be undone by issuing a ROLLBACK because DELETE is a DML operation that generates undo information. TRUNCATE does not support a WHERE clause; it removes all rows. TRUNCATE generates a DDL operation that cannot be rolled back and does not leave indexes in an UNUSABLE state.

Why the other options are wrong

  • B. TRUNCATE cannot use a WHERE clause; it removes all rows unconditionally.
  • C. TRUNCATE does not leave indexes in an UNUSABLE state.
  • D. TRUNCATE is a DDL operation and cannot be undone with ROLLBACK.

Question 6

The STORES table has a column START_DATE of data type DATE, containing the date the row was inserted. You only want to display details of rows where START_DATE is within the last 25 months. Which WHERE clause can be used?

  1. WHERE TO_NUMBER(start_date - SYSDATE) <= 25
  2. WHERE MONTHS_BETWEEN(start_date, SYSDATE) <= 25
  3. WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25
  4. WHERE ADD_MONTHS(start_date, 25) <= SYSDATE
Show answer and explanation

Correct answer: C. WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25

MONTHS_BETWEEN(SYSDATE, start_date) returns the number of months between the current date and the START_DATE. When START_DATE is within the last 25 months, this returns a positive value ≤ 25. Option C correctly orders the arguments with SYSDATE first (current date) and start_date second (the date column being evaluated). Options A, B, and D use incorrect syntax or logic that would not properly filter rows within the last 25 months.

Why the other options are wrong

  • A. TO_NUMBER cannot directly convert a date difference to months; syntax is invalid.
  • B. MONTHS_BETWEEN(start_date, SYSDATE) returns a negative value for recent dates, requiring <= -25 instead.
  • D. ADD_MONTHS(start_date, 25) returns a future date; comparing to SYSDATE filters incorrectly.

Question 7

Which two are true about the precedence of operators and conditions? (Choose two.)

  1. || has a higher order of precedence than + (addition).
  2. + (addition) has a higher order of precedence than * (multiplication).
  3. NOT has a higher order of precedence than AND and OR in a condition.
  4. AND and OR have the same order of precedence in a condition.
  5. Operators are evaluated before conditions.
Show answer and explanation

Correct answer: C, E. NOT has a higher order of precedence than AND and OR in a condition; Operators are evaluated before conditions.

NOT has higher precedence than AND and OR in conditions (C), and operators in general are evaluated before conditions are evaluated (E). The concatenation operator || and addition have specific precedences unrelated to the answer (A and B are false), and AND and OR have different precedence levels with AND binding tighter than OR (D is false).

Why the other options are wrong

  • A. || (concatenation) and + (addition) have different precedence contexts; this statement is not generally true.
  • B. + (addition) has lower precedence than * (multiplication), not higher.
  • D. AND has higher precedence than OR in conditions; they do not have equal precedence.

Question 8

An Oracle Database session has an uncommitted transaction in progress which updated 5000 rows in a table. In which three situations does the transaction complete thereby committing the updates? (Choose three.)

  1. when a CREATE TABLE AS SELECT statement is issued in the same session but fails with a syntax error
  2. when a DBA issues a successful SHUTDOWN TRANSACTIONAL statement and the user then issues a COMMIT
  3. when the session logs out successfully
  4. when a CREATE INDEX statement is executed successfully in the same session
  5. when a DBA issues a successful SHUTDOWN IMMEDIATE statement and the user then issues a COMMIT
  6. when a COMMIT statement is issued by the same user from another session in the same database instance
Show answer and explanation

Correct answer: A, C, D. when a CREATE TABLE AS SELECT statement is issued in the same session but fails with a syntax error; when the session logs out successfully; when a CREATE INDEX statement is executed successfully in the same session

Option A is correct because any DDL statement, even one that fails with a syntax error, causes an implicit COMMIT of the current transaction before the error is raised. Option C is correct because logging out successfully commits any pending transactions. Option D is correct because executing a successful CREATE INDEX statement causes an implicit COMMIT. Option B is incorrect because SHUTDOWN TRANSACTIONAL waits for transactions to complete; the transaction is not automatically committed. Option E is incorrect because SHUTDOWN IMMEDIATE forcibly terminates the session without committing pending transactions. Option F is incorrect because a COMMIT from another session in a different connection affects only that other session's transaction, not the original session's transaction.

Why the other options are wrong

  • B. SHUTDOWN TRANSACTIONAL waits for transactions to finish but does not auto-commit them.
  • E. SHUTDOWN IMMEDIATE terminates sessions forcibly without committing their transactions.
  • F. A COMMIT in another session only commits that session's transaction, not the original session's transaction.

Question 9

Which three statements are true about indexes and their administration in an Oracle database? (Choose three.)

  1. The same table column can be part of a unique and non-unique index.
  2. A descending index is a type of function-based index.
  3. An INVINSIBLE index is not maintained when DML is performed on its underlying table.
  4. If a query filters on an indexed column then it will always be used during execution of the query.
  5. An index can be created as part of a CREATE TABLE statement.
  6. An UNUSABLE index is maintained when DML is performed on its underlying table.
Show answer and explanation

Correct answer: A, B, E. The same table column can be part of a unique and non-unique index; A descending index is a type of function-based index; An index can be created as part of a CREATE TABLE statement.

A column can belong to both a unique and non-unique index (A). A descending index is classified as a function-based index since it uses a function (B). An index can be created within a CREATE TABLE statement using the CONSTRAINT or CREATE INDEX syntax (E). Regarding the false options: INVISIBLE indexes ARE maintained during DML (C is false), queries don't always use indexed columns even if filtered (D is false), and UNUSABLE indexes are NOT maintained during DML (F is false).

Why the other options are wrong

  • C. INVISIBLE indexes are maintained when DML is performed; they are simply not used by the optimizer.
  • D. The optimizer may choose not to use an index even if a column is filtered, based on cost analysis.
  • F. UNUSABLE indexes are not maintained during DML operations; they must be rebuilt to be usable again.

Question 10

Which two statements are true about the SET VERIFY ON command? (Choose two.)

  1. It displays values for variables used only in the WHERE clause of a query.
  2. It displays values for variables created by the DEFINE command.
  3. It can be used only in SQL*Plus.
  4. It displays values for variables prefixed with &&.
  5. It can be used in SQL Developer and SQL*Plus.
Show answer and explanation

Correct answer: D, E. It displays values for variables prefixed with &&; It can be used in SQL Developer and SQL*Plus.

Option D is true because SET VERIFY ON displays values for variables prefixed with && (double ampersand), which are user variables. Option E is true because SET VERIFY can be used in both SQL Developer and SQL*Plus environments.

Why the other options are wrong

  • A. SET VERIFY ON displays all variable substitutions in the query, not only those in the WHERE clause.
  • B. SET VERIFY ON displays values for &&-prefixed variables (user-defined), not variables created by DEFINE.
  • C. SET VERIFY is available in multiple tools including SQL Developer, not just SQL*Plus.

What people say about the full 1Z0-071 pack 5.0 from 3

1Z0-071 passed. Happy with my purchase
Ingrid Aguilar1Z0-071
Got through my 1Z0-071 using this
Simon Levy1Z0-071

Question 11

Which three actions can you perform on an existing table containing data? (Choose three.)

  1. Increase the width of a numeric column.
  2. Add a new column as the table's first column.
  3. Define a default value that is automatically inserted into a column containing nulls.
  4. Change a DATE column containing data to a NUMBER data type.
  5. Change the default value of a column.
  6. Add a new NOT NULL column with a DEFAULT value.
Show answer and explanation

Correct answer: A, E, F. Increase the width of a numeric column; Change the default value of a column; Add a new NOT NULL column with a DEFAULT value.

You can increase the width of a numeric column on an existing table with data. The default value of a column can be changed using ALTER TABLE, and this does not affect existing data. You can add a new NOT NULL column with a DEFAULT value because the default will be applied to existing rows. You cannot add a column as the first column; new columns are always added at the end. You cannot change a DATE column to NUMBER if data exists, and you cannot insert default values into existing null values after the fact.

Why the other options are wrong

  • B. New columns cannot be added as the first column; they are always added at the end of the table structure.
  • C. A DEFAULT value does not automatically fill existing null values; it applies only to future inserts.
  • D. Changing a DATE column to NUMBER is not allowed when the table contains data due to conversion risks.

Question 12

Which two statements are true about selecting related rows from two tables based on an Entity Relationship Diagram (ERD)? (Choose two.)

  1. Rows from unrelated tables cannot be joined.
  2. Relating data from a table with data from the same table is implemented with a self join.
  3. Implementing a relationship between two tables might require joining additional tables.
  4. Every relationship between the two tables must be implemented in a join condition.
  5. An inner join relates rows within the same table.
Show answer and explanation

Correct answer: B, C. Relating data from a table with data from the same table is implemented with a self join; Implementing a relationship between two tables might require joining additional tables.

A self join implements relationships where a table relates to itself, such as in hierarchical structures (manager-employee). Sometimes joining two tables directly is insufficient and requires intermediate join tables to implement all relationships defined in the ERD, particularly in many-to-many relationships. Unrelated tables can be joined through cross joins or if intermediate tables exist. Not every relationship requires an explicit join condition; some are implicit. Self joins operate on a single table, not within it across different rows in the sense of inner joins.

Why the other options are wrong

  • A. Unrelated tables can be joined through cross joins or through intermediate tables.
  • D. Not every relationship shown in an ERD must be implemented as a join condition in a single query; some may be implicit or require multiple queries.
  • E. An inner join relates rows from different tables (or the same table in a self join), not rows within the same table.

Question 13

Which two are true about virtual columns? (Choose two.)

  1. They can be indexed.
  2. They can be referenced in the column expression of another virtual column.
  3. They cannot have a data type explicitly specified.
  4. They can be referenced in the set clause of an update statement as the name of the column to be updated.
  5. They can be referenced in the where clause of an update or delete statement.
Show answer and explanation

Correct answer: A, E. They can be indexed; They can be referenced in the where clause of an update or delete statement.

Virtual columns can be indexed (A), allowing query optimization on computed values. Virtual columns can be referenced in WHERE clauses of UPDATE and DELETE statements (E), making them useful for filtering during modifications. Options B, C, and D are false: virtual columns cannot reference other virtual columns in their expression (B), they must have an explicit data type (C), and they cannot be updated directly since they are computed (D).

Why the other options are wrong

  • B. Virtual columns cannot reference other virtual columns; only base table columns can be used in the expression.
  • C. Virtual columns require an explicit data type specification in the column definition.
  • D. Virtual columns are read-only and cannot be referenced in the SET clause of an UPDATE statement.

Question 14

Which three statements are true about sequences in a single instance Oracle database? (Choose three.)

  1. A sequence’s unallocated cached values are lost if the instance shuts down.
  2. A sequence number that was allocated can be rolled back if a transaction fails.
  3. A sequence can only be dropped by a DBA.
  4. A sequence can issue duplicate values.
  5. Sequences can always have gaps.
  6. Two or more tables cannot have keys generated from the same sequence.
Show answer and explanation

Correct answer: A, D, E. A sequence’s unallocated cached values are lost if the instance shuts down; A sequence can issue duplicate values; Sequences can always have gaps.

Option A: Cached but unallocated sequence values are lost when the instance shuts down. Option D: A sequence can issue duplicate values if it cycles or if there are system issues. Option E: Sequences can have gaps due to rollbacks, instance failures, or the CYCLE option. Option B is incorrect because allocated sequence numbers cannot be rolled back. Option C is incorrect because non-DBAs who own sequences can drop them. Option F is incorrect because multiple tables can share the same sequence.

Why the other options are wrong

  • B. Allocated sequence numbers are not rolled back; gaps occur but the number is consumed.
  • C. Any user who owns a sequence can drop it, not just DBAs.
  • F. Multiple tables can generate keys from the same sequence.

Question 15

You want to return the current date and time from the user session, with a data type of TIMESTAMP WITH TIME ZONE. Which function will do this?

  1. SYSDATE
  2. CURRENT_TIMESTAMP
  3. LOCALTIMESTAMP
  4. CURRENT_DATE
Show answer and explanation

Correct answer: B. CURRENT_TIMESTAMP

CURRENT_TIMESTAMP returns the current date and time from the user session with the data type TIMESTAMP WITH TIME ZONE, including time zone information. SYSDATE returns only DATE data type. LOCALTIMESTAMP returns TIMESTAMP WITH LOCAL TIME ZONE (session time zone). CURRENT_DATE returns only the date portion without time or time zone information.

Why the other options are wrong

  • A. SYSDATE returns a DATE data type, not TIMESTAMP WITH TIME ZONE.
  • C. LOCALTIMESTAMP returns TIMESTAMP WITH LOCAL TIME ZONE, not TIMESTAMP WITH TIME ZONE.
  • D. CURRENT_DATE returns only the date without time or time zone information.

Question 16

Which three statements are true about Structured Query Language (SQL)? (Choose three.)

  1. It requires that data be contained in hierarchical data storage.
  2. It best supports relational databases.
  3. It provides independence for logical data structures being manipulated from the underlying physical data storage.
  4. It is the only language that can be used for both relational and object-oriented databases.
  5. It guarantees atomicity, consistency, isolation, and durability (ACID) features.
  6. It is used to define encapsulation and polymorphism for a relational table.
Show answer and explanation

Correct answer: B, C, E. It best supports relational databases; It provides independence for logical data structures being manipulated from the underlying physical data storage; It guarantees atomicity, consistency, isolation, and durability (ACID) features.

SQL best supports relational databases (B), providing data independence that separates logical structures from physical storage (C), and ACID properties are guaranteed by database systems implementing SQL transactions (E). SQL does not require hierarchical storage (A is false), is not exclusive to any database type (D is false), and does not define object-oriented concepts like encapsulation and polymorphism (F is false).

Why the other options are wrong

  • A. SQL works with relational and other data models, not requiring hierarchical storage.
  • D. SQL can be used with multiple database types, but is not the only language that works with both relational and object-oriented databases.
  • F. SQL defines data structures and operations, not object-oriented encapsulation or polymorphism concepts.

Question 17

Which two are true about using constraints? (Choose two.)

  1. NOT NULL can be specified at the column and at the table level.
  2. A table can have only one PRIMARY KEY and one FOREIGN KEY constraint.
  3. A FOREIGN KEY column in a child table and the referenced PRIMARY KEY column in the parent table must have the same names.
  4. PRIMARY KEY and FOREIGN KEY constraints can be specified at the column and at the table level.
  5. A table can have multiple PRIMARY KEY and multiple FOREIGN KEY constraints.
  6. A table can have only one PRIMARY KEY but may have multiple FOREIGN KEY constraints.
Show answer and explanation

Correct answer: D, F. PRIMARY KEY and FOREIGN KEY constraints can be specified at the column and at the table level; A table can have only one PRIMARY KEY but may have multiple FOREIGN KEY constraints.

Option D is correct because PRIMARY KEY and FOREIGN KEY constraints can both be defined at the column level (inline) or at the table level (out-of-line). Option F is correct because a table can have only one PRIMARY KEY constraint but may have multiple FOREIGN KEY constraints referencing the same or different parent tables. Option A is incorrect because NOT NULL can only be specified at the column level, not at the table level. Option B is incorrect because a table can have multiple FOREIGN KEY constraints. Option C is incorrect because foreign key and primary key columns do not need to have the same names. Option E is incorrect because a table can have only one PRIMARY KEY constraint.

Why the other options are wrong

  • A. NOT NULL constraints can only be specified at the column level, not at the table level.
  • B. A table can have multiple FOREIGN KEY constraints, though only one PRIMARY KEY constraint.
  • C. Foreign key column names do not need to match the referenced primary key column names.
  • E. A table can have only one PRIMARY KEY constraint; multiple primary keys are not allowed.

Question 18

You create a table named 123. Which statement runs successfully?

  1. SELECT * FROM TABLE(123);
  2. SELECT * FROM "123";
  3. SELECT * FROM \'123\';
  4. SELECT * FROM '123';
Show answer and explanation

Correct answer: B. SELECT * FROM "123";

In Oracle SQL, when a table name is a reserved word or consists of numbers only, it must be enclosed in double quotes. The table name '123' is numeric and therefore invalid without quoting. Double quotes preserve the exact case and allow special naming. Single quotes are for string literals, not identifiers. The TABLE() function is for nested tables, not regular table references.

Why the other options are wrong

  • A. TABLE() is a function for nested table columns, not standard table selection.
  • C. Escaped single quotes represent a string literal containing '123', not a table reference.
  • D. Unquoted single quotes are for string literals; the query would fail because '123' is treated as a string value, not a table name.

Question 19

Which three statements are true about views in an Oracle Database? (Choose three.)

  1. A SELECT statement cannot contain a WHERE clause when querying a view containing a WHERE clause in its defining query.
  2. Views have no segment.
  3. Views have no object number.
  4. Views can join tables only if they belong to the same schema.
  5. A view can be created that refers to a non-existent table in its defining query.
  6. Rows inserted into a table using a view are retained in the table if the view is dropped.
Show answer and explanation

Correct answer: B, E, F. Views have no segment; A view can be created that refers to a non-existent table in its defining query; Rows inserted into a table using a view are retained in the table if the view is dropped.

Option B is correct: views are logical constructs with no segment allocated on disk; they store only the defining query, not data. Option E is correct: a view can be created with FORCE OPTION even if it references non-existent tables; the table must exist before the view is queried, but creation itself is allowed. Option F is correct: rows inserted through a view remain in the underlying table after the view is dropped; dropping a view does not affect table data. These statements reflect Oracle's view architecture and behavior.

Why the other options are wrong

  • A. A SELECT query can use a WHERE clause when querying a view that also has a WHERE clause in its definition; the clauses combine in the final query execution.
  • C. Views do have an object number; every view is assigned an object ID in the data dictionary.
  • D. Views can join tables from different schemas; schema membership does not restrict which tables can be joined in a view's defining query.

Question 20

Examine this statement: On which two columns of the table will an index be created automatically? (Choose two.)

  1. ORDER_ID
  2. ORDER_TOTAL
  3. ORDER_DATE
  4. PRODUCT_ID
  5. STATUS
  6. SERIAL_NO
Show answer and explanation

Correct answer: A, F. ORDER_ID; SERIAL_NO

In SQL, indexes are automatically created on columns that have constraints that require uniqueness or serve as primary keys. SERIAL_NO has the UNIQUE constraint applied to it, which automatically creates an index to enforce uniqueness. ORDER_ID is defined as the PRIMARY KEY, and primary keys automatically generate an index to enforce their uniqueness and serve as the table's main identifier. These two columns will have indexes created automatically by the database system. All other columns (ORDER_TOTAL, ORDER_DATE, PRODUCT_ID, and STATUS) have no such constraints and will not have automatic indexes created unless explicitly defined.

Why the other options are wrong

  • B. ORDER_TOTAL has no constraint that would trigger automatic index creation; it is simply a NUMBER data type without PRIMARY KEY or UNIQUE constraints.
  • C. ORDER_DATE is defined as DATE NOT NULL, but the NOT NULL constraint does not automatically create an index; it only enforces that values must be present.
  • D. PRODUCT_ID is a foreign key reference but does not have a PRIMARY KEY or UNIQUE constraint on this table, so no automatic index is created on this column itself.
  • E. STATUS is a VARCHAR2 column with a CHECK constraint; the CHECK constraint does not automatically create an index on the column.

Question 21

Which two statements are true about Oracle synonyms? (Choose two.)

  1. Any user can create a PUBLIC synonym.
  2. A synonym has an object number.
  3. All private synonym names must be unique in the database.
  4. A synonym can be created on an object in a package.
  5. A synonym can have a synonym.
Show answer and explanation

Correct answer: D, E. A synonym can be created on an object in a package; A synonym can have a synonym.

A synonym can be created on a packaged object (D), and a synonym can reference another synonym, creating a chain of synonyms (E). Only DBAs or users with CREATE PUBLIC SYNONYM privilege can create public synonyms (A is false), synonyms have no object numbers as they are merely name aliases (B is false), and private synonyms need only be unique within the owner's schema, not database-wide (C is false).

Why the other options are wrong

  • A. Only users with CREATE PUBLIC SYNONYM privilege can create public synonyms, not any user.
  • B. A synonym is an alias without its own object number; it references another object's number.
  • C. Private synonyms must be unique within their owner's schema, not across the entire database.

Question 22

Which two statements are true about the ORDER BY clause? (Choose two.)

  1. In a character sort, the values are case-sensitive.
  2. NULLS are not included in the sort operation.
  3. Numeric values are displayed in descending order if they have decimal positions.
  4. Column aliases can be used in the ORDER BY clause.
  5. Only columns that are specified in the SELECT list can be used in the ORDER BY clause.
Show answer and explanation

Correct answer: A, D. In a character sort, the values are case-sensitive; Column aliases can be used in the ORDER BY clause.

In character sorts, values are case-sensitive by default in Oracle, with uppercase letters typically sorted before lowercase (A is true). Column aliases defined in the SELECT clause can be used in the ORDER BY clause (D is true). NULLs are included in the sort operation (appearing first in ascending order). Numeric values in descending order display with higher values first regardless of decimal positions. Columns not in the SELECT list can be used in ORDER BY as long as the table is accessible.

Why the other options are wrong

  • B. NULLs are included in sort operations; they sort either first (ascending) or last (descending) depending on the sort direction.
  • C. Numeric values in descending order are displayed from highest to lowest; decimal positions do not determine sort direction.
  • E. Columns not in the SELECT list can be used in ORDER BY, including columns from joined tables that are not displayed.

Question 23

Which two statements are true about *_TABLES views? (Choose two.)

  1. USER_TABLES displays all tables owned by the current user.
  2. You must have ANY TABLE system privileges, or be granted object privileges on the table, to view a table in USER_TABLES.
  3. All users can query DBA_TABLES successfully.
  4. You must have ANY TABLE system privileges, or be granted object privileges on the table, to view a table in DBA_TABLES.
  5. ALL_TABLES displays all tables owned by the current user.
  6. You must have ANY TABLE system privileges, or be granted object privileges on the table, to view a table in ALL_TABLES.
Show answer and explanation

Correct answer: A, F. USER_TABLES displays all tables owned by the current user; You must have ANY TABLE system privileges, or be granted object privileges on the table, to view a table in ALL_TABLES.

USER_TABLES lists every table owned by the current user. ALL_TABLES lists tables the user can access, which means tables they own plus tables they can see through object privileges or ANY TABLE system privileges. DBA_TABLES is controlled by dictionary access such as SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY, not by per-table privileges.

Why the other options are wrong

  • B. USER_TABLES shows tables the user owns, and owning a table needs no ANY TABLE or object privilege to see it there.
  • C. DBA_TABLES can be queried only by users with dictionary access such as the DBA role or SELECT_CATALOG_ROLE.
  • D. Access to DBA_TABLES depends on dictionary privileges, not on ANY TABLE privileges or grants on individual tables.
  • E. ALL_TABLES shows all tables accessible to the user, not only the tables they own.

Question 24

In your session, the NLS_DATE_FORMAT is DD-MM-YYYY. There are 86400 seconds in a day. Examine this result: DATE ----------- 02-JAN-2020 Which statement returns this?

  1. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '4' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;
  2. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '3' MONTH + INTERVAL '7' DAY - INTERVAL '360' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;
  3. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '5' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;
  4. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '5' DAY - INTERVAL '86410' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;
  5. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '6' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;
Show answer and explanation

Correct answer: C. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '5' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;

Starting from 29-10-2019 (October 29, 2019), adding 2 months gives 29-12-2019, adding 5 days gives 03-01-2020 (January 3, 2020), and subtracting 120 seconds (less than a day) gives 02-01-2020 (January 2, 2020), which displays as 02-JAN-2020 in DD-MON-YYYY format. Other options use incorrect month increments or second values that produce different dates.

Why the other options are wrong

  • A. Adding 4 days instead of 5 results in 01-01-2020 before subtracting seconds.
  • B. Adding 3 months and 7 days moves to January 5, 2020, and subtracting 360 seconds still leaves January 5.
  • D. Subtracting 86410 seconds removes more than one full day, resulting in January 1, 2020.
  • E. Adding 6 days instead of 5 results in 03-01-2020, which minus 120 seconds gives 02-01-2020 but the month arithmetic is off by one day.

Question 25

Examine this business rule: Each student can work on multiple projects and each project can have multiple students. You must design an Entity Relationship (ER) model for optimal data storage and allow for generating reports in this format: STUDENT_ID FIRST_NAME LAST_NAME PROJECT_ID PROJECT_NAME PROJECT_TASK Which two statements are true? (Choose two.)

  1. PROJECT_ID must be the primary key in the PROJECTS entity and foreign key in the STUDENTS entity.
  2. STUDENT_ID must be the primary key in the STUDENTS entity and foreign key in the projects entity.
  3. An associative table must be created with a composite key of STUDENT_ID and PROJECT_ID, which is the foreign key linked to the students and projects entities.
  4. The ER must have a many-to-many relationship between the STUDENTS and PROJECTS entities that must be resolved into one-to-many relationships.
  5. The ER must have a one-to-many relationship between the STUDENTS and PROJECTS entities.
Show answer and explanation

Correct answer: C, D. An associative table must be created with a composite key of STUDENT_ID and PROJECT_ID, which is the foreign key linked to the students and projects entities; The ER must have a many-to-many relationship between the STUDENTS and PROJECTS entities that must be resolved into one-to-many relationships.

A many-to-many relationship between STUDENTS and PROJECTS must be resolved by creating an associative (junction) table. Option C is correct because this table contains a composite primary key of STUDENT_ID and PROJECT_ID, with foreign keys linking to both parent tables. Option D is correct because the ER model must represent the many-to-many relationship and resolve it into one-to-many relationships (STUDENTS to STUDENT_PROJECTS and PROJECTS to STUDENT_PROJECTS). Option A is incorrect because PROJECT_ID should not be a foreign key in STUDENTS; the relationship is many-to-many, not one-to-many. Option B is incorrect because STUDENT_ID should not be a foreign key in PROJECTS. Option E is incorrect because the relationship is many-to-many, not one-to-many.

Why the other options are wrong

  • A. Foreign keys should not be placed directly in parent tables for many-to-many relationships; an associative table is required.
  • B. STUDENT_ID as a foreign key in PROJECTS would incorrectly represent a one-to-many relationship.
  • E. The relationship is many-to-many, not one-to-many; this would not allow multiple students per project.

25 questions in. Want the rest? The first half of the pack, free by email · The full pack

Question 26

Which two are true about the NVL, NVL2, and COALESCE functions? (Choose two.)

  1. NVL must have expressions of the same data type.
  2. NVL can have any number of expressions in the list.
  3. NVL2 can have any number of expressions in the list.
  4. COALESCE stops evaluating the list of expressions when it finds the first non-null value.
  5. The first expression in NVL2 is never returned.
  6. COALESCE stops evaluating the list of expressions when it finds the first null value.
Show answer and explanation

Correct answer: D, E. COALESCE stops evaluating the list of expressions when it finds the first non-null value; The first expression in NVL2 is never returned.

Option D is correct because COALESCE evaluates expressions from left to right and returns the first non-null value it encounters, stopping further evaluation. Option E is correct because NVL2(expr1, expr2, expr3) returns expr2 if expr1 is not null, and expr3 if expr1 is null, meaning the first expression is evaluated but never returned as a result. Option A is incorrect because NVL expressions can have different data types that Oracle will convert. Option B is incorrect because NVL takes exactly two arguments, not any number. Option C is incorrect because NVL2 takes exactly three arguments. Option F is incorrect because COALESCE stops at the first non-null value, not the first null value.

Why the other options are wrong

  • A. NVL arguments can be of different data types; Oracle will perform implicit conversion as needed.
  • B. NVL accepts exactly two arguments: NVL(expr1, expr2).
  • C. NVL2 accepts exactly three arguments: NVL2(expr1, expr2, expr3).
  • F. COALESCE stops when it finds the first non-null value, not when it finds a null value.

Question 27

Which two statements are true about Oracle databases and SQL? (Choose two.)

  1. Updates performed by a database user can be rolled back by another user by using the ROLLBACK command.
  2. A query can access only tables within the same schema.
  3. The database guarantees read consistency at select level on user-created tables.
  4. A user can be the owner of multiple schemas in the same database.
  5. When you execute an update statement, the database instance locks each updated row.
Show answer and explanation

Correct answer: C, E. The database guarantees read consistency at select level on user-created tables; When you execute an update statement, the database instance locks each updated row.

Oracle guarantees read consistency at the statement level for user-created tables through multiversion concurrency control (C). When an UPDATE statement executes, the database locks each updated row to prevent concurrent modifications (E). Option A is false because only the user who issued an UPDATE can roll it back; other users cannot. Option B is false because queries can join tables across different schemas. Option D is false because a user owns exactly one schema bearing their username.

Why the other options are wrong

  • A. Only the user who issued the UPDATE can roll it back; other users cannot execute ROLLBACK for another user's transaction.
  • B. Queries can access tables in different schemas using schema-qualified names (e.g., schema.table).
  • D. A database user owns exactly one schema, which typically has the same name as the user account.

Question 28

Which two are true about transactions in the Oracle Database? (Choose two.)

  1. DML statements always start new transactions.
  2. DDL statements automatically commit only data dictionary updates caused by executing the DDL.
  3. A session can see uncommitted updates made by the same user in a different session.
  4. A DDL statement issued by a session with an uncommitted transaction automatically commits that transaction.
  5. An uncommitted transaction is automatically committed when the user exits SQL*Plus.
Show answer and explanation

Correct answer: D, E. A DDL statement issued by a session with an uncommitted transaction automatically commits that transaction; An uncommitted transaction is automatically committed when the user exits SQL*Plus.

A DDL statement automatically commits any uncommitted DML transaction in the session (D), and an uncommitted transaction is automatically committed when the user exits SQL*Plus (E). DML statements do not always start new transactions; they continue the current one (A is false), DDL commits all changes not just data dictionary updates (B is incorrect phrasing), and one session cannot see another session's uncommitted updates due to transaction isolation (C is false).

Why the other options are wrong

  • A. DML statements participate in ongoing transactions; they do not always start new ones.
  • B. DDL statements commit the entire transaction, not just data dictionary updates.
  • C. Transaction isolation prevents one session from seeing uncommitted updates from another session.

Question 29

Which two will execute successfully? (Choose two.)

  1. SELECT COALESCE(0, SYSDATE) FROM DUAL;
  2. SELECT NVL('DATE', SYSDATZ) FROM DUAL;
  3. SELECT COALESCE('DATE', SYSDATE) FROM DUAL;
  4. SELECT NVL('DATE', 200) FROM (SELECT NULL AS "DATE" FROM DUAL);
  5. SELECT COALESCE('DATE', SYSDATE) FRCM (SELECT NULL AS "DATE" FROM DUAL);
Show answer and explanation

Correct answer: B, D. SELECT NVL('DATE', SYSDATZ) FROM DUAL;; SELECT NVL('DATE', 200) FROM (SELECT NULL AS "DATE" FROM DUAL);

Option B is correct: NVL('DATE', SYSDATE) executes successfully because NVL accepts two arguments of different types and returns the first non-null value; if the first argument is non-null, it returns that value (a string). Option D is correct: NVL('DATE', 200) executes because NVL returns the string 'DATE' (which is non-null), and the fact that the second argument is numeric does not cause an error. Option A is incorrect because COALESCE(0, SYSDATE) fails due to type mismatch, mixing numeric and date types. Option C is incorrect because COALESCE('DATE', SYSDATE) fails due to incompatible types (character and date). Option E has a syntax error (FRCM instead of FROM).

Why the other options are wrong

  • A. COALESCE cannot handle type mismatch between numeric (0) and date (SYSDATE).
  • C. COALESCE fails when mixing incompatible types like character strings and dates.
  • E. This option contains a syntax error: FRCM is not valid SQL syntax; the correct keyword is FROM.

Question 30

Which two are true about unused columns? (Choose two.)

  1. A query can return data from unused columns, but no DML is possible on those columns.
  2. Unused columns retain their data until they are dropped.
  3. Once a column has been set to unused, a new column with the same name can be added to the table.
  4. The DESCRIBE command displays unused columns.
  5. A primary key column cannot be set to unused.
  6. A foreign key column cannot be set to unused.
Show answer and explanation

Correct answer: B, C. Unused columns retain their data until they are dropped; Once a column has been set to unused, a new column with the same name can be added to the table.

Unused columns retain their data until explicitly dropped using ALTER TABLE DROP COLUMN (B), and once set to unused, a new column with the same name can be added to the table (C). Queries cannot return data from unused columns (A is false), DESCRIBE does not display unused columns (D is false), and both primary and foreign key columns can be set to unused (E and F are false).

Why the other options are wrong

  • A. Unused columns cannot be queried; they are hidden from SELECT statements.
  • D. DESCRIBE does not show unused columns; they are excluded from command output.
  • E. Primary key columns can be set to unused.
  • F. Foreign key columns can be set to unused.

Question 31

Examine this list of requirements for a sequence: 1. Name: EMP_SEQ 2. First value returned: 1 3. Duplicates are never permitted. 4. Provide values to be inserted into the EMPLOYEES.EMPLOYEE_ID column. 5. Reduce the chances of gaps in the values. Which two statements will satisfy these requirements? (Choose two.)

  1. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 CYCLE;
  2. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 CACHE;
  3. CREATE SEQUENCE emp_seq;
  4. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 NOCACHE;
  5. CREATE SEQUENCE emp_seq NOCACHE;
  6. CREATE SEQUENCE emp_seq START WITH 1 CACHE;
Show answer and explanation

Correct answer: D, E. CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 NOCACHE;; CREATE SEQUENCE emp_seq NOCACHE;

Requirements state: first value 1, no duplicates (default), values for EMPLOYEE_ID, and reduce gaps. Option D (START WITH 1, INCREMENT BY 1, NOCACHE) satisfies all requirements by explicitly starting at 1, incrementing by 1, and using NOCACHE to minimize gaps by generating sequences on-demand rather than pre-allocating. Option E (NOCACHE alone) uses default START WITH 1 and INCREMENT BY 1, also satisfying all requirements. Both ensure no pre-cached unused values that could create gaps.

Why the other options are wrong

  • A. CYCLE allows the sequence to wrap around and restart, potentially creating duplicate values in the EMPLOYEE_ID column.
  • B. CACHE pre-allocates sequence numbers; if the database crashes, cached but unused numbers are lost, creating gaps.
  • C. Missing START WITH 1 parameter, so sequence would begin at 1 by default but lacks explicit configuration and doesn't address gap reduction.
  • F. CACHE without INCREMENT BY specification uses default increment, but CACHE still causes gaps when unused cached values are discarded.

Question 32

Which two queries execute successfully? (Choose two.)

  1. SELECT INTERVAL '1' DAY - INTERVAL '1' MINUTE FROM DUAL
  2. SELECT SYSTIMESTAMP + INTERVAL '1' DAY FROM DUAL;
  3. SELECT INTERVAL '1' DAY - SYSDATE FROM DUAL;
  4. SELECT INTERVAL '1' DAY + INTERVAL '1' MONTH FROM DUAL;
  5. SELECT SYSDATE * INTERVAL '1' DAY FROM DUAL;
Show answer and explanation

Correct answer: A, B. SELECT INTERVAL '1' DAY - INTERVAL '1' MINUTE FROM DUAL; SELECT SYSTIMESTAMP + INTERVAL '1' DAY FROM DUAL;

Option A: Subtracting two INTERVAL types (INTERVAL '1' DAY - INTERVAL '1' MINUTE) produces a valid result. Option B: Adding an INTERVAL to a timestamp (SYSTIMESTAMP + INTERVAL '1' DAY) is valid. Option C fails because you cannot subtract a DATE from an INTERVAL. Option D fails because you cannot add DAY and MONTH intervals directly in Oracle. Option E fails because you cannot multiply a DATE by an INTERVAL.

Why the other options are wrong

  • C. INTERVAL - SYSDATE is invalid; you cannot subtract a date from an interval.
  • D. INTERVAL DAY and INTERVAL MONTH cannot be added together directly.
  • E. SYSDATE cannot be multiplied by an INTERVAL type.

Question 33

Examine this command: TRUNCATE TABLE test; Table truncated. Which two are true? (Choose two.)

  1. The structure of the TEST table is removed.
  2. All the indexes on the TEST table are dropped.
  3. All the constraints on the TEST table are dropped.
  4. Removed rows can not be recovered using the ROLLBACK command.
  5. All the rows in the TEST table are removed.
Show answer and explanation

Correct answer: D, E. Removed rows can not be recovered using the ROLLBACK command; All the rows in the TEST table are removed.

TRUNCATE removes all rows from a table (E is true), and removed rows cannot be recovered with ROLLBACK because TRUNCATE is a DDL operation that commits immediately (D is true). TRUNCATE preserves the table structure, so indexes and constraints remain intact. Only the data is removed, not the structural definition of the table.

Why the other options are wrong

  • A. TRUNCATE removes data only; the table structure remains intact.
  • B. Indexes on the table are preserved during TRUNCATE; they are not dropped.
  • C. Constraints on the table are preserved during TRUNCATE; they are not dropped.

Question 34

Which two statements are true about views? (Choose two.)

  1. The WITH CHECK clause prevents certain rows from being updated or inserted in the underlying table through the view.
  2. The WITH CHECK clause prevents certain rows from being displayed when querying the view.
  3. Views can be indexed.
  4. Views can be updated without the need to re-grant privileges on the view.
  5. Tables in the defining query of a view must always exist in order to create the view.
Show answer and explanation

Correct answer: A, D. The WITH CHECK clause prevents certain rows from being updated or inserted in the underlying table through the view; Views can be updated without the need to re-grant privileges on the view.

The WITH CHECK OPTION clause prevents certain rows from being updated or inserted through the view by enforcing the view's WHERE clause conditions (A is true). When a view is altered, privileges on the view are automatically re-granted and remain valid; no manual re-granting is needed (D is true). Views cannot be indexed because they are virtual objects, not physical tables. WITH CHECK OPTION restricts modifications, not display of rows. Views can be created even if tables in the query don't currently exist (using FORCE option).

Why the other options are wrong

  • B. WITH CHECK OPTION restricts modifications (updates/inserts), not the display of rows when querying.
  • C. Views cannot be indexed as they are virtual objects, not physical storage structures.
  • E. Views can be created even if underlying tables do not exist using the FORCE keyword in the CREATE VIEW statement.

Question 35

Which three statements are true about single-row functions? (Choose three.)

  1. They return a single result row per table.
  2. They can be nested to any level.
  3. They can accept only one argument.
  4. The argument can be a column name, variable, literal or an expression.
  5. They can be used only in the WHERE clause of a SELECT statement.
  6. The data type returned can be different from the data type of the argument.
Show answer and explanation

Correct answer: B, D, F. They can be nested to any level; The argument can be a column name, variable, literal or an expression; The data type returned can be different from the data type of the argument.

Option B is true because single-row functions can be nested to any depth (e.g., UPPER(SUBSTR(column, 1, 3))). Option D is true because single-row function arguments can be column names, variables, literals, or expressions. Option F is true because functions can transform data types (e.g., TO_CHAR converts a number to a string).

Why the other options are wrong

  • A. Single-row functions return one result per row processed, not per table.
  • C. Single-row functions can accept multiple arguments (e.g., SUBSTR(column, 1, 5) has three arguments).
  • E. Single-row functions can be used in SELECT, WHERE, ORDER BY, and other clauses, not just WHERE.

Question 36

Which three statements are true about multiple row subqueries? (Choose three.)

  1. Two or more values are always returned from the subquery.
  2. They can contain HAVING clauses.
  3. They can contain GROUP BY clauses.
  4. They can return multiple columns.
  5. They cannot contain a subquery.
Show answer and explanation

Correct answer: B, C, D. They can contain HAVING clauses; They can contain GROUP BY clauses; They can return multiple columns.

Multiple row subqueries can contain GROUP BY and HAVING clauses, allowing for aggregated data returns. They can return multiple columns, enabling complex comparisons. However, multiple row subqueries do not always return two or more values , they can return zero or one row. Multiple row subqueries can contain nested subqueries, so the restriction in option E is false.

Why the other options are wrong

  • A. A multiple row subquery can return zero rows, one row, or many rows; it is not guaranteed to return two or more.
  • E. Multiple row subqueries can contain additional subqueries nested within them.

Question 37

Which two statements are true regarding indexes? (Choose two.)

  1. An update to a table can result in updates to any or all of the table's indexes.
  2. An update to a table can result in no updates to any of the table's indexes.
  3. A UNIQUE index can be altered to be non-unique.
  4. When a table is dropped and is moved to the RECYCLE BIN, all indexes built on that table are permanently dropped.
  5. A table belonging to one user cannot have an index that belongs to a different user.
Show answer and explanation

Correct answer: A, B. An update to a table can result in updates to any or all of the table's indexes; An update to a table can result in no updates to any of the table's indexes.

When a table is updated, indexes on that table may be updated if the indexed columns are affected, but they may also require no updates if only non-indexed columns change. A unique index cannot be altered to be non-unique in Oracle. When a table is dropped and moves to the RECYCLE BIN, its indexes are also moved to the RECYCLE BIN (not permanently dropped), and indexes belong to the same user as their table.

Why the other options are wrong

  • C. A UNIQUE index cannot be altered to non-unique; you must drop and recreate it.
  • D. When a table moves to the RECYCLE BIN, its indexes also move there and are not permanently dropped.
  • E. An index always belongs to the same user as the table it indexes; this is enforced.

Question 38

The PRODUCT_INFORMATION table has a UNIT_PRICE column of data type NUMBER(8,2). Evaluate this SQL statement: SELECT TO_CHAR(unit_price, '$9,999') FROM product_information; Which two statements are true about the output? (Choose two.)

  1. A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as $1,0236.
  2. A row whose UNIT_PRICE column contains the value 1023.95 will be displayed as $1,024.
  3. A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as $1,023.
  4. A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as #######.
  5. A row whose UNIT_PRICE column contains the value 1023.99 will be displayed as $1,023.
Show answer and explanation

Correct answer: B, D. A row whose UNIT_PRICE column contains the value 1023.95 will be displayed as $1,024; A row whose UNIT_PRICE column contains the value 10235.95 will be displayed as #######.

The format string '$9,999' provides space for 4 digits plus a dollar sign. When a value like 10235.95 (5 digits before the decimal) exceeds the available width, Oracle displays '#######' instead of the truncated number (D). For 1023.95, which fits in 4 digits, it displays as '$1,024' after rounding to fit the format (B). Options A, C, and E show incorrect rounding or formatting that doesn't match Oracle's behavior with this format mask.

Why the other options are wrong

  • A. 10235.95 cannot fit in the '$9,999' format; it displays as ####### rather than with incorrect digit placement.
  • C. 10235.95 exceeds the format width and produces ####### instead.
  • E. 1023.99 rounds to 1024 in the format '$9,999', not displaying as exactly $1,023.

Question 39

Which three statements about roles are true? (Choose three.)

  1. Roles are assigned to users using the ALTER USER statement.
  2. Privileges are assigned to a role using the GRANT statement.
  3. A role is a named group of related privileges that can only be assigned to a user.
  4. A single user can be assigned multiple roles.
  5. Privileges are assigned to a role using the ALTER ROLE statement.
  6. Roles are assigned to roles using the ALTER ROLE statement.
  7. A single role can be assigned to multiple users.
Show answer and explanation

Correct answer: B, D, G. Privileges are assigned to a role using the GRANT statement; A single user can be assigned multiple roles; A single role can be assigned to multiple users.

Privileges are granted to roles using the GRANT statement. A single user can be assigned multiple roles via GRANT ROLE to USER. A single role can be assigned to multiple users, making roles an efficient way to manage privileges. Roles are assigned to users using the GRANT statement, not ALTER USER. Roles are not limited to user assignment only; they can be assigned to other roles. ALTER ROLE is not the correct syntax for assigning privileges or roles.

Why the other options are wrong

  • A. Roles are assigned to users using the GRANT statement, not ALTER USER.
  • C. A role is a named group of privileges that can be assigned to users or other roles, not exclusively to users.
  • E. Privileges are assigned to roles using GRANT, not ALTER ROLE.
  • F. Roles are assigned to other roles using GRANT ROLE, not ALTER ROLE, but this is not a primary administrative method.

Question 40

Which two statements are true about an Oracle database? (Choose two.)

  1. A table can have multiple primary keys.
  2. A column definition can specify multiple data types.
  3. A table can have multiple foreign keys.
  4. A VARCHAR2 column without data has a NULL value.
  5. A NUMBER column without data has a zero value.
Show answer and explanation

Correct answer: C, D. A table can have multiple foreign keys; A VARCHAR2 column without data has a NULL value.

Option C is true: a table can have multiple foreign key constraints, each referencing the same or different parent tables, allowing flexible referential integrity. Option D is true: a VARCHAR2 column that contains no data is stored as NULL in Oracle, not as an empty string or zero-length value. These statements reflect core Oracle database design principles.

Why the other options are wrong

  • A. A table can have only one primary key constraint; multiple unique constraints are possible, but only one primary key.
  • B. A column definition specifies exactly one data type; you cannot assign multiple data types to a single column.
  • E. A NUMBER column without data contains a NULL value, not a zero; zero must be explicitly inserted or provided by a default value.

Question 41

The CUSTOMERS table has a CUST_CREDIT_LIMIT column of data type number. Which two queries execute successfully? (Choose two.)

  1. SELECT NVL2(cust_credit_limit * .15, 'Not Available') FROM customers;
  2. SELECT NVL2(cust_credit_limit, TO_CHAR(cust_credit_limit * .15), 'Not Available') FROM customers
  3. SELECT NVL(cust_credit_limit * .15, 'Not Available') FROM customers;
  4. SELECT NVL(TO_CHAR(cust_credit_limit * .15), 'Not Available') FROM customers;
  5. SELECT TO_CHAR(NVL(cust_credit_iimit * .15, 'Not Available')) FROM customers;
Show answer and explanation

Correct answer: B, D. SELECT NVL2(cust_credit_limit, TO_CHAR(cust_credit_limit * .15), 'Not Available') FROM customers; SELECT NVL(TO_CHAR(cust_credit_limit * .15), 'Not Available') FROM customers;

Option B: NVL2(cust_credit_limit, TO_CHAR(cust_credit_limit * .15), 'Not Available') works because NVL2 requires the second and third arguments to be of compatible types, and TO_CHAR converts the numeric result to a string matching the 'Not Available' string type. Option D: NVL(TO_CHAR(cust_credit_limit * .15), 'Not Available') works because TO_CHAR converts the numeric result to a string before NVL processes it. Option A fails because NVL2's second argument (numeric result) doesn't match the third argument's string type. Option C fails because the numeric result doesn't match the string 'Not Available' type. Option E has a typo (CUST_CREDIT_IIMIT) and would fail.

Why the other options are wrong

  • A. NVL2 second argument returns a number while third argument is a string; type mismatch occurs.
  • C. NVL second argument is numeric but third argument is a string; incompatible types.
  • E. There is a typo in the column name (CUST_CREDIT_IIMIT instead of CUST_CREDIT_LIMIT), causing the query to fail.

Question 42

Which three statements are true about dropping and unused columns in an Oracle database? (Choose three.)

  1. An UNUSED column's space is reclaimed automatically when the row containing that column is next queried.
  2. A column that is set to UNUSED still counts towards the limit of 1000 columns per table.
  3. A DROP COLUMN command can be rolled back.
  4. A primary key column referenced by another column as a foreign key can be dropped if using the CASCADE option.
  5. An UNUSED column's space is reclaimed automatically when the block containing that column is next queried.
  6. Partition key columns cannot be dropped.
Show answer and explanation

Correct answer: B, D, F. A column that is set to UNUSED still counts towards the limit of 1000 columns per table; A primary key column referenced by another column as a foreign key can be dropped if using the CASCADE option; Partition key columns cannot be dropped.

An UNUSED column still counts toward the 1000-column limit because the column definition remains in the data dictionary. Partition key columns cannot be dropped due to partition structure dependencies. Space from UNUSED columns is reclaimed when the block is next queried and the row is accessed, not automatically. DROP COLUMN cannot be rolled back as DDL is auto-committed, and foreign key constraints prevent dropping primary key columns even with CASCADE.

Why the other options are wrong

  • A. Space is reclaimed at the block level during next query, not at the individual row query level.
  • C. DDL statements including DROP COLUMN are auto-committed and cannot be rolled back.
  • E. Space reclamation occurs when the block is queried, not when the block is next queried without row context.

Question 43

Which is true about the & and && prefixes with substitution variables? (Choose all that apply.)

  1. Both & and && can prefix a substitution variable name in queries and DML statements.
  2. An & prefix to an undefined substitution variable, which is referenced twice in the same query, will prompt for a value twice.
  3. & can prefix a substitution variable name only in queries.
  4. An && prefix to an undefined substitution variable, which is referenced multiple times in multiple queries, will prompt for a value once per query.
  5. The && prefix will not prompt for a value even if the substitution variable is not previously defined in the session.
Show answer and explanation

Correct answer: A, B. Both & and && can prefix a substitution variable name in queries and DML statements; An & prefix to an undefined substitution variable, which is referenced twice in the same query, will prompt for a value twice.

Both & and && prefixes can be used in queries and DML statements. The & prefix prompts for a value each time the variable is referenced in the same query, so referencing it twice results in two prompts. The && prefix defines the variable in the session, so subsequent references within the same session don't prompt again, but different queries will still prompt once per query if the variable wasn't previously defined.

Why the other options are wrong

  • C. & can be used in both queries and DML statements, not just queries.
  • D. An && prefix will prompt once when first encountered in the session, then reuse that value in subsequent queries within the same session.
  • E. The && prefix will prompt for a value if the substitution variable is not previously defined in the session.

Question 44

Which three statements are true about the Oracle join and ANSI join syntax? (Choose three.)

  1. The Oracle join syntax supports creation of a Cartesian product of two tables.
  2. The Oracle join syntax only supports right outer joins.
  3. The SQL:1999 compliant ANSI join syntax supports creation of a Cartesian product of two tables.
  4. The Oracle join syntax performs less well than the SQL:1999 compliant ANSI join syntax.
  5. The Oracle join syntax supports natural joins.
  6. The Oracle join syntax performs better than the SQL:1999 compliant ANSI join syntax.
  7. The SQL:1999 compliant ANSI join syntax supports natural joins.
Show answer and explanation

Correct answer: A, C, G. The Oracle join syntax supports creation of a Cartesian product of two tables; The SQL:1999 compliant ANSI join syntax supports creation of a Cartesian product of two tables; The SQL:1999 compliant ANSI join syntax supports natural joins.

Option A is correct because Oracle syntax supports creating a Cartesian product by omitting the join condition in the WHERE clause. Option C is correct because ANSI syntax also supports Cartesian products when no join condition is specified. Option G is correct because ANSI SQL:1999 syntax supports natural joins using the NATURAL JOIN keyword. Option B is incorrect because Oracle syntax supports all join types including left, right, and full outer joins. Option D and F are incorrect because both syntaxes have equivalent performance when optimized by the same Oracle query optimizer. Option E is incorrect because Oracle syntax does not support natural joins.

Why the other options are wrong

  • B. Oracle syntax supports left, right, and full outer joins, not only right outer joins.
  • D. Performance of Oracle and ANSI syntax is equivalent when the optimizer processes them.
  • E. Oracle syntax does not support the NATURAL JOIN keyword; only ANSI syntax does.
  • F. Both syntaxes are optimized identically by Oracle's query optimizer and have equivalent performance.

Question 45

You need to allow user ANDREW to: 1. Modify the TITLE and ADDRESS columns of your CUSTOMERS table. 2. GRANT that permission to other users. Which statement will do this?

  1. GRANT UPDATE ON customers.title, customers.address TO andrew;
  2. GRANT UPDATE (title, address) ON customers TO andrew;
  3. GRANT UPDATE (title, address) ON customers TO andrew WITH GRANT OPTION;
  4. GRANT UPDATE ON customers.title, customers.address TO andrew WITH ADMIN OPTION;
  5. GRANT UPDATE ON customers.title, customers.address TO andrew WITH GRANT OPTION;
  6. GRANT UPDATE (title, address) ON customers TO andrew WITH ADMIN OPTION;
Show answer and explanation

Correct answer: C. GRANT UPDATE (title, address) ON customers TO andrew WITH GRANT OPTION;

The correct syntax specifies GRANT UPDATE with column names in parentheses: UPDATE (title, address). The WITH GRANT OPTION clause (not WITH ADMIN OPTION) allows the grantee to pass these permissions to other users. Option C uses the proper syntax: GRANT UPDATE (title, address) ON customers TO andrew WITH GRANT OPTION. All other options use incorrect syntax, wrong option keywords, or both.

Why the other options are wrong

  • A. This syntax cannot specify individual columns; it attempts invalid dot notation.
  • B. This grants permissions but lacks WITH GRANT OPTION needed to allow ANDREW to grant to others.
  • D. WITH ADMIN OPTION applies to roles and system privileges, not object privileges.
  • E. The syntax is invalid; column names must be in parentheses after UPDATE, not using dot notation.
  • F. WITH ADMIN OPTION is for system and role privileges, not object-level column privileges.

Question 46

Which is true about the ROUND, TRUNC and MOD functions?

  1. TRUNC(MOD(25,3),-1) is invalid.
  2. ROUND(MOD(25,3),-1) is invalid.
  3. ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid and give the same result.
  4. ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid but give different results.
Show answer and explanation

Correct answer: C. ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid and give the same result.

MOD(25,3) returns 1. Both ROUND(1,-1) and TRUNC(1,-1) are valid operations on this result. The -1 parameter rounds/truncates to the nearest 10, and since 1 is less than 10, both functions return 0. Both expressions are valid and produce the same result.

Why the other options are wrong

  • A. TRUNC(MOD(25,3),-1) is valid; TRUNC accepts numeric input and a negative scale parameter.
  • B. ROUND(MOD(25,3),-1) is valid; ROUND accepts numeric input and a negative scale parameter.
  • D. Both functions produce the same result (0) when given the same numeric input and scale parameter.

Question 47

Which two are true about granting object privileges on tables, views, and sequences? (Choose two.)

  1. INSERT can be granted only on tables and sequences.
  2. DELETE can be granted on tables, views, and sequences.
  3. SELECT can be granted on tables, views, and sequences.
  4. ALTER can be granted only on tables and sequences.
  5. REFERENCES can be granted only on tables.
Show answer and explanation

Correct answer: C, D. SELECT can be granted on tables, views, and sequences; ALTER can be granted only on tables and sequences.

Oracle object privileges vary by object type. SELECT can be granted on tables, views, and sequences, making option C correct. ALTER can be granted on tables and sequences but not on views (views are virtual and have no independent structure to alter), making option D correct. These two statements accurately describe the scope of specific privileges across the three object types.

Why the other options are wrong

  • A. INSERT can be granted on tables and views, not just tables; sequences do not support INSERT privilege.
  • B. DELETE can be granted only on tables and views, not on sequences.
  • E. REFERENCES can be granted on tables and also on specific columns of tables in other schemas; it is not exclusive to tables only.

Question 48

The EMPLOYEES table contains columns EMP_ID of data type NUMBER and HIRE_DATE of data type DATE. You want to display the date of the first Monday after the completion of six months since hiring. The NLS_TERRITORY parameter is set to AMERICA in the session and, therefore, Sunday is the first day of the week. Which query can be used?

  1. SELECT emp_id, ADD_MONTHS(hire_date, 6), NEXT_DAY('MONDAY') FROM employees;
  2. SELECT emp_id, NEXT_DAY(ADD_MONTHS(hire_date, 6), 1) FROM employees;
  3. SELECT emp_id, NEXT_DAY(MONTHS_BETWEEN(hire_date, SYSDATE), 6) FROM employees;
  4. SELECT emp_id, NEXT_DAY(ADD_MONTHS(hire_date, 6), 'MONDAY') FROM employees;
Show answer and explanation

Correct answer: D. SELECT emp_id, NEXT_DAY(ADD_MONTHS(hire_date, 6), 'MONDAY') FROM employees;

Option D is correct because NEXT_DAY(ADD_MONTHS(hire_date, 6), 'MONDAY') properly combines the functions: ADD_MONTHS adds 6 months to the hire date, and NEXT_DAY finds the next Monday after that date. The string 'MONDAY' is the correct syntax for NEXT_DAY when NLS_TERRITORY is AMERICA.

Why the other options are wrong

  • A. NEXT_DAY requires a date and a day name or number as arguments; passing only a string 'MONDAY' without a date is incorrect syntax.
  • B. Using 1 as the second argument to NEXT_DAY represents Sunday (first day of the week in AMERICA), not Monday.
  • C. MONTHS_BETWEEN returns a number (difference in months), not a date; NEXT_DAY requires a date as its first argument.

Question 49

Which two statements are true about conditional INSERT ALL? (Choose two.)

  1. Each row returned by the subquery can be inserted into only a single target table.
  2. A single WHEN condition can be used for multiple INTO clauses.
  3. Each WHEN condition is tested for each row returned by the subquery.
  4. It cannot have an ELSE clause.
  5. The total number of rows inserted is always equal to the number of rows returned by the subquery.
Show answer and explanation

Correct answer: B, C. A single WHEN condition can be used for multiple INTO clauses; Each WHEN condition is tested for each row returned by the subquery.

Option B is true because a single WHEN condition can apply to multiple INTO clauses, allowing the same condition to insert into several tables. Option C is true because each WHEN condition is evaluated for every row returned by the subquery, enabling conditional logic based on row values.

Why the other options are wrong

  • A. A row can be inserted into multiple target tables in a conditional INSERT ALL if multiple WHEN conditions are satisfied.
  • D. Conditional INSERT ALL can have an ELSE clause to handle rows that do not match any WHEN condition.
  • E. The total rows inserted can exceed the subquery row count because a single row can be inserted into multiple tables.

Question 50

Which two are true about queries using set operators such as UNION? (Choose two.)

  1. In a query containing multiple set operators, INTERSECT always takes precedence over UNION and UNION ALL.
  2. An expression in the first SELECT list must have a column alias for the expression.
  3. All set operators are valid on columns of all data types.
  4. CHAR columns of different lengths used with a set operator return a VARCHAR2 whose length equals the longest char value.
  5. Queries using set operators do not perform implicit conversion across data type groups (e.g. character, numeric).
Show answer and explanation

Correct answer: D, E. CHAR columns of different lengths used with a set operator return a VARCHAR2 whose length equals the longest char value; Queries using set operators do not perform implicit conversion across data type groups (e.g. character, numeric).

Option D is correct because when CHAR columns of different lengths are used with set operators, Oracle returns a VARCHAR2 with length equal to the greatest of the input lengths. Option E is correct because SET operators do not perform implicit conversion across different data type groups (character to numeric, for example), only within compatible groups. Option A is incorrect because INTERSECT does not always take precedence; precedence is determined by left-to-right evaluation unless parentheses dictate otherwise. Option B is incorrect because column aliases in the first SELECT are optional. Option C is incorrect because set operators are not valid on all data types (e.g., LOBs).

Why the other options are wrong

  • A. INTERSECT does not automatically take precedence; operator precedence follows left-to-right evaluation or parenthetical grouping.
  • B. Column aliases in the first SELECT list are optional, not required.
  • C. Set operators are not valid on all data types; for example, they cannot be used with LOB data types.

50 questions in. Want the rest? The first half of the pack, free by email · The full pack

Question 51

Which three statements are true about a self join? (Choose three.)

  1. It must be an equijoin.
  2. The ON clause must be used.
  3. It must be an inner join.
  4. It can be an outer join.
  5. The ON clause can be used.
  6. The query must use two different aliases for the table.
Show answer and explanation

Correct answer: D, E, F. It can be an outer join; The ON clause can be used; The query must use two different aliases for the table.

Option D is correct because a self join can be an outer join (LEFT OUTER, RIGHT OUTER, FULL OUTER). Option E is correct because the ON clause can be used in self joins (though WHERE can also be used for join conditions). Option F is correct because a self join requires two different aliases for the same table to distinguish rows and create the join logic. Option A is incorrect because a self join does not have to be an equijoin; it can use other conditions. Option B is incorrect because the ON clause is optional, the WHERE clause can be used instead. Option C is incorrect because a self join can be outer, not just inner.

Why the other options are wrong

  • A. A self join does not have to be an equijoin; it can use comparison operators other than equality.
  • B. The ON clause is optional in self joins; the WHERE clause can also establish join conditions.
  • C. A self join can be an outer join, not restricted to inner joins.

Question 52

No user-defined locks are used in your database. Which three are true about Transaction Control Language (TCL)? (Choose three.)

  1. ROLLBACK without the TO SAVEPOINT clause undoes all the transaction's changes, releases its locks, and erases all its savepoints.
  2. ROLLBACK without the TO SAVEPOINT clause undoes all the transaction's changes but does not release its locks.
  3. ROLLBACK without the TO SAVEPOINT clause undoes all the transaction's changes but does not erase its savepoints.
  4. ROLLBACK TO SAVEPOINT undoes the transaction's changes made since the named savepoint and then ends the transaction.
  5. COMMIT ends the transaction and makes all its changes permanent.
  6. COMMIT erases all the transaction's savepoints and releases its locks.
Show answer and explanation

Correct answer: A, E, F. ROLLBACK without the TO SAVEPOINT clause undoes all the transaction's changes, releases its locks, and erases all its savepoints; COMMIT ends the transaction and makes all its changes permanent; COMMIT erases all the transaction's savepoints and releases its locks.

Option A is correct: ROLLBACK without TO SAVEPOINT undoes all changes, releases all locks acquired during the transaction, and erases all savepoints. Option E is correct: COMMIT ends the transaction and makes all changes permanent. Option F is correct: COMMIT also erases all savepoints and releases all locks held by the transaction. These three statements comprehensively describe the effects of ROLLBACK and COMMIT operations.

Why the other options are wrong

  • B. ROLLBACK does release its locks; this statement contradicts standard Oracle behavior where transaction completion releases all locks.
  • C. ROLLBACK without TO SAVEPOINT erases all savepoints, not just preserves them; this statement is incorrect.
  • D. ROLLBACK TO SAVEPOINT undoes changes since the named savepoint but does not end the transaction; the transaction remains active for further operations.

Question 53

Which two are true about external tables that use the ORACLE_DATAPUMP access driver? (Choose two.)

  1. When creating an external table, data can be selected only from a table whose rows are stored in database blocks.
  2. Creating an external table creates a directory object.
  3. When creating an external table, data can be selected from another external table or from a table whose rows are stored in database blocks.
  4. Creating an external table creates a dump file that can be used by an external table in the same or a different database.
  5. Creating an external table creates a dump file that can be used only by an external table in the same database.
Show answer and explanation

Correct answer: C, D. When creating an external table, data can be selected from another external table or from a table whose rows are stored in database blocks; Creating an external table creates a dump file that can be used by an external table in the same or a different database.

When creating an external table with ORACLE_DATAPUMP, the CREATE TABLE AS SELECT statement generates a dump file that contains the extracted data. This dump file is a binary file that can be used by external tables in the same database or different databases, making it highly portable. The dump file serves as the data source for the external table definition.

Why the other options are wrong

  • A. Data can be selected from both regular tables and external tables, not just tables with rows stored in database blocks.
  • B. Creating an external table does not create a directory object; you must create the directory separately with CREATE DIRECTORY.
  • E. The dump file can be used in different databases, not just the same database.

Question 54

Which statement is true about TRUNCATE and DELETE?

  1. For tables with multiple indexes and triggers, DELETE is faster than TRUNCATE.
  2. You can never TRUNCATE a table if foreign key constraints would be violated.
  3. You can DELETE rows from a table with referential integrity constraints.
  4. For large tables, DELETE is faster than TRUNCATE.
Show answer and explanation

Correct answer: C. You can DELETE rows from a table with referential integrity constraints.

DELETE can remove rows from tables with referential integrity constraints because it processes rows individually and can respect foreign key relationships during deletion. TRUNCATE cannot be used on tables with foreign key constraints that would be violated. DELETE is slower than TRUNCATE for large tables because it generates undo/redo logs and fires triggers, while TRUNCATE is a DDL operation that deallocates data blocks.

Why the other options are wrong

  • A. DELETE is actually slower than TRUNCATE for tables with indexes and triggers because DELETE fires triggers and logs each deletion.
  • B. You can TRUNCATE a table if it's the parent table and no child tables reference it, or if the constraint is disabled.
  • D. DELETE is slower than TRUNCATE; TRUNCATE is a fast DDL operation that deallocates data blocks without logging individual row deletions.

Question 55

Which two are true about creating tables in an Oracle database? (Choose two.)

  1. Creating an external table will automatically create a file using the specified directory and file name.
  2. A system privilege is required.
  3. The same table name can be used for tables in different schemas.
  4. A primary key constraint is mandatory.
  5. A CREATE TABLE statement can specify the maximum number of rows the table will contain.
Show answer and explanation

Correct answer: B, C. A system privilege is required; The same table name can be used for tables in different schemas.

A system privilege (CREATE TABLE) is required to create any table in Oracle (B). Multiple schemas can each contain a table with the same name, allowing schema-qualified table names (C). Option A is false because external tables reference existing files; they don't create new files. Option D is false because primary keys are optional constraints. Option E is false because SQL has no syntax to specify a maximum row count in CREATE TABLE.

Why the other options are wrong

  • A. External tables reference pre-existing files in specified directories; they do not automatically create files.
  • D. Primary key constraints are optional; tables can be created without them.
  • E. SQL CREATE TABLE statements cannot specify a maximum number of rows the table will contain.

Question 56

Which two are true about queries using set operators (UNION, UNION ALL, INTERSECT and MINUS)? (Choose two.)

  1. The name of each column in the first SELECT list must match the name of the corresponding column in each subsequent SELECT list.
  2. None of the set operators can be used when selecting CLOB columns.
  3. There must be an equal number of columns in each SELECT list.
  4. Each SELECT statement in the query can have an ORDER BY clause.
  5. The FOR UPDATE clause cannot be specified.
Show answer and explanation

Correct answer: C, E. There must be an equal number of columns in each SELECT list; The FOR UPDATE clause cannot be specified.

Set operators require an equal number of columns in each SELECT list because the result set structure must be consistent. The FOR UPDATE clause cannot be used with set operators because these are set operations that produce derived result sets, not direct table references. Column names do not need to match; only the number and data types matter. ORDER BY can appear only at the very end of the entire query, not in individual SELECT statements. CLOB columns can be used with set operators.

Why the other options are wrong

  • A. Column names do not need to match; only the number and data types are significant.
  • B. CLOB columns can be used with set operators; there is no restriction on this data type.
  • D. Each SELECT statement cannot have its own ORDER BY clause; ORDER BY can only appear at the end of the complete query.

Question 57

Which two are true about unused columns? (Choose two.)

  1. Setting an indexed column to unused results in an error.
  2. You can query the data dictionary to see the names of unused columns.
  3. You can specify multiple column names in an ALTER TABLE...SET UNUSED statement.
  4. If you set all the columns of a table to unused, the table is automatically dropped.
  5. CASCADE CONSTRAINTS must be specified when setting a column to unused if that column is referenced in a constraint on another column.
Show answer and explanation

Correct answer: C, E. You can specify multiple column names in an ALTER TABLE...SET UNUSED statement; CASCADE CONSTRAINTS must be specified when setting a column to unused if that column is referenced in a constraint on another column.

Multiple column names can be specified in a single ALTER TABLE...SET UNUSED statement for efficiency (C is true). CASCADE CONSTRAINTS must be specified when setting a column to unused if that column is referenced in a constraint, to drop those dependent constraints (E is true). Setting an indexed column to unused does not cause an error; indexes are simply orphaned. The data dictionary can show unused columns through the USER_UNUSED_COL_TABS view. Setting all columns to unused does not automatically drop the table.

Why the other options are wrong

  • A. Setting an indexed column to unused does not result in an error; the index becomes orphaned.
  • B. Unused columns cannot be directly queried from the data dictionary by name; you must use specific views like USER_UNUSED_COL_TABS.
  • D. Setting all columns to unused does not automatically drop the table; you must explicitly drop it.

Question 58

Which two statements are true? (Choose two.)

  1. CASE is a function and DECODE is not.
  2. Neither CASE nor DECODE is a function.
  3. All conditions evaluated using CASE can also be evaluated using DECODE.
  4. All conditions evaluated using DECODE can also be evaluated using CASE.
  5. DECODE is a function and CASE is not.
  6. Both CASE and DECODE are functions.
Show answer and explanation

Correct answer: D, F. All conditions evaluated using DECODE can also be evaluated using CASE; Both CASE and DECODE are functions.

Both CASE and DECODE are functions in Oracle SQL. CASE is an ANSI SQL standard conditional expression function, while DECODE is an Oracle-specific function. However, not all conditions that can be evaluated with DECODE can be evaluated with CASE in the same way, as DECODE performs equality comparisons while CASE supports complex conditional logic.

Why the other options are wrong

  • A. DECODE is also a function, not just CASE.
  • B. Both are functions, not neither.
  • C. DECODE has limitations with equality comparisons and cannot replicate all complex CASE logic.
  • E. CASE is also a function, not just DECODE.

Question 59

Examine this query: SELECT TRUNC(ROUND(156.00,-2),-1) FROM DUAL; What is the result?

  1. 150
  2. 200
  3. 160
  4. 100
  5. 16
Show answer and explanation

Correct answer: B. 200

ROUND(156.00, -2) rounds to the nearest hundred, resulting in 200. Then TRUNC(200, -1) truncates to the nearest ten, which is 200 (since 200 already ends in 0).

Why the other options are wrong

  • A. This would be the result if TRUNC alone was applied to 156, but ROUND is executed first.
  • C. This incorrectly assumes TRUNC truncates 156 without first rounding.
  • D. This results from rounding 156 to 200 then incorrectly truncating.
  • E. This is not a valid result of either function on these values.

Question 60

The INVOICE table has a QTY_SOLD column of data type NUMBER and an INVOICE_DATE column of data type DATE. NLS_DATE_FORMAT is set to DD-MON-RR. Which two are true about data type conversions involving these columns in query expressions? (Choose two.)

  1. invoice_date = '15-march-2019' : uses implicit conversion
  2. qty_sold BETWEEN '101' AND '110' : uses implicit conversion
  3. invoice_date > '01-02-2019' : uses implicit conversion
  4. qty_sold = '0554982' : requires explicit conversion
  5. CONCAT (qty_sold, invoice_date) : requires explicit conversion
Show answer and explanation

Correct answer: A, B. invoice_date = '15-march-2019' : uses implicit conversion; qty_sold BETWEEN '101' AND '110' : uses implicit conversion

Option A is correct because when comparing a DATE column to a string literal matching NLS_DATE_FORMAT, Oracle implicitly converts the string to DATE. Option B is correct because when using BETWEEN with a NUMBER column and string literals, Oracle implicitly converts the strings to NUMBER. Option C is incorrect because '01-02-2019' is ambiguous with the NLS_DATE_FORMAT setting and may not convert reliably. Option D is incorrect because NUMBER to string assignment doesn't require explicit conversion in comparisons. Option E is incorrect because CONCAT automatically converts both arguments to VARCHAR2 without requiring explicit conversion.

Why the other options are wrong

  • C. The date string format is ambiguous and may not convert implicitly as expected with the given NLS_DATE_FORMAT.
  • D. Comparing a NUMBER column to a string literal uses implicit conversion, not explicit conversion.
  • E. CONCAT automatically converts its arguments to VARCHAR2 implicitly without requiring explicit conversion.

Question 61

Which two actions can you perform with object privileges? (Choose two.)

  1. Create roles.
  2. Create FOREIGN KEY constraints that reference tables in other schemas.
  3. Delete rows from tables in any schema except SYS.
  4. Set default and temporary tablespaces for a user.
  5. Execute a procedure or function in another schema.
Show answer and explanation

Correct answer: B, E. Create FOREIGN KEY constraints that reference tables in other schemas; Execute a procedure or function in another schema.

Object privileges control actions on specific database objects owned by other users. Option B is correct: with the REFERENCES object privilege on a table, you can create FOREIGN KEY constraints that reference that table in other schemas. Option E is correct: with the EXECUTE object privilege on a procedure or function, you can run it even if it is owned by another schema. Both are concrete actions enabled by object privileges.

Why the other options are wrong

  • A. Creating roles requires the CREATE ROLE system privilege, not an object privilege.
  • C. Deleting rows requires DELETE object privilege on specific tables; you cannot delete from SYS schema tables regardless, as that requires special system privileges.
  • D. Setting tablespaces for users requires ALTER USER and CREATE TABLESPACE system privileges, not object privileges.

Question 62

Which three are key components of an Entity Relationship Model? (Choose three.)

  1. an activity
  2. a table
  3. a relationship
  4. an attribute
  5. a unique identifier
  6. an entity
Show answer and explanation

Correct answer: C, D, F. a relationship; an attribute; an entity

An Entity Relationship Model consists of three core components. Option C (relationship) is correct because relationships define how entities interact. Option D (attribute) is correct because attributes describe the properties of entities. Option F (entity) is correct because entities represent real-world objects or concepts. Option A is incorrect because activities are not a key component of ER models. Option B is incorrect because tables belong to the logical/physical design phase, not the conceptual ER model.

Why the other options are wrong

  • A. Activities are not a key component of Entity Relationship Models.
  • B. Tables are part of the logical or physical schema design, not the conceptual ER model itself.
  • E. While unique identifiers are important in database design, they are not listed as a separate key component of ER models; they are part of entity definitions.

Question 63

Which three statements are true about inner and outer joins? (Choose three.)

  1. A full outer join returns matched and unmatched rows.
  2. Outer joins can be used when there are multiple join conditions on two tables.
  3. A full outer join must use Oracle syntax.
  4. Outer joins can only be used between two tables per query.
  5. A left or right outer join returns only unmatched rows.
  6. An inner join returns matched rows.
Show answer and explanation

Correct answer: A, B, F. A full outer join returns matched and unmatched rows; Outer joins can be used when there are multiple join conditions on two tables; An inner join returns matched rows.

Option A is correct because a full outer join returns all rows from both tables, including matched rows and unmatched rows from each side. Option B is correct because outer joins can be used with multiple join conditions between two tables. Option F is correct because an inner join returns only the rows where the join condition is satisfied in both tables. Option C is incorrect because full outer joins can use either Oracle syntax or ANSI syntax. Option D is incorrect because outer joins can be used in queries with more than two tables. Option E is incorrect because left and right outer joins return matched rows plus unmatched rows from one side, not only unmatched rows.

Why the other options are wrong

  • C. Full outer joins can be written using both Oracle syntax and ANSI SQL:1999 syntax.
  • D. Outer joins can be used between more than two tables in a single query.
  • E. Left or right outer joins return matched rows plus the unmatched rows from one table, not only unmatched rows.

Question 64

Which three queries execute successfully? (Choose three.)

  1. SELECT 1 - SYSDATE - DATE '2019-01-01' FROM DUAL;
  2. SELECT SYSDATE - DATE '2019-01-01' - 1 FROM DUAL;
  3. SELECT SYSDATE / DATE '2019-01-01' - 1 FROM DUAL;
  4. SELECT SYSDATE - 1 - DATE '2019-01-01' FROM DUAL;
  5. SELECT (SYSDATE - DATE '2019-01-01') / 1 FROM DUAL;
  6. SELECT 1 / SYSDATE - DATE '2019-01-01' FROM DUAL;
Show answer and explanation

Correct answer: B, D, E. SELECT SYSDATE - DATE '2019-01-01' - 1 FROM DUAL;; SELECT SYSDATE - 1 - DATE '2019-01-01' FROM DUAL;; SELECT (SYSDATE - DATE '2019-01-01') / 1 FROM DUAL;

Oracle date arithmetic rules: subtracting two dates yields a number (days), subtracting a number from a date yields a date, dividing by a number converts to a fractional number of days, and dividing two dates is invalid. Option B (SYSDATE - DATE - 1) subtracts two dates (yields number) then subtracts 1 (valid). Option D (SYSDATE - 1 - DATE) subtracts 1 from SYSDATE (valid, yields date), then subtracts a date from that result (valid, yields number). Option E ((SYSDATE - DATE) / 1) subtracts two dates (yields number) then divides by 1 (valid arithmetic).

Why the other options are wrong

  • A. 1 - SYSDATE is invalid because you cannot subtract a date from a number.
  • C. SYSDATE / DATE is invalid because dividing a date by another date is not a supported operation in Oracle.
  • F. 1 / SYSDATE is invalid because you cannot divide a number by a date, and the subsequent subtraction of a date does not fix the first operation.

Question 65

Examine the description of the BOOKS table: The table has 100 rows. Examine this sequence of statements issued in a new session: INSERT INTO books VALUES ('ADV112', 'Adventures of Tom Sawyer', NULL, NULL); SAVEPOINT a; DELETE FROM books; ROLLBACK TO SAVEPOINT a; ROLLBACK; Which two statements are true? (Choose two.)

  1. The second ROLLBACK command replays the delete.
  2. The first ROLLBACK command restores the 101 rows that were deleted and commits the inserted row.
  3. The first ROLLBACK command restores the 101 rows that were deleted, leaving the inserted row still to be committed.
  4. The second ROLLBACK command undoes the insert.
  5. The second ROLLBACK command does nothing.
Show answer and explanation

Correct answer: C, D. The first ROLLBACK command restores the 101 rows that were deleted, leaving the inserted row still to be committed; The second ROLLBACK command undoes the insert.

The sequence begins with an INSERT that adds one row (making 101 total), then creates SAVEPOINT a. The DELETE removes all 101 rows. The first ROLLBACK TO SAVEPOINT a restores the database to the savepoint state, which means the 101 rows (original 100 plus the inserted row) are restored, but crucially, the inserted row has not yet been committed, it remains pending in the transaction. The second ROLLBACK (without TO clause) rolls back the entire transaction from its beginning, undoing the initial INSERT statement and leaving the database with only the original 100 rows. Therefore, option C is correct because the first ROLLBACK restores all 101 rows while leaving the inserted row uncommitted, and option D is correct because the second ROLLBACK undoes the insert by rolling back the entire transaction.

Why the other options are wrong

  • A. The second ROLLBACK undoes the insert rather than replaying the delete; it rolls back the entire transaction to before the INSERT statement.
  • B. The first ROLLBACK does not commit the inserted row; it only restores the state to the savepoint, leaving the insert still pending and uncommitted.
  • E. The second ROLLBACK is not a no-op; it rolls back the entire transaction including the original INSERT statement.

Question 66

Which three are true about scalar subquery expressions? (Choose three.)

  1. They can be nested.
  2. They cannot be used in the VALUES clause of an INSERT statement.
  3. A scalar subquery expression that returns zero rows evaluates to zero.
  4. They can be used as default values for columns in a CREATE TABLE statement.
  5. A scalar subquery expression that returns zero rows evaluates to NULL.
  6. They cannot be used in GROUP BY clauses.
Show answer and explanation

Correct answer: A, E, F. They can be nested; A scalar subquery expression that returns zero rows evaluates to NULL; They cannot be used in GROUP BY clauses.

Scalar subqueries can be nested within other subqueries. A scalar subquery expression that returns zero rows evaluates to NULL, not zero. Scalar subqueries cannot be used in GROUP BY clauses because they would need to be evaluated for each group, violating the single scalar value requirement. Scalar subqueries cannot be used in the VALUES clause of INSERT statements as they must return exactly one row and one column.

Why the other options are wrong

  • B. Scalar subqueries can be used in VALUES clauses when they return appropriate scalar values.
  • C. A scalar subquery returning zero rows evaluates to NULL, not zero.
  • D. Scalar subqueries cannot be used as default values in CREATE TABLE statements due to their runtime evaluation nature.

Question 67

You issued this command: DROP TABLE hr.employees; Which three statements are true? (Choose three.)

  1. Sequences used to populate columns in the HR.EMPLOYEES table are dropped.
  2. Synonyms for HR.EMPLOYEES are dropped.
  3. Views referencing HR.EMPLOYEES are dropped.
  4. All constraints defined on HR.EMPLOYEES are dropped.
  5. The HR.EMPLOYEES table may be moved to the recycle bin.
  6. All indexes defined on HR.EMPLOYEES are dropped
Show answer and explanation

Correct answer: D, E, F. All constraints defined on HR.EMPLOYEES are dropped; The HR.EMPLOYEES table may be moved to the recycle bin; All indexes defined on HR.EMPLOYEES are dropped

When a table is dropped, all constraints defined on it are dropped (D is true). All indexes defined on the table are dropped (F is true). The table may be moved to the recycle bin if the recycle bin is enabled (E is true). Sequences are independent objects not automatically dropped when a table is dropped. Synonyms are not dropped; they become invalid references. Views are not dropped but become invalid and cannot be queried.

Why the other options are wrong

  • A. Sequences are independent objects and are not dropped when a table is dropped.
  • B. Synonyms are not dropped; they remain in the data dictionary but become invalid.
  • C. Views are not dropped when a table is dropped; they become invalid instead.

Question 68

Which two statements are true about the COUNT function? (Choose two.)

  1. COUNT(*) returns the number of rows in a table including duplicate rows and rows containing NULLs in any column.
  2. It can only be used for NUMBER data types.
  3. COUNT(DISTINCT inv_amt) returns the number of rows excluding rows containing duplicates and NULLs in the INV_AMT column.
  4. COUNT(inv_amt) returns the number of rows in a table including rows with NULL in the INV_AMT column
  5. A SELECT statement using the COUNT function with a DISTINCT keyword cannot have a WHERE clause.
Show answer and explanation

Correct answer: A, C. COUNT(*) returns the number of rows in a table including duplicate rows and rows containing NULLs in any column; COUNT(DISTINCT inv_amt) returns the number of rows excluding rows containing duplicates and NULLs in the INV_AMT column.

Option A is true because COUNT(*) counts all rows in a result set, including duplicates and rows with NULL values in any column. Option C is true because COUNT(DISTINCT inv_amt) counts unique non-null values in the INV_AMT column, excluding duplicates and NULLs.

Why the other options are wrong

  • B. COUNT can be used with any data type, not just NUMBER.
  • D. COUNT(inv_amt) excludes rows with NULL in INV_AMT; it counts only non-null values in that column.
  • E. A SELECT statement using COUNT with DISTINCT can have a WHERE clause; there is no such restriction.

That was 68 of 272.

The full Oracle 1Z0-071 pack has all 272 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.

Get the full pack

Not ready yet? Get the first 136 free as one PDF by email. Get the Half Pack →