Data Modeling with ERWin

0
157
2 min read

Depending on your data modeling need and what you already have, there are two other ways to create a data model: Derive from an existing model and Reverse Engineer an existing database.

Let’s start with creating a new model by clicking the Create model button.

Data Modeling with ERWin

We’d like to create both logical and physical models, so select Logical/Physical.

Data Modeling with ERWin

You can see in the Model Explorer that our new model gets Model_1 name, ERWin’s default name.

Data Modeling with ERWin

Let’s rename our model to Packt Model.

Data Modeling with ERWin

Data Modeling with ERWin

Confirm by looking at the Model Explorer that our model is renamed correctly.

Data Modeling with ERWin

Next, we need to choose the ER notation. ERWin offers two notations: IDEF1X and IE. We’ll use IE for our logical and physical models.

Data Modeling with ERWin

Data Modeling with ERWin

It’s a good practice during model development to save our work from time to time.

Data Modeling with ERWin

Data Modeling with ERWin

Our model is still empty, so let’s next create a logical model in it.

Logical Model

Logical model in ERWin is basically ER model. An ER model consists of entities and their attributes, and their relationships. Let’s start by creating our first entity: CUSTOMER and its attributes.

To add an entity, load (click) the Entity button on the toolbar, and drop it on the diagramming canvas by clicking your mouse on the canvas.

Data Modeling with ERWin

Data Modeling with ERWin

Rename the entity’s default E/1 name to CUSTOMER by clicking on the name (E/1) and typing its new name over it.

Data Modeling with ERWin

To add an attribute to an entity, right-click the entity and select Attributes.

Data Modeling with ERWin

Click the New button.

Data Modeling with ERWin

Type in our first attribute name (CUSTOMER_NO) over its name, and select Number as its data type, and then click OK.

Data Modeling with ERWin

Data Modeling with ERWin

We want this attribute as the entity’s primary key, so check the Primary Key box.

Data Modeling with ERWin

In the same way, add an attribute: CUSTOMER_NAME with a String data type. Our CUSTOMER entity now has two attributes as seen in its ER diagram. Notice that the CUSTOMER_NO attribute is at the key area, the upper part of the entity box; while the CUSTOMER_NAME is in the common attribute area, the bottom part.

Data Modeling with ERWin

Similarly, add the rest of the entities and their attributes in our model. When you’re done, we’ll have six entities in our ER diagram. Our entities are not related yet.

To rearrange the entities in the diagram, you can move around the entities by clicking and dragging them.

Data Modeling with ERWin

LEAVE A REPLY

Please enter your comment!
Please enter your name here