There are entities: 1) LE (legal entity, company) with the properties: Name, TIN, OGRN; 2) FL (individual, person) with properties: full name, TIN

Relations between these entities are possible "Established", characterized by the property "share". A LE may have several founders, which may be both a FL and a LE. Please advise which DB schema is suitable for storing instances of the specified entities and relationships;

    2 answers 2

    I would do that.

    The first table with Yurika (UL)

    The second table with physicists (FL)

    And two tables with links (LINKS_UL, LINKS_FL)

    create table LINKS_UL( id int foreign key UL(id), related int foreign key UL(id) ) create table LINKS_FL( id int foreign key UL(id), related int foreign key FL(id) ) 

    But in general, much depends on how you plan to use the data.

      Legal entities and individuals are one and the same entity “subjects of law”. At least they have a lot in common. Based on this, you can make this structure:

      1. Subjects of law: subject ID, type of subject (FL / UL), Name (full name if FL), TIN, other general fields
      2. Legal entities: there is no ID, the primary key is a one-to-one link to the ID from the "subjects". Plus specialized fields of LE, which FL has no analogue of.
      3. Founders: Subject ID UL - foreign key referring to the Subject ID from the table of legal entities, Founder ID - foreign key referring to the Subject ID from the "Legal Subjects" table, the primary key of the two fields. Plus, other fields like shares in the authorized capital, etc.

      If you wish / need for individuals, get an additional table by analogy with the lawyers. Those. with a 1-to-1 relationship with a table of subjects