Imagine a simple database with just 2 tables:
- A Customers table
- A Transactions table
In the Customers table, each row represents a customer and contains an ID (e.g. 1, 2, 3, 4 etc) that identifies each unique customer.
This ID is known as a primary key.
In the Transactions table, one of the columns is called Customer ID. It matches the ID from the Customers table and shows us that the rows are connected.
When used in another table like this, a primary key is known as a foreign key.
If we cross reference the tables and check the matching values in the primary and foreign key columns, we can see the transactions associated with each customer.
Joining data in Trevor
There are two ways to find and connect related data in Trevor. In both cases, Trevor will automatically suggest the tables you can join.
(1) Use the drill-down buttons.
This is a really fast way of seeing the data connected to a specific record.
(2) Click the Join button
This enables you to join data to the table(s) you have open, to perform further analysis.
By default, Trevor performs what's called a left join (bringing in only the data in the second table that matches), but you can change this.
Learn more about different types of join here.
Have a question?
We're on standby to help! To chat with us, click the blue Intercom button in the bottom right of Trevor's interface.