Answer to Problem 2.9
Consider the two choices:
- Adding a field to an existing table
- The new relation will have the attributes [vin, model, type]. Before we added the type attribute to this relation, there seemed to be only one entity type (vehicle). Now that we've added the type attribute it seems that we have another entity type that we're collecting information about (model). Remember that the identifier (in this case, vin) uniquely identifies one and only one entity (again, in this case, car). But type is a piece of data about the model, not about the car itself. Every time we added an entity (a vehicle) to this relation, we would have to repeat information about the model that we might have entered before. For example, if there were 5000 Ford Mustang GTs in the relation, then 5000 times we would have to indicate that a Ford Mustang GT is sporty. All in all, this doesn't seem like a good solution.
- Creating a new table
- Creating a new table is required since we now have two entity types — vehicles and models. In this first entity type we would have the attributes vin and model while in the second we would have model and type. In the vehicle entity, the model field tells us what model that particular vehicle is. In the model entity, the model field identifies which model we're talking about while the type field tells us what type of vehicle that instances of this model are.
Return to details of ER modeling.
page revision: 1, last edited: 12 Aug 2008 17:16