Subject | Re: [firebird-support] Primary keys - was Copy records |
---|---|
Author | Lester Caine |
Post date | 2004-08-05T17:13:54Z |
Planles wrote:
But MC_id + MC_key is unique ? ( Different MS_id's could have the same
MC_key ? )
I have records in master table 1 to n
and sub records in detail table 1(1 to n)
so the the detail table uses record and subrecord to create a primary
key. All details will have a sub record of 1, but only one for each
master record.
Hope that covers it ;)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
> Table1:So M_ID is Unique PRIMARY_KEY = M_id
> M_id, M_desc, M_desc2,...
> Table2:So MC_key may not be unique?
> MC_id, MC_key, MC_qty,...
>
> Each record in Table1 can have multiply records in Table2.
But MC_id + MC_key is unique ? ( Different MS_id's could have the same
MC_key ? )
> Now I had M_id in Table1 as primary key, and MC_id and MC_key from Table2 asTable2 PRIMARY_KEY = ( MC_id, MC_key )
> primary key. MC_id is equal to M_id, and MC_id and MC_key is a unique pair.
>
> Could you explain me, how should I proper do this relationship.
I have records in master table 1 to n
and sub records in detail table 1(1 to n)
so the the detail table uses record and subrecord to create a primary
key. All details will have a sub record of 1, but only one for each
master record.
Hope that covers it ;)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services