I think you should consider the difference between “position” and “role”. In many organizations, several roles may exist: security coordinator, procurement, accounts payable, registrar, ... Often, especially in small organizations, one person can act in different roles at different times. Perhaps even they tell different people when they act in different abilities (for example, an emergency responder can inform the security coordinator, but the buyer reported to the chief of the operation.)
In order to correctly reflect these things, the relationships in your database should reflect, as far as possible, the relationships that exist in real life. This probably means that you will have several tables (as you already have), but it will be clean.
Another thing to keep in mind (and perhaps worth reflecting in your database) is that many organizations have a matrix: people can be in specific project teams and in some specific organizations. Electrical engineers can report to the electrical engineer manager, but they can work on various projects / products and thus belong to different project teams.
Removing everything that’s accurate is difficult. Here is my suggestion (not like yours, but with some settings):
Table 1: employees Person name, employee ID, start date, salary, vacation, ...
This is a table that says when you receive money, how much time you have, what is your “HR” status. There is only one of you - in this table there is only one of you and is used for those things that cannot be doubled (although we would all like two payment checks).
Table 2: Managers Manager ID, Report ID, Report Type
In this table, for each manager, the people who report about them and what are the relationships are indicated. You can have “primary” relationships and other relationships: “project manager”, “team leader”, ... The “primary” manager can make decisions like HR with the help of “other” managers.
Table 3: teams Team name, team identifier, manager identifier, BelongsToTeam, team description, ...
A table that describes each "organizational object", with any supporting information that may be useful. BelongsToTeam allows a hierarchical command structure, which helps with visualization.
Table 4: Roles Role name, team ID, employee ID, isPrimary
This table describes who is in this role. An employee with several roles will be displayed several times in this table and can report to different managers depending on their role. I added the "isPrimary" field here - not sure if this is redundant. In a sense, if you start with the “primary” employee role in table 4 and find out who the team manager is in table 3, you should end up with the person in table 2 who is the main manager ... I’m worried that you You may encounter inconsistencies if you leave this in both places.
I believe that the above allows you to describe almost any organization - by allowing the "isPrimary" field in table 4, it would be possible that the same person who is your "HR boss" over everything appears as your "leader" project to the second team and may even inform you of the emergency response team ...
As for visualization - there are two obvious ways to do this with the specified structure. The first - "strictly hierarchical" - only showing people under their main manager. This is an "HR org chart" and each is displayed only once.
You may have a second team-based schedule. Now each team has its own organization, and the same person can appear in several teams. How these commands relate to each other can be tricky - but in principle, Table 3 should provide what you need in the BelongsToTeam field.
I look forward to hearing your thoughts about this!