ExamGecko
Question list
Search
Search

Question 595 - COF-C02 discussion

Report
Export

To use the overwrite option on insert, which privilege must be granted to the role?

A.
truncate
Answers
A.
truncate
B.
DELETE
Answers
B.
DELETE
C.
UPDATE
Answers
C.
UPDATE
D.
SELECT
Answers
D.
SELECT
Suggested answer: B

Explanation:

To use the overwrite option on insert in Snowflake, the DELETE privilege must be granted to the role. This is because overwriting data during an insert operation implicitly involves deleting the existing data before inserting the new data.

Understanding the Overwrite Option: The overwrite option (INSERT OVERWRITE) allows you to replace existing data in a table with new data. This operation is particularly useful for batch-loading scenarios where the entire dataset needs to be refreshed.

Why DELETE Privilege is Required: Since the overwrite operation involves removing existing rows in the table, the executing role must have the DELETE privilege to carry out both the deletion of old data and the insertion of new data.

Granting DELETE Privilege:

To grant the DELETE privilege to a role, an account administrator can execute the following SQL command:

sqlCopy code

GRANT DELETE ON TABLE my_table TO ROLE my_role;

asked 23/09/2024
PRIYANK SAXENA
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first