Database--er mode details __ Database

Source: Internet
Author: User
Tags inheritance

Entity: something that can be distinguished from other objects in reality. An entity can be any actual or abstract.
An entity set is a collection of entities of the same type.
An entity is an extension of an entity set.
A contact set is a link between an entity (not an entity set).
Entity sets participate in the contact set. And the association between specific entities is called a contact instance.
Role: When an entity participates in a single contact set multiple times, there are different roles. Employees and jobs, for example, may be both employees and managers.
Descriptive attribute of the contact set: used to describe the contact set. When a couple of time, descriptive attributes can be placed in many attributes. A multivalued attribute can be used to solve a matching problem.
Degree: The number of entity sets associated with the contact set.
Domain: A collection of desirable values for a property.
Composite property: A property that can be subdivided. Simple property: An attribute that cannot be subdivided.
Multi-valued attribute: can fetch multiple values. You can limit the number of multi-valued attributes when needed.
Derived property: Can be inferred from other properties. Dashed
Map cardinality: How many entities a set of entities are connected to.

Super Code, candidate code (minimum Super Code), main code.
The super code of the contact set is the same as the main code of the associated entity set.
The primary code for the contact set is associated with the mapping cardinality. Multiple to one, is the main code for the "multiple" entity set. One-to-one, is the primary code selection for any entity set.
All involved: each attribute of the entity set is connected to the contact set.

No two-yuan contact set, only one arrow.
L... H indicates that an entity is at least connected to an L entity, with a maximum of H entities.

A correlation set is used when describing the behavior that occurs between entities.
Non-two-yuan contact can be replaced with multiple two-yuan contact.

A Many-to-many contact Set identity attribute can be placed in a "multiple" entity set. A pair of arbitrary.
Weak entity set: There are not enough attribute identifiers to form the primary code. Otherwise a strong entity set.
Weak entity sets need to be associated with an identified set of entities through an identifying set of links, and the weak entity set is Many-to-many. Weak entity sets are all involved.
Weak entity sets only need to specify a property as an assignment, and an assignment can distinguish entities that depend on a weak entity set that is dependent on a particular strong entity.
Weak entity sets exist depending on the identity entity set. The primary code for the weak entity set is the assignment of the weak entity set and the primary code that identifies the entity.

If the weak entity set participates in other identifying contacts, the weak entity set is used instead of the multivalued attribute.

Specialization, generalization.
High-level entity sets and low-level entity sets.
Property inheritance.
Multiple Inheritance: inherited by multiple entities.
Generalized constraints:
1. Membership: (1) condition defined: satisfies predicate. (2) User defined: custom by user.
2. The same generalization: (1) does not intersect. An entity belongs to at most one underlying entity set. (2) There are overlapping. The same entity can belong to multiple low-level entity sets.
There is overlap by default, and disjoint in the triangle means no intersection.
3. Complete constraint. (1) All generalizations. Each high-level entity belongs to one of the lower-level entity sets. (2) Partial generalization. Allow certain high-level entities to not belong to low-level entities.
Partial generalization is the default. All generalizations are expressed in two lines.
Because of the complete constraint, updates need to be updated at the same time.

The ER model cannot express the connection between the contacts, so there is aggregation. Abstracts a connection into a virtual entity.

Convert to relational mode
The entity set and the contact set are all a table.
Strong entity set slightly.
Weak entity set: The main code of the weak entity set is the assignment of the weak entity set and the main code of the corresponding strong entity set, the attribute of the weak entity set is the main code (OUTER code constraint) of the strong entity set + the original attribute.
Contact set: The attribute of a contact set is the primary code + descriptive property of an associated entity set. The selection of the main code of the contact set uses the "more" side. If more on a take more than the main code of that side.
If the n-ary contact set has an arrowhead, the contact set main code is the main code of the entity set and the main code of the entity set of the arrow is removed.
Redundancy:
The set of identity contacts for connecting weak and strong entity sets is redundant and is not represented. Because according to the preceding, the main code of the identity attribute and all properties are the main code + allocation set of the strong entity set. But these tuple are concentrated in weak entities, so there is no need to give a link.

Merging: If an entity set participates in all of the contact set, the entity set and the contact set are merged.
Instead of creating a separate relationship for the composite attribute, you need to use a child attribute.
For a multivalued attribute, the attribute has a multivalued attribute + the main code attribute of the entity set or contact set. The main code is made up of all attributes.

Generalization: The lower-level entity set attribute contains unique attributes + high-level entity Master code.
When generalization is all and does not intersect, you can create a table for each lower-level entity set, listing each attribute of the high-level entity set, without creating a high-level entity set table. The disadvantage, however, is that if a contact set is associated with a high-level entity set, it needs to be transformed into a relational model using a general generalization.
Aggregation: The entire properties of the contact set include the main code of the contact set in the virtual entity (the multiple side of the main code) + the main code for 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.