
Answer-first summary for fast verification
Answer: COMMENT "Contains PII"
**Correct Answer: D** **Explanation:** In Databricks SQL, you can add comments to tables using the `COMMENT` clause. The syntax for adding a comment to a table is: ```sql COMMENT 'comment_text' ``` In this specific case, the organization policy requires indicating that the table contains personally identifiable information (PII). The correct way to do this is by using: ```sql COMMENT 'Contains PII' ``` This would make the complete CREATE TABLE statement: ```sql CREATE TABLE customersInFrance COMMENT 'Contains PII' AS SELECT id, firstName, lastName, FROM customerLocations WHERE country = 'FRANCE'; ``` **Why other options are incorrect:** - **A**: Incorrect - There are multiple ways to indicate PII in Databricks, including table comments and TBLPROPERTIES. - **B**: Incorrect - The syntax is wrong. It should be `COMMENT 'PII'` or `COMMENT 'Contains PII'`, not `"COMMENT PII"`. - **C**: Incorrect - The syntax is incorrect. TBLPROPERTIES should be followed by parentheses with key-value pairs, like `TBLPROPERTIES ('contains_pii'='true')`. - **E**: Incorrect - `PII` alone is not valid SQL syntax for table creation. **Best Practice:** While `COMMENT 'Contains PII'` works, a more robust approach for PII indication would be to use `TBLPROPERTIES` with a specific key-value pair, which can be programmatically queried later: ```sql CREATE TABLE customersInFrance COMMENT 'Contains PII' TBLPROPERTIES ('contains_pii'='true') AS SELECT id, firstName, lastName, FROM customerLocations WHERE country = 'FRANCE'; ```
Author: Keng Suppaseth
Ultimate access to all questions.
No comments yet.
CREATE TABLE customersInFrance
CREATE TABLE customersInFrance
_______ AS
SELECT id,
firstName,
lastName,
FROM customerLocations
WHERE country = 'FRANCE';
CREATE TABLE customersInFrance
_______ AS
SELECT id,
firstName,
lastName,
FROM customerLocations
WHERE country = 'FRANCE';
A senior data engineer mentions that it is organization policy to include a table property indicating that the new table includes personally identifiable information (PII). Which of the following lines of code fills in the above blank to successfully complete the task?
A
There is no way to indicate whether a table contains PII.
B
"COMMENT PII"
C
TBLPROPERTIES P II
D
COMMENT "Contains PII"
E
PII