Reputation: 13
I'm working with a companies CRM database which contains clients that the company works with. Employees can create new client entries through the CRM and when someone creates a new entry and checks multiple services that the client provides, the service codes are all stored in 1 field. Example below:
clientid CompanyName Email Tel Services
1 Randomname1 XXX@... 33333 ;14;294;448
2 Randomname2 yyy@... 44444 ;448
3 Randomname3 zzz@... 55555 ;58;448;14;65;24
So my questions is, what is the best way of storing the services column values? There are around 60 different services that you can choose from.
Upvotes: 0
Views: 482
Reputation: 7986
The classic approach is:
Clients Table:
clientid CompanyName Email Tel
1 Randomname1 XXX@... 33333
2 Randomname2 yyy@... 44444
3 Randomname3 zzz@... 55555
Client_Services Table:
client_id service_id
1 14
1 294
1 448
2 448
3 58
3 448
3 14
3 65
3 24
Upvotes: 4