Database--er schema Detailed __ Database

Source: Internet
Author: User
Tags abstract inheritance

Entities: Things 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 connection between entities (non-entity sets).
Entity sets participate in contact sets. And the association between specific entities is called a contact instance.
Role: When an entity participates in a contact set more than once, there will be different roles. For example, between employees and work, employees may be both employees and managers.
Descriptive attribute of the contact set: used to describe the contact set. When a couple of days, descriptive attributes can be put into many attributes. You can solve a matching problem by using multivalued properties.
Degree: The number of entity sets associated with the contact set.
Domain: A collection of desirable values for a property.
Composite properties: Properties that can be re-partitioned. Simple properties: Properties that are not re-partitioned.
Multivalued property: Multiple values can be taken. You can limit the number of multi-valued attributes when needed.
Derived properties: Can be deduced by other properties. Dashed
Map cardinality: How many entities are connected to an entity set.

Super Code, candidate code (minimum Super Code), main code.
The super code of the contact set is the and of the Master Code of the associated entity set.
The main code of the contact set is associated with the map cardinality. Many-to-one is the main code for the "many" entity set. Single-to-one, is the main code selection of any entity set.
All participation: Each attribute of an entity set is connected to a contact set.

Not two yuan contact concentration, only one arrow.
L ... H indicates that an entity is at least connected to an L entity and is connected to a maximum of H entities.

The contact set is used when describing the behavior of the entities that occur between them.
A non-two-yuan connection can be replaced with multiple two-yuan contacts.

Many-to-one contact set identity attributes can be placed in "many" entity sets. A pair of arbitrary.
Weak entity set: There are not enough attribute identifiers to form the main code. Otherwise, a strong entity set.
Weak entity sets need to be associated with an identifiable set of entities through an identity contact set to make sense, and a weak entity set is many-to-one. Weak entity sets are all involved.
A weak entity set requires only a single attribute as an assignment, which distinguishes between entities in a weak entity set that depend on a particular strong entity set.
The existence of a weak entity set depends on the identity entity set. The primary code for a weak entity set is the identifier of the weak entity set and the main code that identifies the entity.

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

Specialization, generalization.
High-level entity set and lower entity set.
Property inheritance.
Multiple Inheritance: inherited by multiple entities.
Generalized constraints:
1. Membership: (1) condition defined: satisfies the predicate. (2) User defined: customized 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.
By default, there is overlap, and the disjoint is not intersected by the triangular side.
3. Complete constraints. (1) All generalizations. Each high-level entity belongs to one of the lower entity sets. (2) Partial generalization. Some high-level entities are allowed to be outside the lower bodies.
Partial generalization is the default. All generalizations are expressed in two lines.
Because of the complete constraint, the update needs to be updated at the same time.

The ER model is not able to represent the linkage between links and therefore there is aggregation. Abstract a connection into a virtual entity.

Convert to relational mode
Both the entity set and the contact set are a table.
Strong entity set slightly.
Weak entity set: The main code of weak entity set is the assignment of weak entity set and the main code of corresponding strong entity set, and the attribute of weak entity set is the main code of strong entity set (OUTER code constraint) + original attribute.
Contact set: The attribute of the contact set is the main code + descriptive attribute of the associated entity set. The main code of the contact set is chosen by the "many" side. If you have more than a lot of the main code over there.
If the n-ary contact set has an arrow, the main code of the set is the master code of the entity set and the main code of the entity set to remove the arrows.
Redundancy:
An identifying contact set that connects weak and strong entity sets is redundant and does not have to be represented. Because the main code of the identity attribute is followed by the preceding, and all attributes are the main code + allocation set of the strong entity set. However, these tuples are concentrated in weak entities, so it is not necessary to give them a link.

Merge: If there is an entity set that is all involved in the contact set, then the entity set and the contact set are merged.
Instead of creating a separate relationship for a composite attribute, just use the child attribute.
For a multivalued attribute, for which a relationship is re-divided, the attribute has a multivalued attribute + the main code attribute of the entity set or contact set. The main code consists of all attributes.

Generalization: The lower-level entity set attribute contains the unique attribute + upper entity master code.
When generalization is all and disjoint, you can create a table for each lower-level entity set, listing each property of a high-level entity set, without creating a high-layer entity set table. One drawback, however, is that if a contact set is associated with a high-level entity set, it needs to be transformed into a relational model with a general generalized approach.
Aggregation: The full properties of the contact set include the master code of the contact set in the virtual entity (the main code that is more over there) + 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.