ER diagram converted to relationship mode

1. Strong entity set with simple attributes

Insert picture description here
Person ( ID number , name, gender)

2. Derived attributes do not appear

Insert picture description here
The age can be calculated from the ID number, so age is a derived attribute.
Person ( ID number , name)

3. Compound attributes are replaced by sub-attributes

Insert picture description here
People ( ID number , surname, first name)

3. Multi-valued attributes are also constructed

Insert picture description here
For a multi-valued attribute M, a relationship pattern R is constructed, which includes an attribute A corresponding to M and an attribute corresponding to the main code of the entity set or contact set where M is located. The main code of R is composed of all the attributes of R.

Person ( ID card number , name);
person-phone ( ID card number , phone number )

  • If an entity set has only one main code and a multi-valued attribute, we only convert to a relational model.Insert picture description here
  • Person ( ID card number, phone number )

4. Weak entity set

The main code of the weak entity set is composed of its own discriminator and the main code of the dependent strong entity set.
Its attributes consist of its own attributes and the main code of the strong entity set that it depends on.

5. Contact set

Insert picture description hereThe main code of the connection set: In
Insert picture description heregeneral, the mode of connecting the connection set between the weak entity set and the strong entity set on which it depends is redundant, and it is not necessary to give it in the design of the relational database based on the ER diagram.

Published 161 original articles · Like 68 · Visitors 20,000+

Guess you like

Origin blog.csdn.net/qq_43179428/article/details/105309972