1. Strong entity set with simple attributes
Person ( ID number , name, gender)
2. Derived attributes do not appear
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
People ( ID number , surname, first name)
3. Multi-valued attributes are also constructed
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.
- 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
The main code of the connection set: In
general, 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.