SnowPro Core Certification — Question 311
A user needs to create a materialized view in the schema MYDB.MYSCHEMA.
Which statements will provide this access?
Answer options
- A. GRANT ROLE MYROLE TO USER USER1; CREATE MATERIALIZED VIEW ON SCHEMA MYDB.MYSCHEMA TO ROLE MYROLE;
- B. GRANT ROLE MYROLE TO USER USER1; CREATE MATERIALIZED VIEW ON SCHEMA MYDB.MYSCHEMA TO USER USER1;
- C. GRANT ROLE MYROLE TO USER USER1; CREATE MATERIALIZED VIEW ON SCHEMA MYDB.MYSCHEMA TO USER1;
- D. GRANT ROLE MYROLE TO USER USER1; CREATE MATERIALIZED VIEW ON SCHEMA MYDB.MYSCHEMA TO MYROLE;
Correct answer: A
Explanation
The correct answer is A because granting the role MYROLE to USER1 allows USER1 to create a materialized view associated with that role in the specified schema. Options B and C incorrectly assign the materialized view creation directly to USER1 or USER1 instead of the role, which does not provide the necessary permissions. Option D is incorrect because it suggests creating the view for MYROLE instead of USER1, which is not valid.