
Answer-first summary for fast verification
Answer: `COMMENT "Table contains PII"`
The correct method to add a description to a table's metadata in SQL is by using the `COMMENT` clause. This is because: - `TBLPROPERTIES` is used to set table properties, not descriptions. - `OPTIONS` is intended for passing storage properties to the underlying storage, not for adding descriptive metadata. - `DESCRIPTION` and `TEXT` are not valid SQL clauses for this purpose. Therefore, the appropriate code snippet is `COMMENT "Table contains PII"`, which directly adds the desired description to the table's metadata.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A data engineer is tasked with creating a Delta table named customers that will store Personally Identifiable Information (PII). The initial SQL DDL is as follows:
CREATE TABLE customers(
ssn STRING,
name STRING,
age INT,
gender STRING
)
CREATE TABLE customers(
ssn STRING,
name STRING,
age INT,
gender STRING
)
A senior data engineer suggests adding a description, "Table contains PII", to the table's metadata to inform users about the nature of the data it holds. Which of the following code snippets should the data engineer use to implement this suggestion?
A
TBLPROPERTIES ("Table contains PII")
B
DESCRIPTION {"Table contains PII"}
C
COMMENT "Table contains PII"
D
OPTIONS ("Table contains PII")
E
TEXT "Table contains PII"