Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Generate ER Diagrams in MYSQL workbench
allan-pg
allan-pg

Posted on

     

Generate ER Diagrams in MYSQL workbench

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 onMYSQL website.

  1. Open MYSQL workbench and login to local host
  2. In a new Query Tab run the following command to use sakila database
USEsakila;
Enter fullscreen modeExit fullscreen mode
  1. On the main menu bar Click on Databases

main menu bar

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

reverse engineering

  1. A new window will appear → click on next

new window

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

login window

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

SQL Workbench

  1. click next again

SQL Workbench

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

MYSQL workbench

  1. click next on windows that will appear

MYSQL workbench

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

ER Diagram

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.

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
amolo_awuor profile image
Fiona Amolo Awuor
New to the tech world and ready to learn

Niiice. I'm learning day by day. Kudos Allan

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Tech enthusiastic
  • Education
    BSC Mathematics and Computer Science
  • Work
    Data Analyst
  • Joined

More fromallan-pg

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp