Just curious what is the best practice for solving the following issue. I have institutions, accounts and users tables. Institutions and accounts have a one-to-many relationship. Institutions and users have a one-to-many relationship. Users and accounts have a many-to-many relationship or alternatively they could have a many-to-all (or *) accounts. Meaning, that a user could be designated to all accounts, and any new accounts that are added to the institution the user would have access to without explicitly adding the relationship.
Share
I’d do it like so:
Have a UserID w/ a
NULLentry in theUsers_Accountstable have global (*) access. This way, you can determine the Institution on any Account and/or User, as well as their permissions.Edit: Columns w/ the same name in different tables imply a Foreign Key. Please use them if you aren’t doing heavy loads.