Search code examples
database-normalizationentity-relationship

Relation between ER Modelling and Database normalization


How is database normalization related to ER Modelling??

What comes first??

Or should both be implemented at the same time??


Solution

  • I feel modeling should come first in a highly normalized database design.

    Creating the model allows you to think through how the tables will relate to one another and also allows you to envision what tables you'll need to use when writing your join queries.

    Using a tool such as MySQL Workbench or Toad Data Modeler , depending on your target database vendor, can even generate SQL commands to build the tables, constraints, and indexes directly from the model. This is useful because it ensures the tables are created exactly as you designed them.

    Also, when making changes to the model, some tools like those mentioned above will even allow you to "update" your schema by issuing the necessary statements required to do so.

    So in short, for a project with more than one table, I'd always model it first. It also makes it easier for developers to understand how the tables function and relate at a glance rather than having to read through DDL to understand it.

    Modeling can even be fun!

    A model created with MySQL Workbench:

    enter image description here

    Hope this helps!