Am 18.05.2013 um 13:24 schrieb andy pugh <bodge...@gmail.com>: > On 18 May 2013 06:15, Michael Haberler <mai...@mah.priv.at> wrote: > >> tools(toolid, length, diameter, other-non-offset parameters) >> offsets(offsetid, xoffset,yoffset..., purpose) (purpose could be: >> coordinate system offset, wear, tool holder..) >> >> then you have a relation describing the active offsets, which is 1:N in >> nature (a tool can have an arbitrary number of offsets or none at all): >> >> tooloffsets(toolid, offsetid) (only toolid is a primary key) > > I think toolid is the wrong primary key there, assuming that primary > keys are unique. I think that the "relation" (if I have my technical > terms correct) is > > tooloffsets(tooloffsetid, toolid, offsetid) >
you are right, good find - what needs to be unique is the tuple {toolid, offsetid} > To take a concrete example, tools 11 and 22 both with offsets 33 and > 44 applied would be: > tooloffsetid toolid offsetid > 1 11 33 > 2 11 44 > 3 22 33 > 4 22 44 the usual way to handle this is to define the tuple {toolid, offsetid} as primary key, which will avoid duplicates of that tuple (that could happen in theory if the only primary key is tooloffsetid like so:) > 1 11 33 > 2 11 33 > > -- > atp > If you can't fix it, you don't own it. > http://www.ifixit.com/Manifesto > > ------------------------------------------------------------------------------ > AlienVault Unified Security Management (USM) platform delivers complete > security visibility with the essential security capabilities. Easily and > efficiently configure, manage, and operate all of your security controls > from a single console and one unified framework. Download a free trial. > http://p.sf.net/sfu/alienvault_d2d > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers ------------------------------------------------------------------------------ AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers