Normalize ...relationships
| From: | Russell Griechen | Date: | Sat, 22 Mar 2003 03:34:06 +0000 |
| Subject: | Normalize ...relationships | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26551@lists.php.net to get a copy of this message | ||
a table 'hound'
contains ownerID, breederID.
These both are to be normalized in a separate table as in:
CREATE TABLE sportsmen (
sportsmenID bigint (10)notnull autoincrement,
Question: How? based on a sportsman can be a owner, breeder, hunter,
President,
Senator, Governor etc;
CREATE TABLE hound (
houndID bigint(10) NOT NULL auto_increment,
houndname varchar(60) ,
studbookID tinyint (4) ,
sireID bigint (10),
damID bigint (10),
dob varchar (20) ,
dod varchar (20) ,
colormarkID int (10) ,
ownerID bigint (10) ,
breederID bigint (10) ,
kennelID bigint (10) ,
litterID bigint (10) ,
health varchar (255) ,
PRIMARY KEY (houndID),
UNIQUE KEY (houndID),
KEY hdid_2 (houndID,houndname)
) TYPE=MyISAM COMMENT='Hound Registry';