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 6543499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:21:15+00:00 2026-05-25T11:21:15+00:00

I have a table that holds project manager and project director employee id’s e.g

  • 0

I have a table that holds project manager and project director employee id’s e.g

projectmanagerId
projectdirectorId

I need to link each of these columns to a employees table, however the problem is that the both the projectmanagerId column and ProjectDirectorId column need to link to either of 2 columns e.g

JEmployeeId
MEmployeeId

I thought about creating a junction table like so

ProjectManagerEmployeeJunction1
-------------------------------
projectmanagerId
JEmployeeId

ProjectManagerEmployeeJunction2
-------------------------------
projectmanagerId
MEmployeeId

and similar for the director. Is this the best way to do this. Is there a better way. It seems overkill to create 4 tables for this.

  • 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-25T11:21:16+00:00Added an answer on May 25, 2026 at 11:21 am

    I would approach it in a similar but slightly different way.

    Rather than creating the table for ProjectManagers, and/or ProjectDirectors, create the table for all employees.

    EmployeeIDJunction
    ------------------
    externalID,
    EmployeeUniqueID
    

    An employee would then have two entries in the table. One record where the externalID is the JEployeeID, and one record where the externalID is the MEmployeeID. The EmployeeUnqiueID would then be any ID that you wanted to, that maps to your employee table. You could, in theory, have as many as you liked, provided they were unqiue across the whole table (So as to avoid mapping one externalID to multiple employees).

      Data
    INNER JOIN
      EmployeeIDJunction
        ON EmployeeIDJunction.externalID = Data.EmployeeID
    INNER JOIN
      Employee
        ON Employee.ID = EmployeeIDJunction.EmployeeUniqueID
    

    Just to re-itterate. This all assumes that the different EmployeeIDs NEVER collide. I can’t EVER have an ID in one system that YOU ALSO have in a different system.

    If that’s possible you need to start doing things like prefixing the IDs, or using composite keys such as (SystemId, EmployeeID) pairs. Either way, the concept above should still allow you to map multiple ID’s to a single Employee record, without using OR’s and so getting maximum benefit from INDEXes.

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

Sidebar

Related Questions

As part of a recent project, I have created a Cell Table that holds
I am using PHP/MySQLin my project, and I have a table that holds time
I have a table that holds information about cities in a game, you can
I have a table that holds only two columns - a ListID and PersonID.
Given that I have a table that holds vehicle information and one of those
I have a MySQL table that holds many entries with repeated IDs (for various
I have a table (table variable in-fact) that holds several thousand (50k approx) rows
Lets suppose that I have a Category table with a column that holds the
I have a table that got into the db_owner schema, and I need it
I have one table that holds my ressources: Ressource | Ressource-ID And a table

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.