You are on page 1of 2

Camiña, Rey Francis R.

IT501A
Advanced Database Systems

1. Create a login with the following credentials. username: YourName (Ex.


Mark), password: pw123.
CREATE LOGIN Rey
WITH PASSWORD = ‘pw123’

2. Create another user under the login you have created.


CREATE USER Camina
FOR LOGIN Rey
3. Create a user-defined role named "udr_YourNickname" with a privilege of
viewing and updating the data in the "Items" table.
CREATE ROLE [udr_Francis]
GRANT SELECT, UPDATE
ON Items
TO [udr_Francis]

4. Assign the created user-defined role to the user.


ALTER ROLE [udr_Francis]
ADD MEMBER Rey

5. Give the user an access to view, update, and delete data in the "Items"
table.
GRANT DELETE
ON Items
TO Rey
6. Remove the role you have assigned to that user.
ALTER ROLE [udr_Francis]
DROP MEMBER Rey

7. Change the access of that user by removing his privilege to delete data in
the "Items" table
REVOKE DELETE
ON Items
TO Rey

You might also like