
Ultimate access to all questions.
A new data engineering team has been assigned to work on a project. The team will need access to database customers in order to see what tables already exist. The team has its own group team. Which of the following commands can be used to grant the necessary permission on the entire database to the new team?
A
GRANT VIEW ON CATALOG customers TO team;
B
GRANT CREATE ON DATABASE customers TO team;
C
GRANT USAGE ON CATALOG team TO customers;
D
GRANT CREATE ON DATABASE team TO customers;
E
GRANT USAGE ON DATABASE customers TO team;
Explanation:
The correct answer is E. GRANT USAGE ON DATABASE customers TO team;
USAGE privilege: The USAGE privilege on a database allows users/groups to:
Database scope: The requirement is to grant access to the entire "customers" database, so the command should target DATABASE customers.
Direction of grant: The permission should flow FROM the database TO the team, so the syntax is GRANT ... ON DATABASE customers TO team;
A. GRANT VIEW ON CATALOG customers TO team;: This grants VIEW privilege on a catalog, not on a database. VIEW privilege allows viewing catalog metadata, not database contents.
B. GRANT CREATE ON DATABASE customers TO team;: This grants CREATE privilege, which allows creating new tables in the database, but doesn't necessarily grant the ability to see existing tables.
C. GRANT USAGE ON CATALOG team TO customers;: This has the direction reversed (granting from team to customers) and targets a catalog instead of a database.
D. GRANT CREATE ON DATABASE team TO customers;: This grants CREATE privilege on a database named "team" to "customers", which is completely opposite to what's needed.
GRANT <privilege> ON <object_type> <object_name> TO <principal>