Drawing entity relationship diagram

ERD, short for entity relationship diagram, is a kind of diagram for presenting the properties as well as the relationships between data or participants. Database designer use of ERD to model physical structure of a relationship database, while business analyst uses ERD to model the data that is logically required or produced by processes.

Creating entity relationship diagram

Right click on Entity Relationship Diagram from Diagram Navigator and select New Entity Relationship Diagram from the pop-up menu.

Create entity relationship diagram
Create entity relationship diagram

Enter the name for the diagram. At the same time, a Data Model selection box appears on the top right corner of the diagram.

Select data model
Select data model


All model elements created on diagram will follow this Data Model setting. Only Physical Model will be able to generate SQL. Leave it as default (Physical Model).

Drawing entity

Click Entity from diagram toolbar and drag it on the diagram pane.

Create entity
Create entity

Click on diagram and specify the entity name.

Rename entity
Rename an entity

 

Right click on the entity and select New Column from the pop-up menu, or press Alt+Shift+C.

Create column
Create column

The column can be set with primary key by right clicking the column and selecting Include in primary key from the pop-up menu.

Set as primary key
Set as primary key

Drawing relationships

Point on the entity and either click or drag its resource icon to create another entity.

Create relationship
Create relationship

As a result, a new entity is created with foreign key column(s), referencing the original entity's primary key column(s).

Rename relationship
Rename relationship

Drawing many-to-many relationship

Click or drag Many-to-Many relationship resource icon of an entity.

Create many-to-many relationship
Create many-to-many relationship

Many-to-Many relationship will auto convert to two One-to-Many relationships and a join table. The primary key both tables will be used to create foreign key columns in join table as composite primary key.

Created join table with one-to-many relationships
Created join table with one-to-many relationships

Defining default schema

A default schema can be set on diagram, to make entities to be created on the diagram share the same schema. To define a default schema on diagram:

Right click on the diagram background and select Open Specification... from the pop-up menu.

Select Open Specification... from the pop-up menu
Select Open Specification... from the pop-up menu

Specify the default schema in the Entity Relationship Diagram Specification dialog box. Click OK to confirm the change.

Specify default schema
Specify default schema

Now, when you create an entity on the diagram, the entity will be under the default schema.

An entity with myschema as its schema
An entity with myschema as its schema

 

NOTE: In order to move entities in a diagram to a schema, define default schema on the owning entity relationship diagram, right click on the diagram and select Apply Default Schema from the pop-up menu. This will make all entities that have master view on the erd to share the schema defined.

Creating partial table

Sometimes, you want to separate an entity into two, and create a one-to-one relationship in between. For example, to extract information on a Student entity into another entity StudentInfo. You can split a table by creating a partial table through the resource centric-interface.

  1. To split a table, move the mouse pointer over the entity you want to split and drag out the One-to-One Relationship -> Partial Table.
    To create a partial table
    To create a partial table
  2. Release the mouse button to create the split entity.
  3. In the Split Table dialog box, select the columns you want to move to the split table and click >.
    Move columns to partial table
    Move columns to partial table
  4. Click OK. A split table is created.
    Split table is created
    Split table is created
 
Chapter 1. Database Modeling Table of Contents 2. Drawing sequence
 

Product

Try this feature with

Visual Paradigm for UML

Technical Support

Have technical issues or suggestions? Please contact Visual Paradigm Support Team.

Sales Support

Have questions related to registration, licensing or payment? Feel free to contact Visual Paradigm Sales Team.

Discussion Forum

Share your suggestions of opinions at VP Discussion Forum.