SQLite database design

 

Note: this page is outdated. Please read the latest article SQLite database design

 

1. New project

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

2. Database tables and columns

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

Toolbar

A new graphical object is shown in the diagram.

You can edit SQLite table properties via the Right Side panel:

Table details - columns

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.

Database table properties

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.

Column specifics

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

Column properties

3. Relationships and foreign keys

Relationships can be drawn between two database tables. To create a new relation, click Relationship 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.

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

Relationships in ERD

4. Code generation

To preview the SQL script for your MariaDB 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 for SQLite

This is the end of the SQLite database design page.

#

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