Hi all, 

I need some advice on a project I have.  Basically, I have some tables:

CREATE TABLE listings (
  ListingID bigint(20) unsigned NOT NULL auto_increment,
  CatalogNumber varchar(12) NOT NULL default '',
  PDFLink varchar(100) default NULL,
  PDFName varchar(80) default NULL,
  Title varchar(100) NOT NULL default '',
  ComposerID int(11) default NULL,
  ArrangerID int(11) default NULL,
  PublisherID int(11) default NULL,
  Price double(16,2) NOT NULL default '0.00',
  DiscountID int(11) default NULL,
  Description text,
  NewTitles tinyint(1) default NULL,
  CategoryID int(11) NOT NULL default '0',
  PRIMARY KEY  (ListingID)
) TYPE=MyISAM;

CREATE TABLE categories (
  CategoryID int(11) NOT NULL auto_increment,
  Name varchar(50) NOT NULL default '',
  Alias varchar(60) default NULL,
  DiscountID int(11) default NULL,
  Description text,
  GroupID int(11) NOT NULL default '0',
  PRIMARY KEY  (CategoryID)
) TYPE=MyISAM;

CREATE TABLE groups (
  GroupID int(11) NOT NULL auto_increment,
  Name varchar(50) default NULL,
  DiscountID int(11) default NULL,
  PRIMARY KEY  (GroupID)
) TYPE=MyISAM;


Currently, there is a one-to-one relationship between listings and
categories, and listings and groups.  Now, the customer is requesting
that a listing be included in several categories.  I am not quite sure
how to do this.

My thought was to add a new field to the listings table that would
contain a comma-separated list of CategoryIDs, but something doesn't
feel right about this solution.  

What would be a good approach to this problem?

-Erich-



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to