diff options
| -rw-r--r-- | assignments/1/README.md | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/assignments/1/README.md b/assignments/1/README.md index 33c8da0..74e25ec 100644 --- a/assignments/1/README.md +++ b/assignments/1/README.md @@ -175,16 +175,25 @@ The following functional dependencies also apply: * dep_no g mgr_emp_no, dep_no g d_budget * mgr_emp_no g dep_no -Transform this relation into 3 NF. Justify any decomposition. +Transform this relation into 3NF. Justify any decomposition. ### Question 6 (15 marks) Consider the following relations: - ```text - Emp(E_id: integer, E_name: string, Age: integer, Salary: real) - Works(E_id: integer, Dep_id: integer, affectation: date) - Dept(Dep_id: integer, Dep_name: string, budget: real, Manager_id: integer) - ``` -* What referential integrity constraints exist between these relations? -* What are the options for enforcing these constraints when a user attempts to delete a Dept tuple? +```text +Emp(E_id: integer, E_name: string, Age: integer, Salary: real) +Works(E_id: integer, Dep_id: integer, affectation: date) +Dept(Dep_id: integer, Dep_name: string, budget: real, Manager_id: integer) +``` + +1. What referential integrity constraints exist between these relations? + +The `Works` relation has a foreign key to the `Dept` table via the `Dep_id` attribute. +The `Dept` relation has a foreign key to the `Emp` table via the `Manager_id` attribute. + +2. What are the options for enforcing these constraints when a user attempts to delete a Dept tuple? + +If a foreign key constraint is added for each identified foreign key, then an attempted +deletion from the `Dept` table would produce an anomaly if any rows in the `Works` relation +has a foreign key reference to the `Dept` relation that a user was attempting to delete. |
