Relationships in ER diagrams for MariaDB

To create a new relationship between two tables, click Relationship on the toolbar and then click parent and child tables in your diagram.

In this example, click table customer and then table order.

basic model

The new relationship line appears in the diagram and column customer_id is added to the child table order automatically.… Read the rest

Other database objects in MariaDB projects

Diagrams can also contain graphical representatives of various database objects. The following objects can be added to MariaDB diagrams:

  • Views
  • Stored procedures
  • Functions
  • Triggers
  • Other objects (Events, Table check constraints, User/Role definitions)

Each object has its default color that can be changed. Objects can be re-positioned, aligned etc.

Usage:

To add a new object, click Other on the toolbar or right-click the diagram area and choose the desired object type, for example, Function.… Read the rest

Generating SQL script for MariaDB

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

Visualization of existing MariaDB 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 MariaDB and enter the connection details.

connection mariadb

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

MariaDB database modeling

In Moon Modeler you can easily draw MariaDB 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

MariaDB database design

Quick-start guide for MariaDB 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 MariaDB

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

2.

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