I have a MySQL database with 3 tables holding the main classes of data:
companies (company_id)
persons (person_id, company_id)
loans (loan_id, company_id)
Run Code Online (Sandbox Code Playgroud)
Both a 'loan' and a 'person' belong to a company. A company can have loans and a company can have people (such as directors, employees etc.)
There are several scenarios where other data can belong to either a company, a person or a loan, such as 'notes'. For example a user can add a 'note' specific to either …