Re: Database design for a little soccer league
Date: Mon, 21 Mar 2011 16:41:11 +0000 (UTC)
Message-ID: <im7v37$fh6$1_at_speranza.aioe.org>
Mariano C. wrote:
> It's true. I don't need id key for lineups.
> No, shirt number isn't a key. ID key is an autoincrement table, and I
> have all those id column cause I need to call in that way. I'm using a
> framework, cakephp, and that naming convention is the better way.
If you are going to let half-wit frameworks design/compromise your database you probably aren't going to get much love here.
> Yes, i use foreign key costraint.
That's fine, but my main point was that you can declare the FK so that it is updated automatically when the referenced value is updated. The (perfectly valid) wish to avoid having to write application code to handle that situation is frequently cited as the justification for "needing" spurious synthetic keys.
My secondary point is that using synthetic keys exclusively, without also declaring any natural keys creates a data integrity problem that will remain concealed from the applications or the DBMS. It's akin to replacing a circuit breaker with a copper pipe. The electricity will flow just fine...
> My doubt was about associations type.
I didn't even get to the point of thinking about that. I'm sure it will be the least of the problems with the design.
-- RoyReceived on Mon Mar 21 2011 - 17:41:11 CET