views:

49

answers:

2

if you haven't guessed by my other questions I'm building a soccer based apps and using data from different websites/feeds/api's but different websites carry team names either full names, abbreviated or slang names.

examples would be-

Manchester united- Man united- Man utd
Tottenham Hotspurs- Spurs, Tottenham Hotspurs FC

The main application is built in ruby on rails, php is used for xml processing and perl is used for website scraping. With the DB being MySql.

I have a Team table, with title/name field- would it be best to carry an array in the table? I would like a function to match the team name.. is this the best way. Or have a table to match team names?

Something written in php as most data is being scraped from xml feeds

+2  A: 

Why not have a Team and a TeamAlias table (with a one-to-many relationship)?

RichardOD
A: 

Team hasMany Names is the way to go I think

CREATE TABLE teams (
`id` INT AUTO_INCREMENT,
# ... more fields go here ...
PRIMARY KEY (`id`)
);

CREATE TABLE teamnames (
`id` int auto_increment,
`team_id` int not null,
`team_name` varchar(50) not null,
PRIMARY KEY (`id`),
KEY `team_id` (`team_id`)
);
Timur Asaliev