Re: Composite Primary Key Design

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Dkline (Dkline001_at_comcast.net)
Date: 12/29/04


Date: Wed, 29 Dec 2004 12:40:40 -0500

Rick - thanks for the reply.

I left out a crucial element. An insured can be in many policies. A policy
can have many insureds. So I believe I will need a linking or union table.
Mea culpa for leaving that vital information out.

Don

"Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
news:33g770F3tdeteU1@individual.net...
> Dkline wrote:
>> I'm trying to figure out the best design for a new database for a
>> composite primary key (CPK) where one of the fields may be a NULL - a
>> violation of a primary key. We will be using on SQL Server 2000 with
>> an Access front end. Existing database is entirely in Access and we
>> are upsizing. The CPK will be the most fundamental in the database.
>>
>> I am working on a life insurance database. Each case can have one or
>> more insureds - if multiple insureds normally two but theoretically
>> could be more.
>>
>> We assign a policy number to each case e.g. "VUL100000". If this case
>> has more than one insured e.g a husband and wife - we currently
>> append an "a" or a "b" to set up a unique key for each of the
>> insureds. If the policy has only one insured, then a letter is not
>> appended.
>> So if VL100000 has two insureds and VL100001 has one insured the keys
>> would be:
>>
>> PolicyNumber
>> VUL100000a (for the husband or first insured)
>> VUL100000b (for the wife or second insured)
>> VUL100001 (no letter appended as it is a single insured
>>
>> The above works as Primary Key. But what we want to do is to leave the
>> PolicyNumber alone and have a second field distinguish the record:
>>
>> PolicyNumber PolicyNumberAlpha
>> VUL100000 a (for the husband
>> or first insured)
>> VUL100000 b (for the wife or
>> second insured)
>> VUL100001 (no letter
>> appended as it is a single insured
>>
>> Since the field "PolicyNumberAlpha" can be blank or NULL it doesn't
>> work as part of a CPK.
>>
>> I suppose one solution would be to assign a "z" to the single insured
>> for the CPK. His policy number alone makes his record unique so
>> assigning a suffix in the PolicyNumberAlpha field is unnecessary.
>>
>> What is the most efficient design to handle this?
>
> You need two tables (IMO). One for Policies and a related one for the
> InsuredPersons. There would be a one-to-many relationship between these
> two tables. Then every PolicyNumber can be associated with any number of
> InsuredPersons. Policy table would have a single-field PK consisting of
> the PolicyNumber and the InsuredPersons table would use a composite key of
> PolicyNumber and an additional field to identify the person.
>
> --
> I don't check the Email account attached
> to this message. Send instead to...
> RBrandt at Hunter dot com
>



Relevant Pages

  • Re: Composite Primary Key Design
    ... Existing database is entirely in Access and we ... > more insureds - if multiple insureds normally two but theoretically ... > The above works as Primary Key. ... > PolicyNumber alone and have a second field distinguish the record: ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Unbound Search textbox
    ... An unbound combo that lists the possible policies will be the quickest ... Use its AfterUpdate event to find the matching ... I have a form that has the following fields "PolicyNumber" - text field ...
    (microsoft.public.access.formscoding)
  • Re: Joined two tables
    ... It would seem that PolicyNumber T2315 is NOT a unique policy. ... FinishedClaims - Table ... What I want is to show all Policies in the Claims table and if there is a ... PolicyNumber Received date Policy_Type AssignedTo ...
    (microsoft.public.access.queries)
  • Re: Joined two tables
    ... It would seem that PolicyNumber T2315 is NOT a unique policy. ... FinishedClaims - Table ... What I want is to show all Policies in the Claims table and if there is ... PolicyNumber Received date Policy_Type AssignedTo ...
    (microsoft.public.access.queries)
  • Joined two tables
    ... Data gets uploaded into the database to both ... FinishedClaims - Table ... PolicyNumber - text ... PolicyNumber Received date Policy_Type AssignedTo ...
    (microsoft.public.access.queries)