Results 1 to 2 of 2

Thread: Normalization

  1. #1
    Join Date
    Jul 2020
    Posts
    1

    Normalization

    Hello guys:

    I have the following Entities:

    - Customer
    - Provider
    - Service

    1- Each customer may have multiple providers and each provider may serve to multiple customers
    2- Each Provider may supply multiple services and one service may be supplied by multiple providers
    3- Each Customer consumes not all the services from its providers (jut some of them)

    So have created these tables:

    - Customer (customer_id, description) (PK: customer_id)
    - Provider (provider_id, description (PK: Provider_id)
    - Service (service_id, description) (PK: Service_id)

    - Customer_Providers (customer_id, provider_id) (PK: customer_id+provider_id) (FK: customer_id, provider_id)
    - Provider_Services (provider_id, service_id) (PK: provider_id+service_id) (FK: service_id, provider_id)
    - Customer_Provider_Services(customer_id, provider_id, service_id) (PK: customer_id+provider_id+service_id) (FK: customer_id+provider_id, provider_id+service_id)

    Is this the right approach?

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Looks good so far. You can start testing it with sample data to see if it makes sense.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •