Step by step design your database to see the basic ER model (1)

Source: Internet
Author: User

Introduction: After designing your database step by step, I have received some emails and a friend calls me directly to ask why it does not contain the physical design of the database.I will explain it hereThe physical design of databases is closely related to database products. The focus of this series is the general concept and method of database design, which is easily overlooked in domestic software projects. Today, we will learn the model components and semantics of the entity relationship ER. This is the basis of the logic design of the database. The content may be boring, but very important and useful.

Due to the large amount of content, we will give two lectures to learn the component of the object link model.

Today, we will first learn about the basic object-link model.

 

Object link ER) the model aims to capture the data requirements of the real world and present them in a simple and easy-to-understand manner. The ER model can be used to communicate with the project team or discuss system data requirements with users.

Basic Elements in ER Model

The basic ER model contains three elements: entity, relation, and attribute.

Figure 1 ER diagram of entities, relationships, and attributes

Entity ):An object is the primary data object. It is often used to represent a person, a place, a thing, or an event. A specific entity is called the entity instance or entity occurrence ). The object is represented in a rectangular box, and the object name is marked in the box. Generally, the first letter of a name is capitalized.

Link Relationships ):A link represents a link between one or more entities. The relationship depends on the entity, and generally does not exist physically. Links are commonly used to indicate the correspondence between objects, one-to-one, one-to-many, and many-to-many. The graph of a link is a diamond, and its name is generally a verb. The link endpoint is associated with the role ). Generally, the role name can be omitted, because the entity name and Link name can clearly reflect the concept of the role, but in some cases, we need to mark the role name to avoid ambiguity.

Attribute Attributes ):The attribute provides a detailed description for the object. A Property of a specific object is called a property value. Attributes of the Employee entity may include: emp-id, emp-name, emp-address, phone-no ....... Attributes are generally expressed in an elliptical shape and connected to the object described in the description. Attributes can be divided into two categories: identifiers, descriptor descriptors ). Identifiers can uniquely identify an instance key of an object. They can be composed of multiple attributes. The ER diagram is marked by an underscore in the property name. Multivalue attributes multivalued attributes) are connected to entities using two lines. For example: hobbies attributes, a person may have multiple hobrs, such as reading, movies ...). Composite attribute Complex attributes) has other attributes.

Identify strong and weak entities:A strong entity has a unique identifier. Weak entity weak entities) identifier comes from one or more other strong entities. Weak entities are represented in a two-line rectangular box and depend on strong entities.


Related Article

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.