To use the overwrite option on insert, which privilege must be granted to the role?
Correct Answer: B
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;
Reference: For additional details on inserting data with the overwrite option and the required privileges, consult the Snowflake documentation on data loading:
https://docs.snowflake.com/en/sql-reference/sql/insert.html