milkman2500
Registered User.
- Local time
- Today, 08:50
- Joined
- Oct 21, 2012
- Messages
- 45
Hi,
I'm trying to figure out the best way to layout my tables. Each object has it's own table (i.e. "t_employees", "t_accounts", "t_funds"). However, how would you recommend I setup the relationships between the tables? Assume there are many employees to 1 account, many funds to 1 (employee + account).
I was thinking I could set it up 2 different ways:
Option 1
t_lookup:
lookup_id
employee_id
account_id
fund_id
The problem with this setup is I can't easily report on the employee to account relationship without using the "unique" feature of a query.
Option 2
t_lookup_1:
lookup_id_1
employee_id
account_id
t_lookup_2:
lookup_id_2
lookup_id_1
fund_id
I can now easily report on the individual relationships between employees and accounts, or employees, accounts and funds. However, the table construction is not that logical. It doesn't follow an intuitive setup.
Can someone please offer some recommendations?
I'm trying to figure out the best way to layout my tables. Each object has it's own table (i.e. "t_employees", "t_accounts", "t_funds"). However, how would you recommend I setup the relationships between the tables? Assume there are many employees to 1 account, many funds to 1 (employee + account).
I was thinking I could set it up 2 different ways:
Option 1
t_lookup:
lookup_id
employee_id
account_id
fund_id
The problem with this setup is I can't easily report on the employee to account relationship without using the "unique" feature of a query.
Option 2
t_lookup_1:
lookup_id_1
employee_id
account_id
t_lookup_2:
lookup_id_2
lookup_id_1
fund_id
I can now easily report on the individual relationships between employees and accounts, or employees, accounts and funds. However, the table construction is not that logical. It doesn't follow an intuitive setup.
Can someone please offer some recommendations?