Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Database Security. /* Q2. Do a little research to find what GRANT statement need

ID: 3712934 • Letter: D

Question

Database Security.

/* Q2.
Do a little research to find what GRANT statement needs to execute if we allow the above 'shark'
login to create another login called 'bluewhale with a password 'All-oceans'.
*/

/* Q9.
Assuming you are currently working on a query editing page or session of Clearwater database
in your SQL Server using your own login, what statement do you need to execute in order to
switch the execution context from yours to the 'assistant' user, that is, pretending you are
the 'assistant' user of Clearwater? What statement is needed to switch the execution context
back to your own?
*/
--To switch the execution context from yours to the 'assistant' user:
--To switch the execution context from the 'assistant' user back to your own:


/* Q10.
In Q5, you have granted the 'assistant' user a permission of CREATE TABLE in the Clearwater
database and also allowed this user to grant the same permission to other users of this
database. A big concern and risk of doing so is the 'assistant' user and everyone who was
granted this permission can keep granting to more and more other users, which may become out
of your expectation eventually.
To stop and prevent the 'assistant' user and all who were granted such permission from granting
to even more other users, what statement will you execute?
*/

Explanation / Answer

Database Security.

/* Q2.

Do a little research to find what GRANT statement needs to execute if we allow the above 'shark'

login to create another login called 'bluewhale with a password 'All-oceans'.

*/

Answer)

CREATE USER

Here, I understand that shark is a user where it is required to grant him such access that he can login and create another user names bluewhale with a password 'All-oceans'.

The GRANT statement is the following:

GRANT CREATE USER ON * . * TO shark;

We grant CREATE USER on shark.

Here shark can then login and execute the below statement to to create another login called 'bluewhale with a password 'All-oceans':

CREATE USER bluewhale IDENTIFIED BY 'All-oceans';