SOL-C01 · Question #281
SOL-C01 Question #281: Real Exam Question with Answer & Explanation
The correct answer is E: USE ROLE ACCOUNTADMIN; CREATE OR REPLACE DATABASE SALES DB; GRANT USAGE. Option E is the most efficient and correct. You first need to assume the 'ACCOUNTADMIN' role to ensure you have the necessary privileges to create the database. While not strictly necessary, 'CREATE OR REPLACE is often preferred as it allows the script to be re-run without errors
Question
You need to create a database named 'SALES DB' that is only accessible to users with the 'ACCOUNTADMIN' role. After the database is created, you want to grant the 'USAGE' privilege on it to a custom role named 'DATA ANALYST. Which sequence of commands is the MOST efficient and correct way to achieve this?
Options
- ACREATE DATABASE SALES DB; GRANT USAGE ON DATABASE SALES DB TO ROLE DATA
- BCREATE OR REPLACE DATABASE SALES DB; GRANT USAGE ON DATABASE SALES DB TO
- CUSE ROLE ACCOUNTADMIN; CREATE DATABASE SALES DB; GRANT USAGE ON
- DUSE ROLE ACCOUNTADMIN; CREATE DATABASE SALES DB; GRANT USAGE ON
- EUSE ROLE ACCOUNTADMIN; CREATE OR REPLACE DATABASE SALES DB; GRANT USAGE
Explanation
Option E is the most efficient and correct. You first need to assume the 'ACCOUNTADMIN' role to ensure you have the necessary privileges to create the database. While not strictly necessary, 'CREATE OR REPLACE is often preferred as it allows the script to be re-run without errors if the database already exists. Finally, you grant the USAGE' privilege to the 'DATA ANALYST role. Options A and B do not specify to assume the 'ACCOUNTADMIN' role first. Options C and D does not use the 'CREATE OR REPLACE which is slightly inefficient and option D returns role to Data Analyst after creation which is not required.
Topics
Community Discussion
No community discussion yet for this question.