As a data analysis student, you may know what an Entity Relationship Diagram is and how it helps you quickly get familiar with a database schema and its main properties like tables, table relationships as well as table columns (and their respective data types)
But because you've always been practising and answering the SQL questions using an online interactive SQL instance, you have only been able to view an ERD because it has always been provided to you as an image. This means you've never had to generate a physical entity relationship diagram in a Database Management System like MySQL.
Yet, in the real workplace setting, or when you start answering SQL questions using a DBMS, you need to know how you can view or access the ERD of the database schema you intend to query from.
Below are steps you can follow to view the ERD (Entity-Relationship Diagram) of your database schema in MySQL Workbench:
Open MySQL Workbench and open your database connection.
In the top navigation bar, click on “Database” to expand the list of options.
In the “Reverse Engineer” dialogue box, click “Next” to set parameters for connecting to the Database Management System(DBMS).
Enter your password so that MySQL can connect to your DBMS and then click ‘’next’’.
Select the database schema for which you want to generate an ERD. And then click ‘’Next’’ again.
Enter your password again so that MySQL can retrieve and reverse engineer the schema objects for the schema you chose.
Click “Execute” to start the reverse engineering process. This may take a few moments depending on the size of your database.
Click ‘’finish’’ to see the ERD of your database schema displayed in the main window of MySQL Workbench.
In the ERD tab, your ERD may look like this by default :
The default ERD above may require scrolling back and forth to make sense of its contents. But you can avoid this by customising the ERD layout by dragging the tables and resizing them so that you can see all of them at a glance without the need to scroll down.
And that’s a wrap!
Top comments (1)
For reverse engineering i think you can use alternative of this old desktop application. I use Online Database Design for reverse design of my existing database.