0
Good evening, I am creating a small system in which I will have a form for Service, where the user will select a Customer, and there will be a checkbox for multiple choice for Services.
Can anyone tell me if my line of thought is correct?
Tables:
*Client
idClient
nominee
...
*Service
idServico
description
service
*Attending
idAtendimento
dating
valorTotal
idServico - N - services
idCliente - 1 - client
- Service_service
idAtendimento_Servico
idAtendimento
idServico
Use case:
Registering a customer service and 3 selected services via checkbox:
customer service
1 1 1,2,3
Customer service_service service service
1 1,1 1
1 1,2 2
1 1,3 3
And the table 'service'?
– João Paulo Siqueira
There are those who want to create an ID, there are those who don’t. You may want to create a composite key that is the junction of the
atendimento_id
and ofservico_id
, so there will never be duplicates.– Rodrigo Rigotti