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.
We’d like to create both logical and physical models, so select Logical/Physical.
You can see in the Model Explorer that our new model gets Model_1 name, ERWin’s default name.
Let’s rename our model to Packt Model.
Confirm by looking at the Model Explorer that our model is renamed correctly.
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.
It’s a good practice during model development to save our work from time to time.
Our model is still empty, so let’s next create a logical model in it.
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.
Rename the entity’s default E/1 name to CUSTOMER by clicking on the name (E/1) and typing its new name over it.
To add an attribute to an entity, right-click the entity and select Attributes.
Click the New button.
Type in our first attribute name (CUSTOMER_NO) over its
We want this attribute as the entity’s primary key, so check the Primary Key box.
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.
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.