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

Hello this quesion is related to Database Management Please don\'t answer with y

ID: 3741334 • Letter: H

Question

Hello

this quesion is related to Database Management

Please don't answer with your handwriting

thank you

An owner of a relational database (ADMIN) created the following relations: STUDENT ID, NAME, TOTAL_CREDIT, DEP_NUMBER) INSTRUCTOR= (ID, NAME, SALARY DEP NUMBER) COURSES = (COURS-ID, TITLE, DEP NUMBER, CREDITS) DEPARTMENT- (DEP_NUMBER, BUILDING, BUDGET) The ADMIN user wants to pass privileges to other accounts X, Y and Z. Write the correct SQL statements to grant the following privileges. 1) Account X can retrieve or modify any relation except COURSES and can pass any of these privileges to other accounts. [1 mark] 2) Account Y can retrieve all the attributes of STUDENT and COURSES except TOTAL_CREDIT, DEP NUMBER for both relations. [2 marks] 3)Account Z can retrieve any attribute of INSTRUCTOR but only for those whom working on the IT (DEP NUMBER 2). l mark]

Explanation / Answer

The grant statement is rather simple statement and grants permissions to user to handle the database.
Grant can't be applied on rows, therefore we will create views where neccessary and grant the views the permissions.

'with grant option' is used to give the user permission to give other users permissions.

1.) GRANT SELECT, UPDATE ON STUDENT,INSTRUCTOR, DEPARTMENT TO X WITH GRANT OPTION;

2.) CREATE VIEW ForY AS

SELECT ID, NAME, COURS_ID,TITLE, CREDITS

FROM STUDENT,COURSES;

GRANT SELECT ON db.ForY TO Y;

3.) CREATE VIEW ForZ AS

SELECT *

FROM INSTRUCTOR WHERE DEP_NUMBER=2;

GRANT SELECT ON ForZ TO Z ;

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