SQLTeam.com | Weblogs | Forums

Doing this grant sql statement


#1
  1. Write the SQL statement(s) needed to grant BOB the access to some columns of the Authors table.

GRANT
SELECT
ON AUTHORS TO BOB;

is this correct?

  1. Write the SQL statement(s) needed to grant ORDERUSER access to some rows of the Customers table.

this is my answer is this correct? Q2
GRANT
SELECT
ON CUSTOMERS(SomeRows1,SomeRows2)TO ORDERUSER

  1. Suppose SAM now wants GEORGE to act as his security administrator. Write the SQL statement(s) needed to give GEORGE the necessary privileges.

is this correct?

GRANT SELECT TO [ WITH GRANT OPTION ]
[ FROM ]

  1. Suppose that GEORGE executed SQL statements to grant BOB access to the database. What happens to BOB if SAM executes the SQL statement below? Explain your answer.

REVOKE SELECT
ON SALESREPS
FROM GEORGE;

is this correct?

REVOKE SELECT ON SALESREPS FROM GEORGE CASCADE;
GRANT assistant_role TO BOB WITH ADMIN OPTION;
REVOKE WITH ADMIN OPTION FOR assistant_role FROM BOB CASCADE;

  1. Suppose that your DBMS contains a user identified with PHIL as his/her user ID. Write a SQL statement that removes PHIL's read privileges to the ORDERS table.

is this correct?

GRANT SELECT
ON ORDERS
TO PHIL
GO

DENY DELETE
ON ORDERS
TO PHIL;


#2

Your GRANT will give Bob access to all the columns in the Authors table.

GRANT SELECT ON AUTHORS(SomeColumn1, SomeColumn2) TO BOB;


#3

thank you for helping me