Many-to-many relations in Notion allow you to connect multiple records in one database to multiple records in another database. For example, a student can enroll in several courses, and each course can have many students. Without this setup, you would need duplicate data or manual tracking. This article explains what a many-to-many relation is and provides a step-by-step method to build it using a junction database.
Key Takeaways: Building a Many-to-Many Relation in Notion
- Junction database with two Relation columns: Links to each source database and stores the connection between records.
- Rollup property in the source databases: Aggregates data from the junction to display all related records from the other side.
- Linked database views: Show the junction table filtered by the current record to see connections in context.
What Is a Many-to-Many Relation and Why You Need a Junction Database
A many-to-many relation occurs when each record in Database A can relate to multiple records in Database B, and vice versa. Notion’s Relation property alone cannot handle this directly because a single Relation column can only link one record to one or many records in another database, but it cannot represent the reverse connection without extra steps. The solution is a junction database — a third database that stores pairs of record IDs from both source databases. Each row in the junction represents one connection. This approach is common in database design and is fully supported by Notion’s Relation and Rollup properties.
Before you start, create two databases that you want to connect. For this guide, we use a Students database and a Courses database. Each database should have at least a Title column. You also need to create a third empty database that will serve as the junction table. Name it Enrollment or something similar.
Steps to Create a Many-to-Many Relation Using a Junction Table
- Create a new database for the junction table
In your Notion workspace, click the + icon in the sidebar and select Table. Name it Enrollment. This database will hold the connections between Students and Courses. - Add a Relation column to link to the Students database
Click the + icon in the last column header of the Enrollment table. Select Relation. In the pop-up, choose the Students database from the list. Click Create Relation. Name the column Student. This column will store one student per row. - Add a second Relation column to link to the Courses database
Repeat the process: add another Relation column, select the Courses database, and name it Course. Now each row in Enrollment can link one student to one course. To create a many-to-many relation, you add multiple rows: for example, Student A linked to Course X, Student A linked to Course Y, Student B linked to Course X, and so on. - Populate the junction table with connections
Open the Enrollment database. In the Student column, click inside a cell and start typing a student name from the Students database. Select the correct record. Do the same in the Course column. Repeat this for every student-course pair you need. Each pair must be a separate row. - Add a Rollup property to the Students database to see all courses
Go to the Students database. Add a new column of type Rollup. In the Rollup configuration, set the Relation to the Enrollment database (Notion automatically creates a reverse relation when you added the Student column). For the Property, choose the Course column from Enrollment. For the Calculate option, select Show Original (or a specific aggregation like Count or Join). This will display all courses linked to that student via the junction table. - Add a Rollup property to the Courses database to see all students
Repeat the same process in the Courses database. Add a Rollup column that references the Enrollment database and the Student column. This shows all students enrolled in each course. - Create a linked view of the junction table inside each source database
To see connections in context, go to the Students database. Click the + Add a View button, select Linked database, and choose the Enrollment database. Apply a filter: Student contains the current record. Name the view Enrolled Courses. Repeat this for the Courses database to show enrolled students.
Common Mistakes and Limitations When Using Junction Tables
Duplicate rows in the junction table
If you accidentally create two rows with the same student and course pair, the Rollup will show duplicates. To fix this, use the Find duplicates feature or manually review the table. Notion does not enforce uniqueness, so you must manage it yourself.
Rollup not showing any data
This happens when the Rollup property is configured with the wrong Relation. Ensure that the Rollup references the junction table, not the other source database. Also check that the junction table actually contains rows linking the two databases.
Performance issues with large datasets
A junction table with thousands of rows can slow down page load times. To mitigate this, use filtered views and avoid loading the entire junction table in a page. Consider archiving old connections in a separate database if you do not need them often.
Editing connections is not intuitive
To remove a connection, you must delete the corresponding row in the junction table. You cannot simply uncheck a relation in the source database. Train your team to manage connections directly in the junction table or create a simple form view for adding and removing rows.
| Item | Direct Relation (One-to-Many) | Many-to-Many via Junction Table |
|---|---|---|
| Number of databases needed | 2 | 3 (including junction) |
| Reverse relationship | Automatic (Notion creates reverse relation) | Requires manual Rollup property |
| Duplicate prevention | Not needed (one-to-many) | Manual — Notion does not enforce uniqueness |
| Editing connections | Directly in the Relation column | Must edit or delete rows in junction table |
| Best for | Simple parent-child relationships like Projects and Tasks | Complex relationships like Students and Courses or Orders and Products |
A many-to-many relation in Notion requires a junction database with two Relation columns, one for each source database. Populate the junction with individual connection rows. Use Rollup properties in the source databases to display the aggregated list of related records. This pattern gives you full flexibility to model real-world relationships like enrollment, tagging, or membership without duplicating data. For advanced use, explore Notion formulas to count connections or filter by date ranges.