Entity Relationship Diagram (ERD)

Select Star's auto-generated ERD (Entity-Relationship Diagram) helps users understand the data model, and learn how tables and views are related to each other as well as which fields are used to join them.

Read more about ERD here: https://www.selectstar.com/blog/automated-data-documentation-entity-relationship-diagram-erd

ERD Calculation

An entity relationship diagram should describe how tables relate to one another. In traditional SQL Databases, you could refer to these relationships by looking at Primary Key and Foreign Key constraints. However, some data warehouses now do not enforce these rules, and while they might allow you to store information about PK/FK relationships, this might not be enforced.

To calculate how tables are related, we use

  • Primary and Foreign Key metadata

  • The JOIN clause in statements executed on your data warehouse.

This will show not only what was defined, but also how data is being used to join different tables.

We have a full blog post on Automated Data Documentation and the Entity-Relationship Diagram, where you can read more about this approach.

Table ERD

Every table or view has an associated ERD. You can open it by going to the Table page > Queries & Joins > ERD.

How this diagram looks will depend on the result of the calculations above.

If a table has no metadata information about Primary and Foreign Keys, and there are no statements in the query history making use of the table. The ERD will appear empty.

This doesn't mean that the table is not related by definition, but that the information to infer that relationship is not present.

Custom ERD

Another way of looking at an ERD diagram is through the Database or Schema view, selecting the tables you are interested in.

  1. Select the tables checking the boxes on the first column

  2. Click on the ERD button in the header.

Tables that are not related, won't show on the ERD Diagram.

Last updated