السؤال اﻻول :
Consider the following relational database schema. Suppose that all the relations were created by (and hence are owned by) user X, who wants to
grant the following privileges to user accounts A, B, C, and D:
EMPLOYEE
Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, Super_ssn, Dno
DEPARTMENT
Dname, Dnumber, Mgr_ssn, Mgr_start_date
DEPT_LOCATIONS
Dnumber, Dlocation
PROJECT
Pname, Pnumber, Plocation, Dnum
WORKS_ON
Essn, Pno, Hours
DEPENDENT
Essn, Dependent_name, Sex, Bdate, Relationship
Write SQL statements to for the following privileges. Use views were appropriate :
Account A can modify DEPARTMENT and PROJECT relations -
Account B can retrieve only DNAME, MGR_SSN, DNUMBER and DLOCATION attributes of DEPARTMENT and DEPT_LOCATION -
Account C can insert or update on WORKS_ON relation and can grant any of these privileges to other users -
Account D can retrieve any attribute of DEPENDENT and WORKS_ON -
__________________________________________________ __________________________________________________ __________________________
السؤال الثاني :
:Consider the Student_Course table for the IT344 with the following fields
Std_ID
Course_ID
Std_Course_Mark
:And the Course Table with the following fields
Course_ID
Course_Name
Maximum_Mark
Minimum_Mark
When the new row in the Student_Course table is added, you need to update the Maximum_Mark and the Minimum_Mark -
Write the trigger called ‘Max_Min’ allowing to update the Maximum_Mark and the Minimum_Mark -