exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 115 discussion

Actual exam question from Oracle's 1z0-071
Question #: 115
Topic #: 1
[All 1z0-071 Questions]

Which statement is true about TRUNCATE and DELETE?

  • A. For tables with multiple indexes and triggers, DELETE is faster than TRUNCATE.
  • B. You can never TRUNCATE a table if foreign key constraints would be violated.
  • C. You can DELETE rows from a table with referential integrity constraints.
  • D. For large tables, DELETE is faster than TRUNCATE.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Bissto
5 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
billysunday1
10 months, 2 weeks ago
Selected Answer: B
Answer is B ORA-02266: unique/primary keys in table referenced by enabled foreign keys
upvoted 1 times
...
hmatinnn
11 months, 3 weeks ago
Selected Answer: B
So answer should be B
upvoted 1 times
...
hmatinnn
11 months, 3 weeks ago
The answer is B Here is explanation : In this option it does not mean you can never truncate a table it says if foreign key activated and would be violated you can NEVER. The keyword is IF <<<<
upvoted 1 times
...
yanoolthecool
1 year, 1 month ago
Selected Answer: C
C CAN work if we have CASCADE, B is wrong cuz it says NEVER, the documentation states: 'You cannot truncate the parent table of an enabled foreign key constraint. You must disable the constraint before truncating the table. An exception is that you can truncate the table if the integrity constraint is self-referential.'
upvoted 1 times
yanoolthecool
1 year, 1 month ago
there's also this: CASCADE If you specify CASCADE, then Oracle Database truncates all child tables that reference table with an enabled ON DELETE CASCADE referential constraint. This is a recursive operation that will truncate all child tables, grandchild tables, and so on, using the specified options.
upvoted 1 times
...
...
lucemqy
1 year, 2 months ago
Selected Answer: C
C is correct since you can delete using cascade option B is incorrect since it says never but you can by disable the constraint
upvoted 3 times
...
Mcromeo
1 year, 4 months ago
Selected Answer: B
B is correct. Truncate is faster than delete
upvoted 1 times
...
jm9999
1 year, 4 months ago
Very confusing. It seems truncate is always faster than delete. And for B and C, B is false if you use cascade in the command and constraint was created with on delete cascade. Similarly with C, if constraint was created with on delete cascade then you can delete those rows.
upvoted 1 times
jm9999
1 year, 3 months ago
The problem with B is that there is an exception for self referential constraint and B uses the word 'never'. I think it's C because of the 'on delete cascade option'.
upvoted 1 times
...
...
Roneros
1 year, 4 months ago
Selected Answer: B
You cannot truncate the parent table of an enabled foreign key constraint. You must disable the constraint before truncating the table. https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/TRUNCATE-TABLE.html
upvoted 1 times
TofOra
12 months ago
From the link: You cannot truncate the parent table of an enabled foreign key constraint. You must disable the constraint before truncating the table. An exception is that you can truncate the table if the integrity constraint is self-referential.
upvoted 1 times
...
...
Orxan_H
1 year, 5 months ago
Selected Answer: B
B is correct
upvoted 2 times
...
Shrimathi
1 year, 6 months ago
C is correct, We can trucate table contains referential integrity, one by drop the constraint/ while adding constraint we can include on delete cascade . Truncate table colors cascade; this statement will run successfully. Reference https://www.examtopics.com/discussions/oracle/view/15064-exam-1z0-071-topic-1-question-268-discussion/
upvoted 2 times
...
ESZ
1 year, 6 months ago
This needs to be updated!
upvoted 1 times
...
zouve
1 year, 7 months ago
Option B is true. When using the TRUNCATE statement, if there are foreign key constraints referencing the table to be truncated, you will not be able to truncate the table. Truncating a table removes all the data in the table, and if there are dependent foreign key constraints, truncating the table would violate those constraints. In such cases, you would need to either disable or drop the foreign key constraints before truncating the table.
upvoted 1 times
TofOra
12 months ago
It says "NEVER", but is possible for self referenced tables.
upvoted 1 times
...
...
Cecilia_Soso
1 year, 9 months ago
B -You cannot truncate the parent table of an enabled foreign key constraint. You must disable the constraint before truncating the table. An exception is that you can truncate the table if the integrity constraint is self-referential.
upvoted 1 times
...
aamm74200
2 years ago
C. A and D: False --> Truncate is better and has better performance than delete and Drop except for very small tables. B False --> You can truncate a table with a FK on Cascade. You can disable FK and then Truncate (except if FK is self-refential).
upvoted 4 times
...
jfc1
2 years ago
Selected Answer: B
D is wrong . B is correct https://docs.oracle.com/database/121/SQLRF/statements_10007.htm#SQLRF01707
upvoted 2 times
...
dexdinh91
2 years ago
Selected Answer: B
I think B is correct (but not sure 100%)
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago