Community Q&A

1Z0-071 — frequently asked questions

Community-vetted answers to 26 common questions about this exam, each traced back to a specific practice question.

Questions from real practice questions

Each Q&A comes from a specific question — follow the link for the full analysis

How Do You Calculate Days from 1 Jan 2019 to SYSDATE in Oracle?

Why does option B fail if Oracle converts date strings implicitly?

Implicit conversion uses the session NLS_DATE_FORMAT of DD-MON-RR, and the literal '01-JAN-2019' carries a four-digit year, so Oracle raises ORA-01861 instead of subtracting.

Is ROUND required to get the number of days, as option C uses?

No. DATE subtraction already returns days as a number; C rounds the fractional value, while E returns it with the time-of-day fraction still attached, which is also accepted.

Which Three Actions Can Be Performed Only With System Privileges?

Why is UTL_FILE flat-file access not a system privilege in this question?

UTL_FILE reads and writes through a DIRECTORY object, and READ/WRITE on that directory are object privileges granted to a specific user, not catalog-wide system privileges.

Can WITH GRANT OPTION be used with system privileges?

No. System privileges are passed on with WITH ADMIN OPTION; WITH GRANT OPTION applies only to the object-privilege form of GRANT.

Which Two SQL Statements Execute on TRANSACTIONS Table?

Why does option E execute successfully but is not in the answer key?

Option E uses valid Oracle syntax: aliases can omit AS and need no quotes if not reserved. The question is flawed because it asks for two, but E also works.

Why does option B fail in Oracle?

Option B uses single quotes for aliases, which Oracle treats as string literals, not identifiers. Also, DATE is a reserved word and cannot be an unquoted alias.

System and Object Privileges in Oracle Database

Why can't WITH GRANT OPTION be used with roles?

Oracle does not allow granting object privileges with WITH GRANT OPTION to roles. It is only permitted for users or PUBLIC.

Does revoking WITH ADMIN OPTION cascade?

No. Revoking a system privilege granted with WITH ADMIN OPTION does not remove the privilege from those who received it via that grant.

Oracle Database and SQL: Read Consistency, Row Locks and Schema Ownership?

Why can't one Oracle user own multiple schemas, as option D claims?

In Oracle a schema is the set of objects owned by one user and carries that user's name, so the user-to-schema relationship is strictly one-to-one; you can be granted privileges on other schemas, but never own a second one.

Can a second database user roll back my UPDATE with the ROLLBACK command?

No. A transaction and its rollback belong to the session that made the change, so another user cannot undo your uncommitted UPDATE — which makes option A false.

Which Statements Are True About Single-Row Subqueries in Oracle?

Does a single-row subquery that returns no rows cause an error?

No. Zero rows produce a NULL comparison and no exception; only a result of more than one row raises ORA-01427, which is why option C is false.

Why is option A (subquery on the left of the operator) considered wrong?

Oracle's documented examples and exam doctrine place the subquery on the right of the comparison operator, with the outer column or expression on the left.

Why Can E.AVG_SAL Be Added to Only One Average-Salary Query?

Why does adding E.AVG_SAL to the first statement raise ORA-00904?

There AVG_SAL is only a column alias for the group function AVG(e.salary), not a table column, so Oracle refuses to qualify it with the table alias E and raises ORA-00904.

Why do both statements display departments with no employees?

Both keep every department row and attach salary data through an outer join or outer-joined inline view, so a department with no employees still appears with a NULL average salary.

Which GRANT Statements Execute Successfully on Roles?

Why does GRANT CREATE TABLE, emp TO manager fail in Oracle?

emp is a role name, not a privilege, so Oracle reads it as a second system privilege and raises ORA-00990. Role names are only valid after TO, in the grantee list.

Can one GRANT mix a system privilege and an object privilege?

No. CREATE TABLE is a system privilege and SELECT ON hr.employees is an object privilege; they need separate GRANT statements, which is why E fails while D succeeds.

Which Three Statements Are True About Oracle Built-in Data Types?

Why is option C incorrect for a VARCHAR2 column?

VARCHAR2 requires an explicit length in SQL; omitting it raises ORA-00906. Unlike CHAR, there is no default length for VARCHAR2.

Does CHAR default to 1 byte or 1 character?

The default length is 1, but the unit depends on NLS_LENGTH_SEMANTICS (BYTE by default, or CHAR if set). So it is not always one character.

Which Three Object Privileges Apply to Tables, Views, and Sequences?

Why is SELECT not one of the correct answers even though it can be granted on tables and views?

SELECT is also grantable on sequences, so it does not represent an exclusive restriction like the correct options A, D, and E.

Can DELETE be granted on sequences?

No, DELETE is only valid on tables and views; sequences do not support DELETE object privileges.

Which Three Statements About Oracle Privileges and Roles Are True?

Why is option C (all roles owned by SYS) false in Oracle?

Only Oracle-supplied predefined roles such as DBA, CONNECT and RESOURCE are created in the SYS schema; a role you create with CREATE ROLE is owned by you, as option E states.

Why can't PUBLIC be revoked from a user in option B?

PUBLIC is a built-in group that every database user belongs to implicitly. You can revoke a privilege granted to PUBLIC, but you cannot revoke PUBLIC membership itself.

Which Two Statements Are True About WITH GRANT OPTION?

Why is WITH GRANT OPTION invalid for system privileges in Oracle?

System privileges and roles are extended with WITH ADMIN OPTION instead; WITH GRANT OPTION applies to object privileges such as SELECT, INSERT or UPDATE on a table or view.

Can a grantee holding WITH GRANT OPTION pass the privilege to PUBLIC?

No. The documented grant-option privilege lets the grantee grant the object privilege to any user in the database, but not to PUBLIC, which makes option D true.

Which three commands succeed on a read-only PRODUCTS table?

Why does TRUNCATE TABLE fail on a read-only PRODUCTS table?

Oracle blocks it with ORA-12081 because read-only mode prohibits any operation that deletes row data or resets the table's high-water mark, even though TRUNCATE is DDL.

Can ALTER TABLE ... SET UNUSED run on a read-only table?

No. SET UNUSED is structural DDL and fails with ORA-12081; only DROP UNUSED COLUMNS, which cleans up columns already marked unused, is permitted.