J
J
JyriG2022-01-31 15:33:42
Database design
JyriG, 2022-01-31 15:33:42

How to attach users to projects?

There is a users table, there is a projects table in sql. It is necessary to make sure that a certain project would be under a certain user. How to do it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
B
BorLaze, 2022-01-31
@BorLaze

users <---> projects
does one user have one project? one-to-one
one user has more than one project? one-to-many
many users per project? many-to-one
each user can have more than one project, and one project can have more than one user? many-to-many

N
Newto, 2022-01-31
@Newto

Add the user_id field to the projects table and write the user id from the users table there.

D
Dmitry, 2022-01-31
@Spargwy

See how references and foreign keys work

K
Konstantin Tsvetkov, 2022-01-31
@tsklab

It is possible so .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question