Er diagram, the database model starts here

Source: Internet
Author: User

Today, Azusa brother asked me to first design a database table for the project, it is best to draw an ER diagram out. Er diagram I know what, because before the database and application of the water class,, but now forget almost, asked the degree Niang, what is the ER diagram? Mom told me, "The e-r graph is also called entity-contact graph (Entities Relationship Diagram), provides methods for representing entity types, attributes, and relationships to describe the conceptual model of the real world."

The following three ingredients are available:

1. The entity type is represented by a rectangle, and the entity name is indicated in the rectangle;

2. the attribute of the entity is represented by an ellipse, and the corresponding entity type is connected with the non-oriented edge;

3. A diamond is used to denote the connection between the entity type , the contact name is indicated in the diamond-shaped frame, and the non-oriented side is connected with the entity type respectively, and the type of the contact on the non-Edge side label (1:1,1:N or M:n).

There will be people in the last 1:1,1:n,m:n here to wonder for a while, I don't have to wonder, see-

1:1 refers to a one-to-one relationship, for example, each citizen has a single ID number, and a valid ID number only corresponds to a citizen.

1:n refers to a one-to-many relationship, such as how many pens each student can have, but only a single owner for each pen (regardless of the special case of the Shen me GUI).

Where's m:n? It refers to many-to-many relationships, so who is active who is passive? Incidentally, the side of the ER diagram is a non-directed edge, so there is this doubt, otherwise directly clear, the above 1-to-many relationship is obviously 1 of the party is "active", then here? Here is the one who marked M is active!!! For example, a salesperson can be responsible for a variety of goods, a commodity can be sold by a number of salespeople, this is a lot of relationships, where the initiative who is passive, it should be easy to find out? So in the corresponding ER diagram, MN is labeled who, it should be very clear, right?

OK, here is not stickers, degrees Niang said he (note is this TA) have a lot ~

Er diagram, the database model starts here

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.