SQLite Forum

closure table, prevent identical childrens names per parent
Login
Wait … this is real life genealogy data, not just an abstraction ?  In that case you must allow duplicate names within families.  It happens all the time.  One reason for it happening is that the real names are all foreign but get translated to the same English name.  For instance, 'Smuel' and 'Sami' (which should both be written in non-Roman characters) both get translated into the English 'Samuel'.

There are two normal ways of solving the problem.  They both involve adding an extra integer used for disambiguation.  One is to just use an incrementing integer, so Smuel ends up as 'Samuel (1)' and 'Sami ends up as 'Samuel (2)'.  The other is instead of small integers to use their year of birth, giving 'Samuel (1833)' and 'Samuel (1835)'.