Joining refers to combining rows from two or more database tables.
Imagine a simple database with just 2 tables:
A Customers table
An Orders table
In the Customers table, each row is a customer and contains an ID (e.g. 1, 2, 3, 4 etc).
This ID is known as a primary key.
In the Orders 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 these matching IDs, we can easily see each customer's orders.
Fortunately, you don't have to do this manually 😃.
Joining data in Trevor 🤾
1️⃣ Use the drill-down buttons.
This is a really fast way of seeing the data connected to a specific row.
2️⃣ Click the Join button
Trevor will suggest tables you can connect to.
Choose one, and click done.
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 the 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.