0

I am following a SQL tutorial, it states

Database administrators often use relationship diagrams to help demonstrate how database tables are connected. enter image description here

However,I tried every corner of mysql workbench but failed to find such a well-organized diagram.

How could I see the database structure as the diagram shows?

Shadow
  • 33,525
  • 10
  • 51
  • 64
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
  • 1
    you can use mysql workbench to draw the diagram https://dev.mysql.com/doc/workbench/en/wb-creating-eer-diagram.html – unixmiah Aug 12 '18 at 09:45
  • 1
    At least in older versions the mysql-workbench offered to "reverse engineer" an existing database. That did work a bit, spit out such a diagram, but nothing you could really use in a non-trivial scenario. The issue is that you need to have intelligence to understand a database. So typically it makes more sense to draw a diagram yourself. Actually it should be part of the documentation the developers write. – arkascha Aug 12 '18 at 09:47
  • 1
    Is it helpful? you can refer to https://stackoverflow.com/questions/20855065/how-to-find-all-the-relations-between-all-mysql-tables – pwxcoo Aug 12 '18 at 09:49
  • ty, I am upgrading mysql workbench, using 5.7 now @pwxcoo – AbstProcDo Aug 12 '18 at 09:53
  • I found "reverse engineer" in version 6.3 @arkascha thank you. – AbstProcDo Aug 12 '18 at 10:02
  • Possible duplicate of [Auto Generate Database Diagram MySQL](https://stackoverflow.com/questions/2488/auto-generate-database-diagram-mysql) – Michał Turczyn Aug 12 '18 at 10:23
  • You may need to install additional software. You can try SchemaCrawler or SchemaSpy. – Sualeh Fatehi Aug 13 '18 at 03:49

2 Answers2

0

Looks like you didn't find the modeling part of MySQL Workbench yet. Walk through the tutorials to reverse engineer a schema and create an EER model from it.

enter image description here

You can customize colors and figure sizes + positions, organize a diagram with layers for better overview and change the notation (crow food etc.). Search for modeling with MySQL Workbench for more tips.

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
-2

I learned long time ago database structure. But as I see on your picture, the diagram shows columns of tables and the relations between them. 1:N - means from the other table allowed to reference more than 1 records 1:1 - means from the other table allowed to reference only one record. Example: relation between customers and orders. The orders can have many customers_id and same customers as well. Because one customer can send more order. You can find customer_id in order table too.

Peter
  • 57
  • 4