# One-to-One

How a one-to-one relationship uses the child table's primary key as its foreign key, and why you would move rarely used data into its own table.

Apprentice · SQL · Database · Updated October 29, 2026

The **One-to-One** relationship is the least common type of relationship in a database. A **One-to-One** relationship is used when you want to ensure that the parent table can only refer to a single row in a child table.

This can be accomplished by using the Primary Key of the child table as both the Primary Key as well as the Foreign Key. This ensures that the Foreign Key can only appear once in the child table.

We may want to store data that only applies to some of our customers. If we added those columns directly to the `customer` table, there would be many rows with null values. By putting the *rare* data in its own table, we could minimize the wasted space.

For example, a customer may apply for a store credit card. The `Customer` table is the parent table and the `customer_credit` table is the child.

![A Customer can only have one credit record](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/029333f32d1f4591947c3bfcd0fba584.png "A Customer can only have one credit record")

## Key terms

- [One-to-One Relationship](https://www.ask-codey.com/glossary/one-to-one-relationship)

Source: https://www.ask-codey.com/lessons/database-relationships-one-to-one
