On 4/06/2009 11:48 PM, Mark Hamburg wrote:
> One of the questions that I believe was raised but not answered on  
> this thread was how to make sure that you don't have circular  
> relationships particularly given that SQLite isn't good at scanning  
> the tree. If you can control the id's then simply require that the id  
> of the child be greater than the id's of the parents.

That puts some awkward constraints on the initial data take-on.

Presumably the date of birth will be recorded for each animal.

This should be sanity-checked for each animal; then for any (parent, 
child) pair you can check that the age of the parent when the child was 
born is neither too high or too low (with those thresholds varying by 
species). To guard against cycles it suffices to check that the alleged 
parent's age at child-birth is positive, but it wouldn't hurt to do some 
stronger checking for the sake of general data quality.

HTH,
John
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to