Which of the following statements gives user desmond the ability to alter table gl.accounts as well as give this ability to other accounts?
-
grant alter any table with grant option to desmond;
-
grant alter on gl.accounts to desmond with admin option;
-
grant alter any table to desmond with grant option;
-
grant alter any table to desmond with admin option;
ALTER ANY TABLE is a system privilege that requires WITH ADMIN OPTION to grant it to others. WITH GRANT OPTION only applies to object privileges, not system privileges. ALTER ON gl.accounts is an object privilege that doesn't meet the 'any table' requirement.
To answer this question, let's go through each option to understand why it is correct or incorrect:
Option A) grant alter any table with grant option to desmond; This option grants Desmond the ability to alter any table, but it does not give him the ability to grant this permission to other accounts. Therefore, this option is incorrect.
Option B) grant alter on gl.accounts to desmond with admin option; This option grants Desmond the ability to alter the table "gl.accounts" specifically, but it does not give him the ability to grant this permission to other accounts. Therefore, this option is incorrect.
Option C) grant alter any table to desmond with grant option; This option grants Desmond the ability to alter any table, but it does not give him the ability to grant this permission to other accounts. Therefore, this option is incorrect.
Option D) grant alter any table to desmond with admin option; This option grants Desmond the ability to alter any table and also gives him the ability to grant this permission to other accounts. Therefore, this option is correct.
The correct answer is Option D. This option gives Desmond the ability to alter the table "gl.accounts" as well as grant this ability to other accounts.