A
A
Artemy Merkulov2020-07-10 08:16:00
Database design
Artemy Merkulov, 2020-07-10 08:16:00

How to properly organize the structure of the user contact table in the database?

Can you please tell me how to organize the structure of a table in a relational database that should contain the user's friends? It seems to me (maybe due to modest experience) to create lines that specify the user id and the id of his friend is not a very good option, because. when adding a friend, you will have to write 2 lines each time (because if one user added the second, then the second added the first). Is it possible to somehow organize the structure of the table/tables to avoid this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Larisa .•º, 2020-07-10
@Artyem

5f07fd30e4ac1118991409.png
statuses:
0, 1, 2 : “Pending”, “Friend request”, “Friend confirmation”

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question