In: Computer Science
Database Design
Define Accounts
--------
account_id | account_type
---------------------------
001 | Trusts
002 | IRA|
003 | 401k
004 | HSA
===========================
Define Brokerages
---------
brokerage_id| brokerage_name
----------------------------
001 | Fidelity
002 | Vanguard
===========================
Define Investments
-----------
investment_id | investment_type
-------------------------------
001 | Large Cap,
002 | mid cap,
003 | small cap,
004 | Bonds ,
005 | international
===========================
Link all features to one unique entity which is
user(account_no)-> has account type, joint for xyz investment,
has abc brokerage
user_accounts
-------------
account_no(Null Not allowed) | account_id(Null Not allowed) |
investment_id(Null allowed) | brokerage(Not Allowed)
--------------------------------------------------------
1245 | 001 | 002 | 002
It means account 1245 is of type Trusts joint with investment
mid cap has brokerage Vanguard