
Answer-first summary for fast verification
Answer: The query will fail because privileges on multiple tables cannot be granted in a single GRANT statement.
Granting permissions on tables, views, schemas, etc., is a common practice when a new team member is added. However, GRANT and REVOKE statements can only be performed on one object at a time. To grant or revoke permissions on multiple objects, multiple statements are required. For example, the correct approach would be to execute two separate statements: `GRANT USAGE ON TABLE customers.demographics TO new_user;` and `GRANT USAGE ON TABLE insurance.policy TO new_user;`. This ensures that the permissions are correctly applied to each table individually.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A newly appointed data engineer requires USAGE privileges on two tables: the 'policy' table from the 'insurance' database and the 'demographics' table from the 'customers' database. What will be the outcome of executing the following query: GRANT USAGE ON TABLES customers.demographics, insurance.policy TO new_user;?
A
The query will fail because privileges on multiple tables cannot be granted in a single GRANT statement.
B
The query will be successful, granting the new_user the requested privileges.
C
TABLES should be replaced with TABLE for the query to execute correctly.
D
The query will not be successful as the GRANT statement cannot be used to grant permissions on tables.
E
The query will execute without errors, but grants will only be given on the first table mentioned.