Database-er mode details

Source: Internet
Author: User

Entity: Objects in reality that can be differentiated from other objects. Entities can be any actual or abstract.
An object set is a set of entities of the same type.
An object is the extension of an object set.
A contact set is a link between entities (non-entity sets.
The entity set participates in the contact set. In addition, the association between specific entities is called a linked instance.
Role: when an entity participates in a consortium multiple times, different roles exist. For example, between an employee and a job, an employee may be both an employee and a manager.
Description attribute of the contact set: used to describe the contact set. When one to multiple attributes exist, descriptive attributes can be put into multiple attributes. Multi-value attribute can be used to solve the matching problem.
Degree: Number of object sets associated with the contact set.
Field: a set of optional attributes.
Composite attributes: Reusable attributes. Simple attributes: attributes that cannot be further divided.
Multi-value attribute: multiple values can be obtained. When necessary, you can limit the number of multi-value attributes.
Derived attributes: can be derived from other attributes. Dotted Line
Ing base: the number of entities that an object set is connected.

Supercode, candidate code (minimum supercode), master code.
The supercode of the contact set is the primary code of the associated object set.
The master code of the contact set is associated with the ing base. Multiple-to-one is the master code of the "multiple" entity set. One-to-one is the master code of any entity set.
All involved: Each attribute of the object set is connected to the contact set.

A non-binary contact set can have only one arrow.
L... h indicates that an object is connected to at least l entities, and at most h entities.

Use a contact set to describe the behavior of an inter-entity relationship.
Non-binary connections can be replaced by multiple binary connections.

Multiple-to-one contact set identity attributes can be placed in a "multiple" entity set. One to One is arbitrary.
Weak entity set: there are not enough attribute identifiers to form the primary code. Otherwise, it is a strong entity set.
A weak entity set is meaningful only when it is associated with a set of identifiers. A weak entity set is multiple-to-one. Weak entity sets must all be involved.
A weak entity set only needs to specify an attribute as a distributor, which can distinguish objects in a weak entity set dependent on a specific strong entity set.
The weak entity set depends on the ID entity set. The master code of the weak entity set is the distribution operator of the weak entity set and the master code that identifies the object.

If the weak entity set participates in other identification links, the weak entity set is used instead of the multi-value attribute.

Special and general.
High-level entity set and low-level entity set.
Property inheritance.
Multi-inheritance: It is inherited by multiple entities.
General constraints:
1. Membership: (1) the condition is defined to satisfy the predicate. (2) User-Defined: User-defined.
2. Same generalization: (1) Not intersecting. An object belongs to at most one underlying entity set. (2) overlap. The same entity can belong to multiple lower-level entity sets.
By default, disjoint is added to the triangle to indicate non-intersection.
3. Complete constraints. (1) All are generalized. Each high-level object belongs to one of the lower-level entity sets. (2) partially generalized. Some high-level entities are not allowed to belong to the lower-level entities.
Partial generalization is the default value. All are generalized and expressed by two lines.
Because of the completeness constraint, updates must be updated at the same time.

The ER model cannot express the association between connections, so there is aggregation. Abstract A link into a virtual entity.

Convert to relational mode
The object set and the contact set are both tables.
The strong entity set is omitted.
Weak entity set: the master code of the weak entity set is the distribution operator of the weak entity set and the master code of the corresponding strong entity set; the weak entity set attribute is the master code (external code constraint) of the strong entity set + the original attribute.
Contact set: the property of the contact set is the master code + descriptive property of the associated object set. The master code of the contact set is "multiple. If many-to-one operations are performed, the master code on the other side is used as the master code.
If the n-Element Contact set has an arrow, the contact set master code is the master code of the object set and the master code of the object set of the arrow is removed.
Redundancy:
Weak connections and strong object sets are redundant and do not need to be expressed. Because according to the preceding, the main code of the Identity attribute and all the attributes are the master code + allocation set of the strong entity set. However, these tuple functions in the weak entity set, so they do not have to be given and do not have a binding effect.

Merge: if an object set participates in all the contact sets, the object set and the contact set are merged.
You do not need to create an independent relationship between composite attributes. You only need to use sub-attributes.
For a multi-value attribute, separate a link for it. The attribute has a multi-Value Attribute + the master code attribute of the object set or contact set. The primary code consists of all attributes.

Generalization: the attribute of the lower-level object set includes the special attribute + the primary code of the higher-level object.
If the generalization is complete and does not overlap, you do not need to create a high-level entity set table, create a table for each low-level entity set, and list each attribute of the high-level entity set. However, there is a drawback: if there is a link set associated with a high-level entity set, you need to use a general method to convert it into a relational model.
Aggregation: all attributes of a contact set include the master code of the contact set in the virtual entity (the master code over the other side) + the master code of the other entity.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.