-1

I'm revising for coming exams, and I am having trouble understanding an example question regarding the closure of attributes. Here is the problem:

AB→C
BE→I
E→C
CI→D

Find the closure of the set of attributes BE, explaining each step.

I've found many explanations of the method of closure when the given step is a single entity type, say 'C', using Armstrong axioms, but I don't understand how to answer for 'BE'.

grainman
  • 73
  • 7
  • What do you mean, "single entity type, say 'C'"? C is an attribute & normalization has nothing to do with entity types. Where have you found *any* "explanations of the method of closure when the given step is a single entity type"? What does "combined entity types" mean? Armstrong's axioms are for FDs implied by FDs. Why can't you answer this by referring to your textbook? Please see [ask], hits googling 'stackexchange homework' & the voting arrow mouseover texts. What parts are you able to do? Where are you stuck? What did your textbook or the documentation say about anything relevant? – philipxy May 10 '19 at 10:02

1 Answers1

1

First, you are confusing two very different things, attributes and entity types. Briefly, entity types are used to describe the real world entities that are modelled in a database schema. Attributes describe facts about such entities. For instance an entity type Person could have as attributes Family Name, Date of Birth, etc.

So the question is how to compute the closure of a set of attributes. You can apply the Armstrong’s axioms, trying at each step to apply one of them, until possible, but you can also simplify the computation by using the following, very simple, algorithm (and if you google "algorithm closure set attributes" you find a lot of descriptions of it):

We want to find X+, the closure of the set of attributes X.

To find it, first assign X to X+.
Then repeat the following while X+ changes:
    If there is a functional dependency W → V such as W ⊆ X+ and V ⊈ X+,
       unite V to X+.

So in your case, given:

AB → C
BE → I
E → C
CI → D

to compute BE+ we can procede in this way:

1. BE+ = BE
2. BE+ = BEI (because of BE → I)
3. BE+ = BEIC (because of E → C)
4. BE+ = BEICD (because of CI → D)

No other dependency can be used to modify BE+, so the algorithm terminates and the result is BCDEI. In terms of Armstrong’ axioms, the step 1 is due to Reflexivity, while the steps 2 to 4 are due to a combination of Transitivity and Augmentation.

Renzo
  • 26,848
  • 5
  • 49
  • 61
  • Thank you for your help with this!! I've been staring at this for an embarrassingly long time... – grainman May 10 '19 at 07:52
  • I suspect @grainman is also confusing closure of a set of attributes with closure of a set of FDs--& that that's why they mention Armstrong's axioms. Also I can't think of any common notion of closure involving entity types, so they seem to be confused there. – philipxy May 10 '19 at 09:57