
Ultimate access to all questions.
A data engineer wants to create a new table containing the names of customers that live in France. They have written the following command: 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 blank to successfully complete the task?
A
There is no way to indicate whether a table contains PII.
B
"COMMENT PI"
C
TBLPROPERTIES PI
D
COMMENT "Contains PII"
E
PII
Explanation:
In Databricks SQL, when creating a table, you can add comments to describe the table using the COMMENT clause. The correct syntax is:
CREATE TABLE table_name
COMMENT 'comment text'
AS SELECT ...
CREATE TABLE table_name
COMMENT 'comment text'
AS SELECT ...
Looking at the options:
COMMENT 'PI' not "COMMENT PI".TBLPROPERTIES is a valid clause for setting table properties, the syntax should be TBLPROPERTIES ('key' = 'value'). TBLPROPERTIES PI is not valid syntax.COMMENT "Contains PII" is the proper syntax to add a comment indicating the table contains PII. The comment should be enclosed in quotes.PII alone is not a valid SQL clause for table creation.Therefore, option D is the correct choice to add a comment indicating the table contains personally identifiable information.