I absolutely love the SQL syntax diagrams from the SQLite documentation.
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?
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.
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.
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:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With