Data Modeling with ERWin

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.

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

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 name, and select Number as its data type, and then click OK.

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.

Packt

Share
Published by
Packt

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago