Well.. I always use one auto increment field and make it primary key. But i think it is not a good idea. For example for the follwoing table.. to find a bid details we need to know project id and the person name who bid it. so I have used project id and developer id as composit key.
Well.. I can't remember ..somewhere i have read mysql does not spport composite key .. is it true ?
Do you have any coments or sugggestions
CREATE TABLE bid (
bid_project int(11) NOT NULL default '0',
bid_developer int(11) NOT NULL default '0',
bid_date varchar(40) NOT NULL default '',
bid_amount decimal(11,2) NOT NULL default '0.00',
bid_days smallint(4) NOT NULL default '0',
bid_comments text,
PRIMARY KEY (bid_project,bid_developer)
) TYPE=MyISAM CHARSET=latin1;
or
CREATE TABLE bid (
bid_id int(11) NOT NULL auto_increment,
bid_project int(11) NOT NULL default '0',
bid_developer int(11) NOT NULL default '0',
bid_date varchar(40) NOT NULL default '',
bid_amount decimal(11,2) NOT NULL default '0.00',
bid_days smallint(4) NOT NULL default '0',
bid_comments text,
PRIMARY KEY (bid_id)
) TYPE=MyISAM CHARSET=latin1;
Regards