Re: [SQL] [GENERAL] Schema design / joins

2010-05-04 Thread silly sad
__Orgs__ id name __Seasons__ id org_id fk(orgs.id) name __Teams__ id season_id fk(seasons.id) name __TeamFees__ id team_id fk(teams.id) *org_id<--- (?put extra fk here to avoid many joins?) NO. instead of it use triggers before insert/update CREATE FUNCTION foo() RE

[SQL] Foreign key constraint referencing a parent table

2010-05-04 Thread David Weilers
Hi, I have a problem when inserting rows into my table tblfactuurpost that references a table tblfactuur which is a parent to tblclientfactuur. The actual row is inserted into tblfactuur. The problem is that i cannot insert the row into tblfactuurpost (which references the parent table tblfac