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 <<<<
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.'
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.
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.
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'.
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
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.
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/
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.
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.
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).
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.
Bissto
5 months agobillysunday1
10 months, 2 weeks agohmatinnn
11 months, 3 weeks agohmatinnn
11 months, 3 weeks agoyanoolthecool
1 year, 1 month agoyanoolthecool
1 year, 1 month agolucemqy
1 year, 2 months agoMcromeo
1 year, 4 months agojm9999
1 year, 4 months agojm9999
1 year, 3 months agoRoneros
1 year, 4 months agoTofOra
12 months agoOrxan_H
1 year, 5 months agoShrimathi
1 year, 6 months agoESZ
1 year, 6 months agozouve
1 year, 7 months agoTofOra
12 months agoCecilia_Soso
1 year, 9 months agoaamm74200
2 years agojfc1
2 years agodexdinh91
2 years ago