Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท Relations and Formulas

Relations Between Databases

Learn how Notion relation properties connect databases such as Tasks and Projects, with one-way and two-way relations, limits and a design checklist.

One database rarely tells the whole story. Tasks belong to projects, projects belong to clients, meetings involve people. A relation is a property that links rows in one database to rows in another. It is how you model real-world connections in Notion without copying data.

What a relation does

Suppose you have two databases: Projects and Tasks. In Tasks, add a property of type Relation and choose Projects as the target. Now each task can point to one or more projects. In the cell, you pick project pages from a list (and you can search by name).

By default Notion offers Show on Projects, which creates a matching relation property in Projects automatically. That makes a two-way relation: open a project and its Tasks property lists every task that points to it, without anyone filling it in by hand. Switch the option off for a one-way relation, which exists only in Tasks.

Relation basics

Tasks Has a relation property named Project.
Projects Gets a Tasks property if two-way.
Two-way Each side sees the other.

The link is stored on both sides.

1 / 2

Cardinality

Notion relations are many-to-many by nature: any number of rows on each side. You can add a Limit of 1 page on one side, which behaves like "each task belongs to one project". With the limit set, Notion shows a single linked page instead of a list.

Model Setup Example
One to many Limit 1 on the "many" side Task to Project
Many to many No limits Student to Course
One to one Limit 1 on both sides Employee to Badge

Setting up a relation

  1. Open the database that will hold the link (Tasks).
  2. Add a property, choose Relation, and choose the target database (Projects).
  3. Decide whether to Show on Projects; name the reverse property ("Tasks").
  4. Optionally set the limit.
  5. Fill in a few cells and open both sides to see the link.

If the target database is not found, check that it is accessible to you; relation pickers only list databases you can reach.

Why relations beat select properties

Say each task needs a client. You could add a Select property with the client names. That works until you want a client's email, or a list of all that client's tasks, or the number of open tasks per client: a Select option is just a label. A relation points to a page in a Clients database, so you can store that client's details once and reuse them. When you rename the client, every task follows.

Rule of thumb: if the thing has its own details or you want to roll up data from it, make it a database and relate to it. If it is only a label, use Select.

Modelling relations in code

This stand-in stores two collections and links by id, then derives the reverse side. It shows how a two-way relation can be computed from one stored link; Notion keeps both sides in sync for you.

JS Two-way relation from stored links (stand-in)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

JS Limit to one page (stand-in)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Design checklist

  1. Name the pair clearly ("Project" on the task side, "Tasks" on the project side).
  2. Decide one-way or two-way based on whether people will look from both sides.
  3. Use a limit of 1 for "belongs to" relations.
  4. Remember that deleting a linked page removes it from the relation, but does not delete the page on the other side.
  5. Keep the graph simple. Many databases with relations everywhere become hard to maintain; sketch the model first.

The next lesson, Rollups, shows how to calculate values from related rows, such as "percentage of tasks done" on a project.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. What does "Show on Projects" do when creating a relation from Tasks?

    It adds a reverse property, so you can see the link from both databases.
  2. 2. How do you model "each task belongs to exactly one project"?

    A relation limited to one page behaves as a one-to-many link.
  3. 3. Why choose a relation over a Select for clients?

    Relations link to full pages that can have their own properties and be rolled up.

Summary

  • A relation links rows of one database to rows of another.
  • Two-way relations show the connection on both sides; limits express one-to-many.
  • Use relations when the linked thing has details of its own.
  • Rollups, covered next, calculate values across relations.

Next: Rollups