COF-C02 · Question #220
Which commands should be used to grant the privilege allowing a role to select data from all current tables and any tables that will be created later in a schema? (Choose two.)
The correct answer is C. grant SELECT on all tables in schema DB1. SCHEMA to role MYROLE; D. grant SELECT on future tables in schema DB1. SCHEMA to role MYROLE. Two separate GRANT statements are required. 'GRANT SELECT ON ALL TABLES IN SCHEMA DB1.SCHEMA TO ROLE MYROLE' (C) covers all tables that currently exist. 'GRANT SELECT ON FUTURE TABLES IN SCHEMA DB1.SCHEMA TO ROLE MYROLE' (D) ensures the role automatically receives SELECT on any…
Question
Which commands should be used to grant the privilege allowing a role to select data from all current tables and any tables that will be created later in a schema? (Choose two.)
Options
- Agrant USAGE on all tables in schema DB1. SCHEMA to role MYROLE;
- Bgrant USAGE on future tables in schema DB1. SCHEMA to role MYROLE;
- Cgrant SELECT on all tables in schema DB1. SCHEMA to role MYROLE;
- Dgrant SELECT on future tables in schema DB1. SCHEMA to role MYROLE;
- Egrant SELECT on all tables in database DB1 to role MYROLE;
- Fgrant SELECT on future tables in database DB1 to role MYROLE;
How the community answered
(45 responses)- A4% (2)
- C87% (39)
- E7% (3)
- F2% (1)
Explanation
Two separate GRANT statements are required. 'GRANT SELECT ON ALL TABLES IN SCHEMA DB1.SCHEMA TO ROLE MYROLE' (C) covers all tables that currently exist. 'GRANT SELECT ON FUTURE TABLES IN SCHEMA DB1.SCHEMA TO ROLE MYROLE' (D) ensures the role automatically receives SELECT on any tables created in that schema in the future. USAGE (A, B) is required on schemas and databases, not on tables-SELECT is the correct privilege for reading table data. Options E and F target the entire database rather than a specific schema, which is broader than what was asked.
Topics
Community Discussion
No community discussion yet for this question.