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

6. (10 points) For the Elmasri company database, write the SQL to do the followi

ID: 3741584 • Letter: 6

Question

6. (10 points) For the Elmasri company database, write the SQL to do the following (you do not have to implement these queries, just write them): (a) Give Bob the privelege to read the entire PROJECT table, and the privelege to delete rows, and Bob should also be able to pass this privelege on to other users (b) Revoke Bob's privelege to delete rows, and also revoke the privelege of anybody else who got this privelege from Bob. (c) Give Alice the privelege to insert new rows into the PROJECT table, but Alice can't pass this privelege to other users. (d) Give Mike the privelege to read the ssn and name of those employees who work in the finance department and Mike should also be able to pass this privelege on to other users. 7. (15 points) For the Elmasri company database, write SQL constraints or assertions for each of the following (each part is to be done independently of the other parts). You do not have to implement these queries, just write them (a) No employee can have a salary of less than 38,000 (b) No employee can have more than 5 dependents

Explanation / Answer

Answer 6:

a)

GRANT DELETE

ON Project

TO Bob

WITH GRANT OPTION;

(WITH GRANT OPTION can give privilege to grant the role to others)

b)

REVOKE GRANT OPTION FOR DELETE

ON Project

FROM Bob CASCADE

(cascade can revoke the privilege of delete from users to whom it was given by Bob)

C)

GRANT INSERT

ON Project

TO Alice

[if you do not write anything then it wont be able to grant privilege to others]

d) GRANT SELECT ON ssn.Employee and name.Employee TO (select name from Employee where department= “finance”) CASCADE;

Answer 7:

I have answered your question. Please do not forget to give a positive feedback to the answer. Thank you.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote