It’s helpful to have a visual representation when designing a database. MySQL Workbench allows you to create entity-relation diagrams (ERD’s) and create relationships between the tables – i.e. one to one, one to many – and rearrange them as needed. Below we cover how to create a diagram from a downloaded SQL file.
Create a Diagram from a SQL file
- Open MySQL Workbench.
- Select File and New Model from the top menu.
- Select File, hover over Import, and press Reverse Engineer MySQL Create Script….
- Specify the SQL file needing a diagram. Press Execute, Next, and then Finish.
- At this point, you can rearrange and connect tables using the options on the left.
- Once done editing, you can export the diagram as PNG, SVG, PDF, or postscript file.
- You can view the image as wanted.