Bank modeling with classes with relationship from n to n

0

Good morning.

I'm modeling a company that has multiple branches. Basically I have information, of size, the organization chart of each size, and positions in the branches.

For example

Porte: Small 1, Small 2, medium, large, ...

Item Organogram: Direction, Markting, Sales, Logistics, Management ...

Position: Director, Secretary, Manager, Salesman, Deliverer, Co-adjunct ...

The problem is basically this.

Each branch of the company has a size. A port can have multiple organizational chart items (for example if the unit is small 1 can have only the item of the sales organization chart, if it is small 2 can have management and sales, if media can have direction, management and sales , etc.), and an organizational chart item can be linked to several sizes (for example, direction can be in small to large, management can only be in medium and large, etc.). An organizational chart item may be related to another, for example, I have direction as a parent and under management I have management and markting, and under markting I have sales and so on. Each position is linked to an organizational chart item, which may have one or more (eg: In the management organization chart I can have the position of director and secretary), as well as each item may have one or more charge. And the positions are linked to the branches, a branch can have several positions, and I can have the same position in several branches, but the position is not linked to the size itself, for example I can have the position of secretary in the organization chart of a small affiliate, but may not have a position as secretary of management in a subsidiary of medium, that is, it depends on each unit.

I did a modeling on Astah .ButIdonotknowifit'scorrect,andfromit(orcorrect),howwouldyoumodelthedatabase(Usingmysql).

    
asked by anonymous 19.04.2018 / 16:37

1 answer

0

Is not correct, _rel_port_organization_, you have a connection going from you to yourself, delete this please. If variables are linked, you must make a separate table. When the connection is from 'n' to 'n', it also creates an intermediate table that will store the values but with different ids. Getting [Porte] n ---- 1 [AUXILIARY TABLE] 1 ---- n [item_organogram]. Finally, there should be no "T" connections, a dashed line does not separate at 2, makes the connections independent.

Example of a good data model: Good example

    
19.04.2018 / 16:56