Re: Database design . Beginner having trouble.

2008-12-13 Thread gearvOsh
If I believe what you are saying, something like this would work (not sure what fields you need): // all the tenants tenants - id - name // all the expenses expenses - id - cost // relating a tenant to an expense = multiple tenants possible on an expense tenantExpenseRelation - id - tenant_id -

Database design . Beginner having trouble.

2008-12-13 Thread Tanay
I have two database tables. Tenants and expenses. Tenant has many expenses. Expense belongs to tenant. When ever a new expense is created a tenant who has paid for the expense is associated with it. Now i want another relationship which is "affects". Each expense may not affect all tenants. So wh