Create Relation
Creating relationships between tables in a database facilitates efficient organization and manipulation of data. By linking tables, you can ensure data integrity, reduce redundancy, and simplify data querying.
To create a 1:1 or 1:N relationship, click the "Add Relation" icon and follow these steps:
- Select the Parent table and column.
- Choose the relationship type.
- Select the Child table and column.
- If the relationship is invalid, an error message will be displayed.
- If the relationship is valid, click the "OK" button to confirm.
Note
The M:N relationship will be automatically detected by the system and will be displayed on the right-hand side of the screen.
Once the relationship is created, it will appear in the Model section of the View Models.
1:1 Relationship
When you select a column from the parent side (1) of the 1:N relationship table in the model, it generates an SQL JOIN operation between the two tables.
1:N Relationship
When you select a column from the child side (N) of the 1:N relationship table in the model, it generates a new SQL query to accommodate the relationship.
M:N Relationship
An M:N (many-to-many) relationship is established between two tables, where a record in each table can reference multiple records in the other table. An example of this relationship is the UserRole association.
The model will display the M:N relationship if it exists. In the Create or Edit view, the M:N relationship will be represented as checkboxes.






