Answer the question
In order to leave comments, you need to log in
How to build an entity relationship in the Freelancer -> Customer database?
Prompt, please, how to me it is correct to connect entities in a DB at a trace. conditions:
- There is a user (developer - freelancer) (a separate entity in the database - 'User')
This user, when adding a completed project, can specify the customer's data.
Actually and a question how to store essence of this customer? The user must have a key in the form of an array of customers, or should the entity of all customers be separate and independent and be bound by id to the user who added it to himself?
What's the catch - the customer can be the same for several performers, so adding the same data to each performer is stupid.
Any information and literature will be glad.
Answer the question
In order to leave comments, you need to log in
1) If you cannot unambiguously and automatically identify them when adding them, then there will be duplicates, reconcile.
2) Otherwise, these are classic "many-to-many" for relational DBMS:
Implemented through a separate table for relationships, something like this:
Table Customer
ID OtherData
Table Worker
ID OtherData
Table Relationship
IDCustomer IDWorker
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question