SQLite database design

Quick start guide for SQLite database design.

  1. New project
  2. Tables and columns
  3. Relationships and foreign keys
  4. Code generation
  5. Report generation
  6. Visualization of existing databases

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.

Add a new table to SQLite ER diagram.

A new graphical object is shown in the diagram.

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

Edit table properties

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

Edit a table

This will open a larger modal form for easier for easier specification of properties.

SQlite ERD - table properties

Table properties

Database table settings can be specified in the section Details.

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 relationship, 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 relation, you can specify referential integrity, used key (primary key or alternate key) and cardinality.

SQLite database design - Relations

4. Code generation

To preview the script for the selected table, click the SQL Script tab.

sqlite script - preview

As you can see in the screenshot above, you can also define your own CUSTOM code and generate it together, or instead of a script that was generated automatically. Also included in this section is a preview of the SELECT statement.

Script generation settings, ordering of items and saving SQL

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

SQL script for SQLite

5. Report generation

If you plan to create documentation for your database design, you can choose between generating a PDF document or creating an interactive HTML report.

report generation for SQLite ERD

If you choose an HTML report, you can also select from several styles.

themes

Here you can see a sample of the generated report, which contains both the entity relationship diagram and other important information.

generated report

6. Visualization of existing databases

If you already have an existing database, you can also visualize your database design using an ER diagram. Simply import the SQLite database file and our tool will create a project with the diagram. More information can be found on the next page.

We wish you pleasant work with the product and easy and fast modeling of SQLite database designs.

#

DATA MODELING TOOLS
DRAW Diagrams and
GENERATE Scripts
Download data modeling tools
Blog Categories
Blog by Platforms