Hi Phil,
It seems to me that each of those set could have a many-to-many
relationship to both of the other sets - coding them just depends on whether
people really care about what teams played in year xxxx or what years Johnny
XXXX played in.
Check out this page for these "has and belongs to many" relationships:
http://wiki.rubyonrails.org/rails/pages/has_and_belongs_to_many
-----Original Message-----
From: rails-bounces@lists.rubyonrails.org
[mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Philip Rhoades
Sent: Saturday, April 15, 2006 9:30 PM
To: rails@lists.rubyonrails.org
Subject: [Rails] Design question: Years/Teams/Students
People,
I want to design a historical sports db for my old school. I think at
the moment it should be like:
A year has many teams
A team has many students
A student has one lastname, firstname and middlename
but a student can also have many teams (eg summer/winter abd over a
number of years) . .
Is there a problem with this? Doesn''t it just mean that there will be
a
student table with:
id
lastname
firstname
middlename
and a separate "studentteams" table with:
id
student_id
team_id
?
Thanks,
Phil.
--
Philip Rhoades
Pricom Pty Limited (ACN 003 252 275 ABN 91 003 252 275)
GPO Box 3411
Sydney NSW 2001
Australia
Mobile: +61:(0)411-185-652
Fax: +61:(0)2-8221-9599
E-mail: phil@pricom.com.au
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails