explain
Entity Relationship diagram: denoted e-R diagram refers to the basic structure of data based on the three basic concepts of entity, relation and attribute, thus describing the conceptual model of static data structure. The e-R diagram is an entity-contact diagram, which provides a method for representing the entity, attributes, and connections to describe the conceptual model of the real world. The most common application of E-R model is in the analysis stage of database design, that is, the communication tool and bridge between Database Designer and database user. The role of E-R model is to construct a conceptual data model, and the conceptual data model is the representation of database structure, and this representation is not related to database management system and data model.
Constitute
Entity (Entity):
It is the most basic abstraction concept of relational database, which is used to describe real world objects.
A rectangle is used to indicate the entity name in the rectangular box; For example, students Zhang, students Li Yu Huan are entities.
Entities can be subdivided into:
Strong entity (strong entity): an entity that does not need to be attached to other entities. Represented by a one-sided rectangle.
Weak entities (weak entity): Entities that need to be attached to other entities. Represented by a bilateral rectangle.
Attributes (attribute):
Used to describe the nature of an entity.
It is represented by an ellipse and is connected with the corresponding entity by a non-forward edge, for example, the student's name, study number, gender, all attributes.
Attributes can be divided into:
Simple attribute: It is no longer possible to continue cutting into other meaningful units.
Composite attribute: Represents the future this property can be further cut. Composite For example, the address attribute is composed of the city, county, township, specific location and other attributes.
Derivation attributes (derived attribute):
Contact (Relationship):
Used to represent how an entity relates to another entity.
in Diamonds, the name of the contact in the Diamond box, coupled with the relevant entities without a forward edge, and the type (1:1,1:n or m:n) that is associated with the non-aligned side, refers to the existence of three relationships (one-to-one, One-to-many, Many-to-many). For example, teachers to teach students in the teaching relationship, students choose the course of elective courses.
One-to-one relationships:
A one-to-many or Many-to-many relationship:
Multi-Many-to-many relationships:
The specific entities are as follows: