Question: SQL homework: In this exercise, you will start by writing a script that creates a user with specific privileges. You will use the GRANT statement

SQL homework:

In this exercise, you will start by writing a script that creates a user with specific privileges. You will use the GRANT statement to grant additional privileges to the user and to create a new user.

1.Write a script that creates a user with a username and password of your choosing.

2.Grant the user you created in in exercise 1 SELECT, INSERT, UPDATE, and DELETE privileges for the Customers, Addresses, Orders, and Order_Items tables of the mgs database. However, this user should only have SELECT privileges for the Products and Categories tables. Grant the CREATE SESSION privilege to the user. Also, this user should not have the right to grant privileges to other users.

3.Write a script that views the privileges for the user you created in exercise 1.

4.Write a script that revokes the DELETE privilege on the Orders and Order_Items tables from the user you created in in exercise 1. Write a script that views the updated privileges for the user.

5.Write a DELETE statement that attempts to delete one of the rows in the Products table.

6. Write a script that creates a database role named payment_entry in the mgs schema. This new role should have SELECT and UPDATE privileges for the Products table; SELECT and UPDATE privileges for the Orders table; and SELECT, UPDATE, and INSERT privileges for the Order_Items table. This role should also have the right to create a session.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!