Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

Overview

On this lesson, we are going to review one of the features related to database that visualize two important informationtopics: The major entities within the system scope, and the inter-relationships relationship among these entities.

When to draw ER Diagrams?

So, when do we draw ERDs? While ER models are mostly developed for designing relational databases in terms of concept visualization and in terms of physical database design, there are still other situations when ER diagrams can help. Here are some typical use cases.

...

Entity Relationship Diagram (ERD) is a type of structural diagram that we can use in database design.

There are some situations where these diagrams are useful:

  • Database design: Depending on the scale of change, it can be risky to alter a database structure directly in a DBMS. To avoid ruining the data in a production database, it . It is important to plan out the changes carefully. ERD is a tool that helps. By drawing ER diagrams to visualize database design ideas, you have a chance to identify the mistakes and design flaws, and to make corrections before executing the changes in the database.

  • Database debugging - : To debug database issues can be challenging, especially when the database contains many tables, which require writing complex SQL in getting the information you needneeded. By visualizing a database schema with an ERD, you have a full picture of the entire database schema. You can easily locate entities, view their attributes and identify the relationships they have with others. All these allow you to analyze an existing database and to reveal database problems easier.

  • Database creation and patching - Visual Paradigm, an ERD tool, supports a database generation tool that can automate the database creation and patching process by means of ER diagrams. So, with this ER Diagram tool, your ER design is no longer just a static diagram but a mirror that reflects truly the physical database structure.

  • Aid in requirements gathering -

  • Gathering requirements: Determine the requirements of an information system by drawing a conceptual ERD that depicts the high-level business objects of the system. Such an initial model can also be evolved into a physical database model that aids the creation of a relational database, or aids in the creation of process maps and data flow modes.

https://www.visual-paradigm.com/guide/data-modeling/what-is-entity-relationship-diagram/

How to?

...

Let’s check how we can use the ERD in Wayfast!

How to create Entity Relationship Diagrams?

First we need to navigate through the “Database” tab at the top header. Then click on “ERD” section

...

This section will display all the diagrams associated to the project. Let’s click on “New ERD” button to create a new diagram.

Info

NOTE: Keep in mind that we need to establish an active requirement on the project to create a new diagram. Otherwise, we can only view the existing ERDs in read only mode.

...

A new tab is opened on the browser, we need to initially input the name of the new diagram and click on “Ok” button.

...

Automatically the name will be displayed at the header. At this point, we are able to start creating the entities that will represent our tables in database. Let’s right click in any place on the ERD area.

...

A menu is displayed on screen with different options. Let’s click on “New Table” button

...

A popup is displayed to enter the name of the table. Once we click on “Ok” button, the new table will be available in the diagram.

...

On each table created, we can provide all the necessary attributes that are important in our model. If we right-click on the table area, we can create new column properties or delete the ones available. Also we can associate primary and foreign keys.

...

Another possibility to include new table on our model is using the “Add Existing Table” button. This option will populate all our tables in database.

...

In our example, we have “HWD_Roles” available from the “Dataset” lesson in the project.

Info

NOTE: We need to synchronize the model object from database in Wayfast to view all the updated existing tables. Otherwise, those recently created tables won’t be available to make the diagram.

...

All the attributes from the table allocated in the database are populated in the example without creating the new columns. If we create a new column using an existing name, the application won’t be able to save the attribute.

...

Click on “Save” button before continue working on the diagram.

...

Back in the “ERD” dashboard, we can observe the new diagram created and the number of tables matches with the ones created in our example. Click on “3” link

...

Application displays the information for each table with the instance and database connection. We can remove the table if we click on “Delete” icon without opening again the diagram.

...

Also we can remove the entire diagram or view it again to modify any relationship in the model.

Recap

In the first part, we learnt more about the entity relationship diagrams (ERD) and how they are helpful to build our database model. Then we review the ERD tool available in Wayfast to create the entities in the diagram and make the inter-relationships between all of them.