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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:57:37+00:00 2026-06-04T01:57:37+00:00

I want to store this information in a database: Company | |– Dept 1–,

  • 0

I want to store this information in a database:

Company
   |
   |-- Dept 1--,
   |            \->Employee 1
   |             |->Employee 2
   |
   |-- Dept 2--,
   |            \->Employee 3
   |
   |-> Employee 4
   \-> Employee 5

I’ve already got this far: I need a employee table and the department and company items are just the same so they should be in the same table…

employee // id | information...
branch  //  id | information....

Each employee should be linked to a branch. And each branch can be connected to another branch…

employeeBranch // employee.id | branch.id | enum(current, historical)
branchBranch   // branch.id   | branch.id

This makes it possible to have multiple levels of branches…

But I’m doubting if this is The way to do it..

  • 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-04T01:57:38+00:00Added an answer on June 4, 2026 at 1:57 am

    If employees can only belong to one branch and branches can only be a child to one branch then you might consider adding a column to represent this information instead of whole new tables:

    employee // id | branchId | information
    branch   // id | parentBranchId | information
    

    If you have many to many relationships for employee/branch and branch/branch then I think your original structure is fine.

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

Sidebar

Related Questions

I need to store information for staff. Each database instance is per parent company
Recently I want to store some social graph information into our database, and user
I am trying to store recurrence event information into a database. I want to
Is this possible? Situation is that I want to store some XML in my
I am not sure if this is possible, but I want to store an
Hey guys, I want to store a categorized list of URLs. This is an
i want to serialize this class, to store it on the sdcard of the
I have this scenario. I want group on Country and Category. A store can
I want to store additional information on my users (address, phone). Should I extend
I have a Database containes information about all the branches of our company around

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.