No More Worries!


Our orders are delivered strictly on time without delay

Paper Formatting

  • Double or single-spaced
  • 1-inch margin
  • 12 Font Arial or Times New Roman
  • 300 words per page

No Lateness!

image Our orders are delivered strictly on time without delay

AEW Guarantees

image

  • Free Unlimited revisions
  • Guaranteed Privacy
  • Money Return guarantee
  • Plagiarism Free Writing

Functional Dependencies and Keys

1. Consider a relation R(A,B,C,D,E,F,G,H) with the following functional dependencies:

A -> BCD

AD -> E

EFG -> H

F -> GH

(a) Based on these functional dependencies, there is one minimal key for R. What is it?

(b) One of the four functional dependencies can be removed without altering the key. Which one?

2. Consider the following relational schema:

UnivInfo(studID, studName, course, profID, profOffice)

Each tuple in relation UnivInfo encodes the fact that the student with the given ID and name took the given course from the professor with the given ID and office. Assume that students have unique IDs but not necessarily unique names, and professors have unique IDs but not necessarily unique offices. Each student has one name; each professor has one office.

(a) Specify a set of completely nontrivial functional dependencies for relation UnivInfo that encodes the assumptions described above and no additional assumptions.

(b) Based on your functional dependencies in part (a), specify all minimal keys for relation UnivInfo.

(c) Is UnivInfo in Boyce-Codd Normal Form (BCNF) according to your answers to (a) and (b)? If not, give a decomposition of UnivInfo into BCNF.

(d) Now add the following two assumptions: (1) No student takes two different courses from the same professor; (2) No course is taught by more than one professor (but a professor may teach more than one course). Specify additional functional dependencies to take these new assumptions into account.

(e) Based on your functional dependencies for parts (a) and (d) together, specify all minimal keys for relation UnivInfo.

(f) Is UnivInfo in BCNF according to your answers to (d) and (e)? If not, give a decomposition of UnivInfo into BCNF.

 

 

Sample Answer

 

 

1. Functional Dependencies and Keys

Given Functional Dependencies

– A → BCD
– AD → E
– EFG → H
– F → GH

(a) Minimal Key for R

To find the minimal key for the relation R(A, B, C, D, E, F, G, H), we need to determine the attributes that can uniquely identify all other attributes based on the functional dependencies provided.

1. Start with A: From A → BCD, if we know A, we can derive B, C, and D.
2. Next, consider AD: Since knowing A gives us BCD and AD → E, we can derive E if we also know D.
3. Consider F: If we know F, we can derive G and H since F → GH and EFG → H requires both E and F.
4. Combining: To derive all attributes, we can start from A and include D and F in our key:- A + D derives B, C, D (from A), E (from AD), and F gives us G and H.
– Therefore, one minimal key can be ADF.

(b) Functional Dependency that Can Be Removed

To identify which functional dependency can be removed without altering the key:

1. Check each dependency:- Removing A → BCD: This cannot be removed since A is part of the minimal key.
– Removing AD → E: Cannot be removed as D is necessary to derive E.
– Removing EFG → H: Not critical as we can derive H through F alone.
– Removing F → GH: This dependency is crucial for deriving G and H.

Thus, the functional dependency that can be removed without altering the key is EFG → H.

2. UnivInfo Schema Analysis

Given Schema

UnivInfo(studID, studName, course, profID, profOffice)

(a) Nontrivial Functional Dependencies

Based on the assumptions provided:

1. studID → studName (Each student has one unique ID corresponding to one name)
2. profID → profOffice (Each professor has one unique ID corresponding to one office)
3. studID, course → profID (A specific student taking a specific course is taught by one professor)
4. course → profID (No course is taught by more than one professor)

(b) Minimal Keys for UnivInfo

To determine the minimal keys using the functional dependencies identified:

– From studID and course, we can identify profID:- Thus, a minimal key can be (studID, course).

This combination is sufficient to uniquely identify each tuple in the relation.

(c) Is UnivInfo in BCNF?

To check if UnivInfo is in BCNF:

– A relation is in BCNF if for every functional dependency X → Y, X is a superkey.

1. studID → studName: studID is not a superkey (there are multiple students with the same name).
2. profID → profOffice: profID is a superkey.
3. studID, course → profID: This is fine as it is a superkey.
4. course → profID: course is not a superkey.

Since there are dependencies where the left-hand side is not a superkey (specifically studID → studName and course → profID), UnivInfo is not in BCNF.

Decomposition into BCNF

To decompose:

1. Create a new relation for students:- Students(studID, studName)

2. Create a new relation for professors:- Professors(profID, profOffice)

3. The remaining relation:- CourseInfo(studID, course, profID)

This decomposition results in:

– Students(studID, studName)
– Professors(profID, profOffice)
– CourseInfo(studID, course, profID)

(d) Additional Assumptions Functional Dependencies

With additional assumptions:

1. No student takes two different courses from the same professor:- studID, course → profID

2. No course is taught by more than one professor:- course → profID

Additional dependencies:

– studID, course → profID (already included)
– course → profID (already included)

(e) Minimal Keys with Additional Dependencies

Based on all functional dependencies now:

– The minimal keys remain (studID, course) as this combination still allows us to uniquely identify each tuple in the relation.

(f) Is UnivInfo in BCNF with Additional Dependencies?

We revisit the functional dependencies:

1. studID → studName: studID is not a superkey.
2. profID → profOffice: profID is a superkey.
3. studID, course → profID: This is fine as it is a superkey.
4. course → profID: course is not a superkey.

Since there are still dependencies where the left-hand side is not a superkey (specifically studID → studName and course → profID), UnivInfo remains not in BCNF.

Decomposition into BCNF with Additional Dependencies

The same decomposition as earlier holds:

1. Create Students(studID, studName)
2. Create Professors(profID, profOffice)
3. Create CourseInfo(studID, course, profID)

This ensures that all relations are now in BCNF and adheres to the stated assumptions.

 

This question has been answered.

Get Answer
PLACE AN ORDER NOW

Compute Cost of Paper

Subject:
Type:
Pages/Words:
Single spaced
approx 275 words per page
Urgency:
Level:
Currency:
Total Cost:

Our Services

image

  • Research Paper Writing
  • Essay Writing
  • Dissertation Writing
  • Thesis Writing

Why Choose Us

image

  • Money Return guarantee
  • Guaranteed Privacy
  • Written by Professionals
  • Paper Written from Scratch
  • Timely Deliveries
  • Free Amendments