> For the complete documentation index, see [llms.txt](https://help.adalo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.adalo.com/database/relationships/one-to-many-vs.-many-to-one.md).

# One-to-Many vs. Many-to-One

## Learn About One-to-Many vs. Many-to-One Relationships

{% embed url="<https://youtu.be/fGvEHvibIoY>" %}

### **One-to-Many Relationship**

A one-to-many relationship exists when one record in the parent collection can be connected to multiple records in the child collection, but each child record can only connect to one parent.

**Example: Users and Workouts**

* One user can have ***many*** workouts
* Each workout belongs to only ***one*** user

In the Workouts collection, you'd add a Relationship property called "User" that points to a specific user. This is the simplest relationship type to set up and typically doesn't require junction collections.

### **Many-to-One Relationship**

A many-to-one relationship exists when multiple records in one collection can connect to a single record in another collection.

**Example: Orders and Customers**

* ***Many*** orders belong to one customer
* Each order is connected to only ***one*** customer

In the Orders collection, you'd add a Relationship property called "Customer" that points to a specific customer. This is the same relationship structure as the Users and Workouts example, just described from the opposite perspective.

**The key difference in perspective:**

* **One-to-Many (Users → Workouts):** "One user has many workouts" (viewing from the parent)
* **Many-to-One (Orders → Customer):** "Many orders belong to one customer" (viewing from the child)

{% hint style="danger" %}

* **Relationships can not be set or updated from the parent side of record in the Adalo database.**
* **Relationships can not be set upon Create Action of a parent record.**
  {% endhint %}

They're the same relationship type. The distinction comec from which collection you're looking at when you set up the Relationship. In Adalo, you'd set them up identically by adding a single relationship property to the child collection (Workouts or Orders) that points to the parent collection (Users or Customers).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.adalo.com/database/relationships/one-to-many-vs.-many-to-one.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
