I need some inputs on how I should structure my db.
Let's say I want to store members data in members table. There are two types of members, let's say person and organization. Person and organization have different set of information so that we have to store them into two different tables: let's say persons and organizations.
I would have the following tables:
members:
id
member_type_id
status
etc..
member_types:
id
type (person|organization|or any other type if needed)
persons:
id
name
etc
organization:
id
name
etc
My question is: Which one is the best of the followings?
- Have member_id in both persons and organizations tables
- Have an extra column in members table to store either person_id or organization_id
- Have two extra columns in members table to store person_id or organization_id whichever is applicable
There is another requirement that there may be another table referring to both persons and organizations table. Let's say we have a table called visitors who can also be a person or an organization.
Thank you for your input.