sqldatabasephpmyadminddlmagic-draw

SQL CHECK statement error: A comma or a closing bracket was expected. (near "CHECK" )


I have made relational database model using MagicDraw tool. Every cashier has their workTime type saved in enumerator:

enter image description here enter image description here

Then I generate DDL code and try to paste it into phpMyAdmin to generate DB but I get many errors. I tried to fix them by hand but errors are still here. So how should that check statement be written?

SQL CHECK statement

Errors: Errors


Solution

  • I think I have found a solution.

    A book that I was following to create DDL from MagicDraw project suggested to pick "Check Constraints" as an "Enumeration transformation strategy" when transforming model. It didnt worked that way so I have chosen "Lookup tables" instead and DDL code seems to be working now.

    However it still had some erorrs. I had to add semicolons after all INSERT statements. enter image description here

    And I also had to delete word "precision" after every 'double' type: delete

    It works now.