Create Relation

Create Relation

Creating a relationship between tables in a database allows for the efficient organization and manipulation of data. By linking tables together, you can ensure data integrity, reduce data redundancy and simplify data querying.

You can create 1:1 or 1:N Relationship by click on the "Add Relation" icon and then

  1. Select the Parent table and column.
  2. Select the relationship type.
  3. Select the Child table and column.
  4. If the relation is not valid, the error message will show.
  5. If the relation is valid, then click on the "OK" button.

Create Relation

Note

The M:N Relation will automatically detected by system and will show in the right-hand side of the screen.

When the relation was created it will show in a Model of View Models section.

1:1 Relationship

When you select the column in the 1:1 relationship table of the Model. It will cause SQL JOIN operation between the tables.

Relation in View Relation in View

1:M Relationship

When you select the column in the 1:M relationship table of the Model. It will produce the new SQL Query.

Relation in View Relation in View

M:N Relationship

M:N (many-to-many) relationship is a relationship between two tables where a record in each table can reference several records in the other table. The UserRole is the example of this relationship.

Relation in View

The Model will show the M:N relationship if available. The M:N relationship will show as checkboxes in the Create or Edit View.

Relation in View