Reader small image

You're reading from  Metabase Up and Running

Product typeBook
Published inSep 2020
Reading LevelBeginner
PublisherPackt
ISBN-139781800202313
Edition1st Edition
Languages
Right arrow
Author (1)
Tim Abraham
Tim Abraham
author image
Tim Abraham

Tim Abraham is originally from Oakland, California, and currently living in the San Francisco Bay Area. He has been working in Data Science for 10 years, spending his time working at consumer technology companies like StumbleUpon, Twitter, and Airbnb and advising a few others. He also spent time as a Data Scientist in Residence at Expa, the Startup Studio that Metabase came out of, which is where he got to know the product and the founding team. Find him on Twitter @timabe.
Read more about Tim Abraham

Right arrow

Specifying foreign key relationships

Recall in Chapter 4, Connecting to Databases, how we learned that the relational part of a relational database comes from how records in one table relate to other records. One of the benefits of this is to save space. To see an example of this, let's have another look at our Reviews table, or simply turn back to Figure 5.5. Notice that aside from the review ID and star rating, all other columns in our Reviews table relate to other tables:

  • The ID Order column relates to ID Order in the Orders table.
  • The ID Menu column relates to ID Menu in the Menu table.
  • The ID User column relates to ID User in the Users table.

Recall that when we first viewed our metadata for the Menu table, we saw that Metabase had determined that ID Menu was an Entity (or Primary) key. The same is true for ID Order in the Orders table and ID User in the Users table – they are all Entity keys. When we see an Entity key in a different table, as...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Metabase Up and Running
Published in: Sep 2020Publisher: PacktISBN-13: 9781800202313

Author (1)

author image
Tim Abraham

Tim Abraham is originally from Oakland, California, and currently living in the San Francisco Bay Area. He has been working in Data Science for 10 years, spending his time working at consumer technology companies like StumbleUpon, Twitter, and Airbnb and advising a few others. He also spent time as a Data Scientist in Residence at Expa, the Startup Studio that Metabase came out of, which is where he got to know the product and the founding team. Find him on Twitter @timabe.
Read more about Tim Abraham