Visualization of existing MySQL databases

All database connections are available in the Connections section. To create a new connection, click the Connections button on the main toolbar, and then click Create New Connection. A new modal form opens. Select MySQL and enter the connection details.

When you are finished, click the Save Connection button.

mySQL connection

Your new MySQL connection will appear in the list of all database connections.… Read the rest

Generating SQL script for MySQL

To generate SQL script from your project click the Script icon on the main toolbar. The SQL Script modal form opens.

generated SQL script for MySQL

Click Save Script and select a location where the file should be stored.

Generation settings

You can control how the script will be generated on the Generation settings tab

Order of items

The order in which the objects will be in the resulting SQL script can be modified on the Order items tab.… Read the rest

MySQL database modeling

In Moon Modeler you can easily draw MySQL structures.

Database tables

Database tables are displayed as graphical boxes with all column fields.

JSON

One of the main advantages of Moon Modeler is the possibility to visually display nested structures.
The structures are displayed inside tables and also as separate graphical objects.… Read the rest

MySQL database design

Quick-start guide for MySQL DB database design

  1. New project
  2. Tables and columns
  3. Relationships and foreign keys
  4. Code generation
  5. Report creation
  6. Reverse engineering & visualization of existing databases

1. New project for MySQL

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

Primary key - ID

Primary key vs unique key

What is the difference between primary and unique keys?

What primary keys are and what they are used for is explained in the article describing the difference between primary and foreign keys.

A short summary: Primary keys serve as the identifier of a unique record, it can be unique information, such as a driver’s license number, telephone number including area code, car VIN number, etc.Read the rest

Primary key - driving license

Primary key vs foreign key

What is the difference between primary and foreign keys in relational databases?

Primary keys serve as the identifier of a unique record in a database table. It can be unique information, such as a driver’s license number, telephone number including area code, car VIN number, etc.

 

Primary key - driving license
CREATE TABLE `ecommerce`.`customer` ( 
   `driving_license` VARCHAR(100),
   `name` VARCHAR(150) NOT NULL,
   `surname` VARCHAR(150) NOT NULL,
   `email` VARCHAR(150),
   `phone` VARCHAR(200),
    PRIMARY KEY `Primary key`(
   `driving_license`
    )
)
 ENGINE = InnoDB;

Multi-column primary keys

A primary key can contain one or more columns.Read the rest