"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > ER Diagrams in MYSQL workbench

ER Diagrams in MYSQL workbench

Published on 2024-11-08
Browse:733

Introduction

Entity Relationship(ER) diagrams are visual representation of the database structure that shows relationship between entities. An entity is a real world object for example student, employee and an entity has attributes. An attribute is characteristic of an entity for example a student can have an ID, name, age.

Creating ER Diagrams in MySQL Workbench

Ensure you have a database with more than one table in MYSQL workbench. In this article, I will be using Sakila database available on MYSQL website.

  1. Open MYSQL workbench and login to local host
  2. In a new Query Tab run the following command to use sakila database

USE sakila;


  1. On the main menu bar Click on Databases

ER Diagrams in MYSQL workbench

  1. click on reverse engineering or use (ctrl R) shortcut command

ER Diagrams in MYSQL workbench

  1. A new window will appear → click on next

ER Diagrams in MYSQL workbench

  1. Enter password to the local host → click on next

ER Diagrams in MYSQL workbench

  1. Choose database to generate an ER diagram which is Sakila for our case → click next

ER Diagrams in MYSQL workbench

  1. click next again

ER Diagrams in MYSQL workbench

  1. Ensure all tables are selected by clicking on show filters button → click execute

ER Diagrams in MYSQL workbench

  1. click next on windows that will appear

ER Diagrams in MYSQL workbench

  1. click Finish and an ER diagram to sakila database will appear

ER Diagrams in MYSQL workbench

Conclusion

An ER diagram is an essential part of the database design process that reduces redundancy, ensures data integrity, aids in communication and simplifies database management. Designing a clear ER diagram at the start of a project helps prevent errors and ensures that the database system meets both functional and business requirements efficiently.

Release Statement This article is reproduced at: https://dev.to/allan-pg/er-diagrams-in-mysql-workbench-2cp3?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3