[thelist] Tricky SQL
Tom Dell'Aringa
pixelmech at yahoo.com
Tue Jun 18 14:51:00 CDT 2002
> > Once again, back asking for help... :)
> >
> > I've got multiple tables in the same database that are identical in
> > structure, but not in data. (this is a sports database, so the "men's
> > soccer" table is identical to the "women's soccer" table, yet they have
> > different data in the rows).
<SNIP>
> >
> > Thoughts?
> >
> > -Ken
Ken, I'm no expert but I've had good luck with "intersection tables" for this type of thing. For
example, if each GAME (mens, womens, whatever) made an entry into a table (say GAMES) with a date,
you could then call all that information based on that table, since the game entry would point an
ID back to the mens, womens soccer, tennis or whatever table - AND you could call it by date.
For Example:
Mens Soccer table: Score, Date, MensID
Womens Soccer tbl: Score, Date, WmnsID
Intersection table: (games)
gamesID
Score
Date
OriginID (foreign key for inserting table (ie. mensID))
Make sense?
Tom
=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
More information about the thelist
mailing list