Question

I've been asked to model a relational database (ER) diagram using UML notation which should show the multiplicity, cardinality/participation of the relationships.

But then I'm asked to use the ER diagram and convert it to a relational database schema showing primary and foreign keys.

What is the difference between the two besides the addition of keys?

Was it helpful?

Solution

There a few more steps. If you have a M:N (or in UML notation, .... ) association then you would need to create an intermediate table to store the links ("instances") of that association in the database as a result of the normalization process.

You must also normalize generalization relationships, association classes and a few other details.

OTHER TIPS

I suppose you refer to UML class diagram.

Class diagram has some features not supported by relational DBs, like inheritance for example. ER diagram in turn has, as you said, keys, indexes and other features, which are not part of basic class diagrams.

Even though the class diagram can be converted to ER diagram pretty easy, as most of its concepts relate 1:1 to corresponding ER concepts. "Special features", like inheritance, can be translated to several solutions in ER (this is yet another wider topic).

Using some ER UML profile for class diagrams, this is all even easier.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top