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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:30:30+00:00 2026-05-24T08:30:30+00:00

Below is a diagram of a database in which I am trying to determine

  • 0

Below is a diagram of a database in which I am trying to determine the appropriate design for. Here are a few notes.

  • Employees/managers are associated with customers.
  • The partyid is a way to globally represent a person; customer, employee, manager. Does it need to propagate all the way down? Should it be a primary key in all tables or just the tables that represent an individual?
  • Do the other tables such as billing, reporting, credential, etc tables need to have their own respective id’s that are primary keys, e.g. billingid, reportingid, credentialid, etc?

Some notes about the interaction of the entities.

  • employees have a manager(s) associated with them.
  • customers have a manager(s) and possibly employees associated with them.
  • customers and employees will need to report time billed.

enter image description here

  • 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-24T08:30:31+00:00Added an answer on May 24, 2026 at 8:30 am

    The table “party” doesn’t look right. Compare to the source code from this other SO question.

    In this kind of structure, the party id number does propagate downward, so to speak. It should usually be either a primary key or a foreign key in tables that store data about a person.

    In your table “reporting”, it looks like the primary key shouldn’t be ‘partyid’. That would allow only one row per employee, which I don’t think you intended. (I could be wrong.) If I’m right about that, you might consider a NOT NULL UNIQUE constraint on {partyid, date}, and a PRIMARY KEY constraint on a new column, ‘reportid’. The tables “travel” and “performance” would probably reference ‘reportid’. (But keep reading.)

    There are places in your diagram where an entity gets an additional key: your company assigns a unique employee id number to its employees, for example. There’s no theoretical reason you can’t use ’employid’ instead of ‘partyid’ from that point on to reference employees. But there is a practical reason you might not want to do that. It increases the number of joins.

    For example, if the tables “credential”, “tool”, “certification”, “academic”, and “compliance” referenced employee.employid instead of employee.partyid, you couldn’t just join “compliance” and “party” to get the person’s name. You’d have to join “employee”, too.

    Do the other tables such as billing, reporting, credential, etc tables
    need to have their own respective id’s that are primary keys, e.g.
    billingid, reportingid, credentialid, etc?

    They need to have a primary key; the primary key doesn’t necessarily have to be an id number. If there’s an existing natural key, you have to identify it and declare it UNIQUE anyway.

    The table “orders” should probably have only “orderid” as its primary key; use a foreign key reference to identify the customer. In some cases, it makes sense to rename columns. In the case of customers, it might make sense to call its key ‘customerid’ instead of ‘parytid’. I’d create a domain, myself.

    create domain PARTY_ID as integer not null;
    

    Then, everywhere that needed a party id number, I’d use the domain instead.

    create table customers (
        customerid PARTY_ID primary key references parties (partyid),
    ...
    

    I’d prefer to see a table of managers, too. A reference to it would guarantee that manager.managerid would resolve to an actual manager, not just to any employee.

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

Sidebar

Related Questions

I am trying to understand UML diagram describing Decorator Pattern at link below http://www.dofactory.com/Patterns/PatternDecorator.aspx
In the diagram below you can see a simplified version of what I'm trying
I've build a Database Molde Diagram in Visio 2010 and am trying to Forward
In below diagram what is the meaning of below arrows ? Here's what I
As shown in the diagram below, my app has a few UIViews, B ,
i want tool for to generate DB diagram below, i need to generate particular
I just gave a database diagram for a DB I created to our head
What I have? I have below requirements: Search the database and return TreeNode objects
As you can see in architecture diagram below android platform has been built using
i'm try to determine the amount to scale down an image, which is in

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.