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

  • SEARCH
  • Home
  • 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 7676197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:08:41+00:00 2026-05-31T17:08:41+00:00

Currently I have a database with the following relationships: One Client has multiple Entities

  • 0

Currently I have a database with the following relationships:

One Client has multiple Entities (via Client Name – this is unique)

One Entity has multiple EntityServices (via Entity ID)

One Service has multiple EntityServices (via Service Name – basically a table of service lines)

Now this is all working fine, but I want to create a table by the name of EngagementLetters. It should have the following relationships:

One Client has multiple EngagementLetters (via Client Name)

One EngagementLetters has multiple EntityServices (via Engagement Letter ID)

and the tricky one: all EntityServices under a single EngagementLetter must have the same Client

I’ve been able to create the above except for the last point. It’s stumped me, I have no idea how to do it! Would anyone be able to help with this?

Cheers,

Andrew

  • 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-05-31T17:08:43+00:00Added an answer on May 31, 2026 at 5:08 pm
          Client
         ^      ^
         |      |
         |      Entities   Service
         Eletter      ^          ^
            ^         |          |
            |_______ EntityServices
    

    Like this?

    “One Client has multiple EngagementLetters (via Client Name – this is unique)”

    why Client Name? you used Client Id for the relationship with entity. It is fine to make client name unique, but it is not good practice to use a different key for different relationships. Foreign keys should typically point to the primary key (which i presume is client id?)

    “and the tricky one: all EntityServices under a single EngagementLetter must have the same Client”

    What do you mean? Is there a relationship between EntityServices and client? there is one via Entities, do you mean the client id derived from the related entities parent row? Is this in some way related to the client linked to by engagement letter?

    If you simply want to enforce the rule as you state it, you should consider creating a new table that links to both client and engagement letter, and link to there from entity services. However this is only a good choice if you can make the case that the client/engagement letter combination is some kind of object – not just an abstract construct to implement this particular business rule.

    If it’s just that, a business rule, then you should use triggers or application logic to enforce it, and reserve foreign keys only for representing relationships between data structures.

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

Sidebar

Related Questions

Currently I have database with the following associations: One Client to Many Intakes One
I currently have an MS Access application that connects to a PostgreSQL database via
With the following simple relational database structure: An Order has one or more OrderItems,
I have a distributed client server system which has multiple 'worker' engines and a
Framework: Rails 2.3.8 Database; PostgreSQL I currently have the following SQL statements (generated by
In my postgres database, I have the following relationships (simplified for the sake of
I currently have a database that gets updated from a legacy application. I'd like
I currently have an existing database and I am using the LINQtoSQL generator tool
I currently have a MySQL database which I was hoping to use to store
I currently have a SQL Server (Express 2005) database to hold some transaction/metadata that

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.