MySQL database design

 

Note: this page is outdated. Please visit page MySQL Database Design

 

1. New project for MySQL

To create a new project, click the New icon on the main toolbar and select the MySQL project type.

2. Adding tables and columns to the project and diagram

New database tables can be added into projects by clicking Table on the toolbar and then by clicking the main diagram area.

A new graphical object will appear on the diagram.

You can edit MySQL table properties via Right Side panel:

Alternatively, you can double click the graphics or right-click the item and choose Edit.

Edit

Table properties

Database table settings can be specified in the section Details.

MySQL database table

Columns

In section Columns, you can add new table columns. Specify new column name, datatype, and parameter and click Add.
PK indicates the Primary key.
NN represents the Not Null field.

table columns

Column specifics

To access the area where MySQL column specifics can be set, click the arrow left to the column name.

Column specifics

3. Relationships and foreign keys

Relationships can be drawn between two database tables. To create a new relation, click Relation on the toolbar and then click parent and then child table.
When a new relation is created, a foreign key appears in the child table automatically.

Relationships

In the details section of relation, you can specify referential integrity, used key (primary key or alternate key), and cardinality.

4. Code generation

To preview the SQL script for your MySQL database design, click the Script tab on table detail.

To save scripts to files, click the Script icon on the toolbar and then click Save script.

SQL script genearated for MySQL

#

Copyright: 2024 Ideamerit s.r.o. All rights reserved. Legal