Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Relationships Between Tables
Tables in PhixFlow are relational, which means that information in one table can be related to information in another table. Data can then be accessed in many different views without requiring duplication. A line connects the Primary Key or Secondary Key of one table to a Foreign Key in a different table and represents a Relationship. The relationships supported in PhixFlow are:
1 Table of Contents maxLevel 2
|
One-to-Many and Many-to-One Relationships
The relationship line between a Primary Key or Secondary Key and Foreign Key represents a one-to-many relationship. In the below example, one teacher runs many courses.
A many-to-one relationship is implied when you read a relationship in the opposite direction. In the below example, many courses are run by one teacher.
Many-to-Many Relationships
Many-to-many relationship can be supported with an intermediate table.
A many-to-many relationship is created when there is an intermediate table with a Foreign Key from each of the related tables. In the example used below, many students take many courses, and so a many-to-many relationship is created using the intermediate table, Schools_Course_Attendees.
Multi-Hop Relationships
Multi-hop relationships are relationships between tables without a direct relationship. PhixFlow supports multi-hop relationships to a distance of 4 hops. In the example ERD below, the relationship distance between the Buildings and Bookings table is 2 hops, and between the Buildings and Departments table is 4 hops.
Creating Multi-Hop Views and SubViews
When a View is created on a table,
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Expand | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||
|
SubViews can be seen in Attribute Source section on the View
SubViews
and represent one table linked to another
As. If more attributes are added to the main View
, ifand there's already
a SubView they can be added intoan appropriate SubView, they will be added automatically to the SubView, otherwise another SubView will be created.
Attributes can also be added from the Available Attributes window directly onto the Attribute Source section.
Modifying SubViews
- Access the
properties from the View properties → Attribute Source section → double-click on a SubView nameInsert excerpt _subview _subview nopanel true - SubViews can be copied by right-clicking on the SubView in the Attribute Source section and choosing
Insert excerpt _duplicate_subview _duplicate_subview nopanel true - Duplicating a SubView does not copy the attributes, just the source and target tables are copied
If required, a Default Filter can be applied to the SubView and will apply to all attributes on the SubView
If required, filters specific to an individual attribute can be applied.
Filters for specific attributes can also be applied but the attribute must be aggregate. This is set by double-clicking the attribute
name Aggregation can also be added to attributes this wayname in the View Attributes section of the View to choose an Aggregate Function, then apply a Filter.
Further Reading
- For a multi-hop worked example, see Multi-Hop Worked Example