
Ultimate access to all questions.
Question 44
A new data engineer has started at a company. The data engineer has recently been added to the company's Databricks workspace as new.engineer@company.com. The data engineer needs to be able to query the table sales in the database retail. The new data engineer already has been granted USAGE on the database retail.
Which of the following commands can be used to grant the appropriate permissions to the new data engineer?
Explanation:
To query a table in Databricks, a user needs the SELECT permission on that specific table. Let's analyze each option:
Option A: GRANT USAGE ON TABLE sales TO new.engineer@company.com; - This is incorrect because USAGE permission on a database allows access to the database, but USAGE on a table is not a valid permission for querying data.
Option B: GRANT CREATE ON TABLE sales TO new.engineer@company.com; - This is incorrect because CREATE permission allows creating new tables, not querying existing ones.
Option C: GRANT SELECT ON TABLE sales TO new.engineer@company.com; - CORRECT. The SELECT permission is required to query (read) data from a table. Since the user already has USAGE on the database retail, granting SELECT on the sales table will enable them to query it.
Option D: GRANT USAGE ON TABLE new.engineer@company.com TO sales; - This is syntactically incorrect and conceptually wrong. The syntax is reversed, and USAGE on a table is not the right permission for querying.
Option E: GRANT SELECT ON TABLE new.engineer@company.com TO sales; - This is syntactically incorrect. The table name and user are reversed in the command.
Key Points:
USAGE on a database allows access to the databaseSELECT on a table allows querying/reading data from that tableUSAGE on the retail database, so they only need SELECT on the sales table to query it