Evaluate the SQL statement:
<code>
TRUNCATE TABLE DEPT;
</code>
Which three are true about the SQL statement? (Choose three.)
A.
It releases the storage space used by the table.
B.
It does not release the storage space used by the table.
C.
You can roll back the deletion of rows after the statement executes.
D.
You can NOT roll back the deletion of rows after the statement executes.
E.
An attempt to use DESCRIBE on the DEPT table after the TRUNCATE statement executes will
display an error.
F.
You must be the owner of the table or have DELETE ANY TABLE system privileges to truncate
the DEPT table
Explanation:
A: The TRUNCATE TABLE Statement releases storage space used by the table,
D: Can not rollback the deletion of rows after the statement executes,
F: You must be the owner of the table or have DELETE ANY TABLE system privilege to truncate
the DEPT table.
Incorrect answer:
Cis not true
Dis not true
Eis not true
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 8-18
Evaluate the SQL statement:
TRUNCATE TABLE DEPT;
A.
It releases the storage space used by the table.
D.
You can NOT roll back the deletion of rows after the statement executes.
F.
You must be the owner of the table or have DELETE ANY TABLE system privileges to truncate
the DEPT table
Ans.: A, D, E
F is wrong: To truncate a table, the table must be in your schema or you must have the DROP ANY TABLE system privilege.
A, D, F are the right answers.
I think there is a typo in F, so it should be DROP ANY TABLE instead of DELETE ANY TABLE.
Sorry the right answer is A, D, F
The DROP ANY TABLE system privilege is required to truncate a table in
another schema.
That is wrong, Salam.
Quote: “The DELETE ANY TABLE system privilege also allows you to delete rows from any table or table partition or from the base table of any view.” – which is, what we want to perform with the TRUNCATE statement. DROP TABLE is needed if we want to delete the table completely.
You must own the schema and drop any table acording to:
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10007.htm
So F is wrong
then how E is right?
NO E IS WRONG BUT there is a typing error
F is wrong, as mentioned before, because DROP ANY TABLE and not DELETE ANY TABLE system privilege is needed.
E is right because TRUNCATE is a DDL statement behaving similarly to DELETE :
SQL> CREATE TABLE DEPT
2 (“DEPARTMENT_ID” NUMBER(4),
3 “DEPARTMENT_NAME” VARCHAR2(30));
Table created.
SQL> INSERT INTO DEPT
2 VALUES (10, ‘IT’);
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SELECT * FROM DEPT;
DEPARTMENT_ID DEPARTMENT_NAME
————- ——————————
10 IT
SQL> TRUNCATE TABLE DEPT;
Table truncated.
SQL> SELECT * FROM DEPT;
no rows selected
SQL> DESCRIBE DEPT;
Name Null? Type
—————————————– ——– —————————-
DEPARTMENT_ID NUMBER(4)
DEPARTMENT_NAME VARCHAR2(30)
SQL>
E is wrong. it will display the data from dept after its truncated with out
any error.
The correct answers are a d f
A D F
Passed the exam last week with 94%.
hey, congrats, could you tell me which dumps you had used to study from and if they were valid for the exam?
Hi Bruno,
Congratulations,
can u please tell us, which dumps have you referred for the Exam IZ0-051.