Q1
True / FalseThe TRUNCATE statement in Oracle is used to delete all rows from a table.
The TRUNCATE statement removes all rows from a table, effectively making it empty.
Q2
True / FalseIn Oracle, the TRUNCATE statement is faster than the DELETE statement for removing all rows from a table.
The TRUNCATE statement is typically faster than DELETE because it deallocates the data pages used by the table, whereas DELETE logs each row deletion.
Q3
True / FalseThe TRUNCATE statement can be rolled back if it is part of a transaction.
The TRUNCATE statement is a DDL operation and is automatically committed; it cannot be rolled back.
Q4
True / FalseIn Oracle, the TRUNCATE statement resets any auto-increment counters associated with the table.
The TRUNCATE statement does not reset sequence numbers associated with the table.
Q5
True / FalseThe TRUNCATE statement in Oracle cannot be used if there are foreign key constraints referencing the table.
You cannot truncate a table that is referenced by a foreign key constraint. You must disable the constraints or use DELETE instead.
Q6
True / FalseIn Oracle, the TRUNCATE statement does not fire any DELETE triggers on the table.
TRUNCATE does not fire DELETE triggers because it does not perform row-level deletions.
Q7
True / FalseIn Oracle, the TRUNCATE statement can be used on partitioned tables to truncate individual partitions.
The TRUNCATE statement can be used to truncate individual partitions of a partitioned table, allowing for more granular data management.
Q8
True / FalseUsing the TRUNCATE statement in Oracle will remove all indexes on the table.
TRUNCATE does not remove indexes; it only removes the data while retaining the structure of the table and its indexes.
Q9
True / FalseThe TRUNCATE statement in Oracle deallocates all space used by the table.
TRUNCATE deallocates the data pages but retains the table's structure, including allocated extents and other structural metadata.
Q10
True / FalseThe Oracle Certified Professional (OCP) exam includes knowledge on using the TRUNCATE statement, understanding its implications, and optimizing its usage in database management.
The OCP certification covers advanced topics, including the proper use of the TRUNCATE statement, its implications for data and performance, and optimization strategies for database management.
Q28
Multiple ChoiceSelect the SQL scripts that correctly perform a TRUNCATE operation on a table with audit logging in Oracle.
SQL Code
You need to truncate the 'audit_trail' table, but first ensure that an audit log entry is made before the truncation. Implement this using a TRUNCATE statement with audit logging.
Which of the following SQL scripts correctly implement this scenario?
Audit logging during a TRUNCATE operation can be implemented by first creating a log entry and then performing the TRUNCATE. The correct scripts will demonstrate how to ensure that the log entry is created before the truncation occurs.