science

1028Currently online
185Today's Reading
36Share Today
Multilingual display

How to draw database er diagram

2018-03-30 16:00:39

Now software development needs to use the database, developers in the database design need to understand the system involved in the object, each object has what properties, objects and objects between what. The ER diagram is to represent this information in a graphical form, with ER diagram, developers can quickly model according to ER diagram. Today Xiaobian share with you how to draw ER diagram.

Tools/Materials

Microsoft Visio 2007

Methods/Steps
1

First of all, we must understand the core elements of ER diagram: entity, attribute, relationship; Entities are objects, cats; A property is a property that the entity owns, the sex of the cat; A relationship is a relationship between entities or within entities.

2

Secondly, we need to understand how to represent the three core elements described in 1 in the ER diagram: in the ER diagram, the rectangle represents the entity, the ellipse represents the attribute, the diamond represents the relationship, and the various shapes are connected by line segments.

3

Here we use an example to draw an ER diagram together, first open visio, I use 2007 here, open "" -->" General "-->" Basic block Diagram ", an empty interface, as shown below:

4

In this empty picture, we want to represent the following relationship, object 1: student (name, student number, department); Object 2: Course (course name, course number, credit); Relationship: Course selection. Let's start by drawing object 1, adding a rectangular box and three oval boxes, as shown below:

5

I use the same method, let's build the second object course, also put a rectangle, three ovals, and connect them with lines.

6

Then we will build the relationship between these two objects, like the figure to add a diamond, in the diamond to write the two words choose courses. If you don't have a diamond, add a square and rotate it.

7

So that's a simple ER diagram of a student choosing a course, but it's just a simple diagram. More professional can also do so, open "" -->" Software and database "-->" Database model diagram ", create a database model diagram

8

Then drag in an entity, select the dragged entity, and define the entity information and columns in the following properties, as shown in the following figure:

9

Define the course entities in the same way, then create a relational table, drag in the relational segments, and connect the two entities, noting that the red at both ends is really connected. A connection is automatically established in the relationship property, as shown in the following figure:

10

So far, the relationship ER diagram is finished, and this diagram ER diagram is a more formal one, which is much more formal than the one drawn above. Of course, if you want to be more specialized, you can use PowerDesign to draw ER diagrams.

Recommendation