
Ultimate access to all questions.
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
Explanation:
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:
COMMENT 'comment_text'
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:
COMMENT 'Contains PII'
COMMENT 'Contains PII'
This would make the complete CREATE TABLE statement:
CREATE TABLE customersInFrance
COMMENT 'Contains PII' AS
SELECT id,
firstName,
lastName,
FROM customerLocations
WHERE country = 'FRANCE';
CREATE TABLE customersInFrance
COMMENT 'Contains PII' AS
SELECT id,
firstName,
lastName,
FROM customerLocations
WHERE country = 'FRANCE';
Why other options are incorrect:
COMMENT 'PII' or COMMENT 'Contains PII', not "COMMENT PII".TBLPROPERTIES ('contains_pii'='true').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:
CREATE TABLE customersInFrance
COMMENT 'Contains PII'
TBLPROPERTIES ('contains_pii'='true') AS
SELECT id,
firstName,
lastName,
FROM customerLocations
WHERE country = 'FRANCE';
CREATE TABLE customersInFrance
COMMENT 'Contains PII'
TBLPROPERTIES ('contains_pii'='true') AS
SELECT id,
firstName,
lastName,
FROM customerLocations
WHERE country = 'FRANCE';