Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax diagrams for MySQL

Tags:

I absolutely love the SQL syntax diagrams from the SQLite documentation.

enter image description here

I find this diagram much easier to follow than the equivalent from the MySQL docs

UPDATE [LOW_PRIORITY] [IGNORE] table_reference     SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...     [WHERE where_condition]     [ORDER BY ...]     [LIMIT row_count] 

Does anyone know if diagrams like these exist for MySQL and other dialects?

like image 728
Tamlyn Avatar asked Jun 05 '14 15:06

Tamlyn


People also ask

How do you create a diagram in MySQL?

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.

What is EER diagram in MySQL?

Enhanced Entity-Relationship (EER) diagrams are an essential part of the modeling interface in MySQL Workbench. EER diagrams provide a visual representation of the relationships among the tables in your model. Revisions made with the Model Editor are shown in the associated diagram.


1 Answers

The Bison grammar for MySQL can be processed by a grammar converter to turn it into W3C notation. From that, Railroad Diagram Generator produces syntax diagrams like this:

enter image description here

The grammar still might require some tweaking in order to get what you are looking for, but maybe it provides a starting point.

When using the above tools, please allow some time for processing. The grammar is quite large, while both the converter and the diagram generator have not been optimized for speed, also they are running on a slow server.

The complete result can be found here: sql_yacc.xhtml

like image 117
Gunther Avatar answered Oct 23 '22 03:10

Gunther