Re: one value from one of three different tables
Posted by: Peter Brawley
Date: November 11, 2015 11:58AM

I'm not clear about that design. For example, doesn't a flock's history ever need to be tracked? If so, you might want something more like ...

locations( locID smallint unsigned primary key auto_increment, 
           name, 
           stage enum('incubation','barn','pen'), 
           capacity, ... )

flock( flockID smallint unsigned primary key auto_increment, name, size, ... )

flockhist( histID smallint unsigned primary key auto_increment, 
           flockID smallint unsigned, 
           stage enum('incubation','barn','pen'), 
           locationID smallint unsigned, 
           indate date outdate date, 
           foreign key(locationID) references locations(locID) ... )

Options: ReplyQuote


Subject
Written By
Posted
Re: one value from one of three different tables
November 11, 2015 11:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.