* Andrew
> Actually thinking about this in a bit more depth!  I also have
> the infamous
> items table where individual company records are being stored.
> So is the best way to do this:
>
> i) add another field that will coreespond to the items.ItemsID or

I don't know what you mean.

> ii) create another table town_ref

What about City? In your previous post you said one City had multiple
Towns...?

> CREATE TABLE town_ref (
>   town_id int(11)  DEFAULT '' NOT NULL auto_increment,
>   town  varchar(255)    ,
>   PRIMARY KEY (town_id)
> );
>
> and then another table:
>
> CREATE TABLE item_town (
>   id int(11)  DEFAULT '' NOT NULL auto_increment,
>   item_id int(11)    ,
>   town_id int(11)    ,
>   PRIMARY KEY (id)
> );
>
> which will then involve adding another column to the items table :(

Is this a question?

Can a company (=one item record) be related to many towns? If soo, the above
looks ok. I would probably drop the 'id' column, and make (item_id,town_id)
a multiple-column primary key, and maybe also add a (town_id,item_id) key:

<URL: http://www.mysql.com/doc/en/Multiple-column_indexes.html >

HTH,

--
Roger


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to