A
A
asdasdqwe2021-11-24 17:23:09
Database
asdasdqwe, 2021-11-24 17:23:09

What is the meaning of a one-to-one relationship?

users
table phones table

We create a foreign key - user_id in the phones table And make it unique

As a result, one user has one phone, also one phone belongs to one user

What's the point? Why not just create a phone column in the users table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-11-24
@asdasdqwe

If there is no separate entity "phone" with its own parameters (there is only a number), then it makes no sense to do so.
If there is (for example, an IP phone with all the settings), then this is simply a consolidation of the fact that one specific unique user is assigned to each phone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question