Relations
Learn how to set up and manage relationships between tables in the ERD.
Create Relation
Create a relation line representing the relationship between two tables.
Activate Relation Mode
Click the relation line icon in the toolbar to activate relation drawing mode.
Select Source Table
Click a column in the table that will hold the FK (child table).
Connect to Target Table
Click the PK column of the referenced table (parent table) to create the relation line.

Identifying vs Non-Identifying Relationship
The toolbar provides two relation line modes. Choose the appropriate mode based on the nature of the relationship.
| Category | Identifying | Non-Identifying |
|---|---|---|
| Toolbar icon | ||
| FK column position | Included in child table's PK | Regular column in child table |
| Child record existence | Cannot exist without parent | Can exist without parent |
| ERD notation | Solid line (FK is part of PK, so always NOT NULL) | Solid line if FK is NOT NULL, dashed line if NULL allowed |
| Example | Order <-> Order Details, Post <-> Attachments | User <-> Orders, Department <-> Employees |
The parent table's PK is included as part of the child table's PK. The child record is dependent on the parent and cannot exist without it.
Example: The order_details table's PK is (order_id, detail_id), where order_id is an FK referencing the orders table's PK.
The parent table's PK is added as a regular column in the child table. The child record can exist independently of the parent.
Example: The employees table has a department_code column as an FK referencing the departments table's PK, but the employees table's PK is employee_id.

Relation Types (Cardinality)
Relation types supported in NeoSQL. The type is automatically determined based on the FK column's properties when a relation is created.
| Type | Notation | Description | Criteria |
|---|---|---|---|
| 1:N | One-to-Many (mandatory) | One parent record maps to multiple child records (FK NOT NULL) | FK column is NOT NULL |
| 1:0orN | One-to-Many (optional) | One parent record maps to zero or more child records (FK NULL allowed) | FK column is NULL allowed |
| N:N | Many-to-Many | Both tables map to multiple records on the other side (junction table required) | FK column is part of a composite PK, and all PK columns are FKs |
When creating a relation, the relation type is automatically determined based on the FK column's nullable and PK inclusion status.
- FK column is NOT NULL -> 1:N (mandatory, solid line)
- FK column is NULL allowed -> 1:0orN (optional, dashed line)
- All PK columns are FKs -> N:N (junction table, many-to-many)

