
Ultimate access to all questions.
In a scenario where you are working with Delta Lake tables in Databricks and need to add metadata to a table to provide additional information about its purpose or content, consider the following requirements: the solution must be cost-effective, comply with data governance policies, and easily scalable. Additionally, the method should allow for the comment to be easily viewed by other team members. Given these constraints, which of the following methods is the BEST to add a table comment, and why? Choose one option.
A
Use the ALTER TABLE SET TBLPROPERTIES command to set the comment property of the table to the desired comment. This method directly modifies the table properties, ensuring the comment is stored with the table metadata and is easily accessible.
B
Use the COMMENT ON TABLE command to specify the comment for the table, providing a brief description of its purpose or content. This is the standard SQL approach and is supported in Databricks for Delta tables, making it familiar to most SQL users.
C
Use the DESCRIBE TABLE command with the INCLUDE PROPERTIES option to view the current table properties, including any existing comments. This method is useful for viewing comments but does not allow for adding or modifying them.
D
Use the SHOW TABLES command with the LIKE or REGEXP option to filter the list of tables and identify the table you want to add a comment to. This method helps in locating the table but does not support adding comments.