Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:20:02+00:00 2026-06-05T11:20:02+00:00

I have an existing application that has the following entities in the database Customer

  • 0

I have an existing application that has the following entities in the database

  • Customer
  • InvoiceGroup
  • SalesGroup

A customer can be part of multiple groups. Currently this is mapped in the following way

Customer table
 - cid (Pk)
 - fname
 - surname
 ----
 ---
 - invgrpdid (Fk)
 - salesid (Fk)

Invoicegroup table
 - invgrpid (Pk)
 - name
 - type
 ---
 ----

Salesgroup table
 - salesid (Pk)
 - name
 - desc
 -----
 -----

I now have a requirement to add a new entity campaign. A Customer can be part of multiple campaigns. A campaign is deployed for a customer group which is created by
– selecting individual customers (custom) OR
– selecting an existing invoicegroup (invoice) OR
– selecting an existing salesgroup (sales)

The campaign customer list should be
– reusable, i.e can be used for multiple campaigns
– dynamic, i.e if created from an invoice/sales group, changes across the invoice and sales group
should be reflected to the campaign customer list

I am having difficulty designing for the dynamic requirement. I have come up with the following design, but it has exclusive arcs that is one key refering to multiple foreign keys which is not the recommended approach. I have thought of supertype and subtype, but I am not clear on designing the many-to-many relationships.

campaign
 - campaignid(Pk)
 - name
 - startdate
 - status
 ------

campaignlist
 - listid(Pk)
 - listname
 - listtype - Invoice, Sales, Custom
 - typeid (Fk) - Refers to invoicegroupid or salesgroupid depending on listtype
 -----

customercampaign
  - listid (Fk)
  - customerid (Fk)
  - status
  - dateupdated
  -------------

What would be a better approach to design this considering referential integrity and normalization.
The most frequent query run multiple times daily will be to retrieve all campaign information for a customer. So need to be mindful of multiple tables and joins.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:20:03+00:00Added an answer on June 5, 2026 at 11:20 am

    At a first stab, I would do something like this:

    CampaignList
        - ID (PK)
        - Name
    
    CustomerCampaignList
        - CampaignListID (FK to CampaignList.ID)
        - CustomerID (FK)
          UNIQUE (CampaignListID, CustomerID)
    
    SalesGroupCampaignList
        - CampaignListID (PK,FK to CampaignList.ID)
        - SalesGroupID (FK)
          UNIQUE (CampaignListID, SalesGroupID)
    
    InvoiceGroupCampaignList
        - CampaignListID (PK,FK to CampaignList.ID)
        - InvoiceGroupID (FK)
          UNIQUE (CampaignListID, InvoiceGroupID)
    

    That is, use table inheritance. This is quite a normalised design, which in my opinion is the approach to take when you’re not yet clued up on specific requirements. Optionally, you could make your life easier by denormalising a little and putting a CampaignListTypeID in the CampaignList table. In this case though, it would be difficult to maintain the integrity of the data model without writing logic in a trigger.

    I’m assuming that you won’t ever have to do interesting combination groups e.g., 2 x sales group + invoice group + a set of customers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application with existing data, that has Zero in the date column.
I have an existing application that has some parts of formatted text-blocks (standard formats
We have an existing application that relies heavily on stored procedures and untyped DataSets.
I have an existing application that imports data from a web site api into
I have an existing 32-bit ASP.NET application that used 32-bit unmanaged DLLs. If I
I have a custom HttpModule rewrite engine in an existing web application project that
I have a silverlight application that I am embedding in an existing ASP.NET web
I have inherited an big existing PHP application (website actually) that runs on Apache.
I am working on splitting out an existing, working application that I currently have
I have an existing application that I checked out from SVN. Say it was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.