SQL relationship

1

Good evening, I am creating a small system in which I will have a form for Service, where the user will select a Client, and there will be a checkbox for multiple choice for Services.

Can anyone tell me if my line of thinking is correct?

Tables:

* Customer
CustomerID
CustomerName
...

* Service
service id description
valueService

* Customer Service identancy
data collection
totalTotal value idServico - N - services
CustomerID - 1 - Customer

  • Service_Service
    Home | identancy
    service id

Use case:
Registering a service with a customer and 3 services selected via checkbox:

customer service support
1 1 1,2,3

customer service | 1 1.1 1 1 1 1.2 2 1 1.3

    
asked by anonymous 27.05.2016 / 16:15

1 answer

3

You need to have a relational table between service and service, since the relationship between service and service is n-to-n.

Basically, it would look something like this:

    
27.05.2016 / 16:27