diff options
| author | mo khan <mo.khan@gmail.com> | 2020-01-11 16:06:34 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-01-11 16:06:34 -0700 |
| commit | 41262df27166f65aec404b9d6c7021032ae3a3ec (patch) | |
| tree | 3443c435540f3a36eb8f6457b0a67c4deb80b7ff | |
| parent | fdb6e167c10ea83e4d46e2faa4f12424c4ba9b0b (diff) | |
Complete question 6.
| -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. |
