Re: DDL issue - Mailing list pgsql-general

From Rich Shepard
Subject Re: DDL issue
Date
Msg-id 4fb4a8d4-5f3a-b4aa-6b10-8b95d349941@appl-ecosys.com
Whole thread Raw
In response to Re: DDL issue  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Thu, 12 Sep 2024, Adrian Klaver wrote:

> Quick and dirty:
>
> people_table
>   person_id  PK
>   name_last
>   name_first
>   email_address
>   ph_number
>   ...
>
> location_table
>   loc_id   PK
>   person_id_fk FK <--> people_table(person_id)
>   loc_name
>   loc_st_addr
>   loc_st_city
>   loc_st_st_prov
>   ...
>
> contact_table
>   contact_id  PK
>   loc_id_fk   FK <--> location_table(loc_id)
>   contact_ph_number
>   contact_email  --Can be null
>
> It can get more involved then this, depends on how flexible you want to get.

Adrian,

There are many companies with multiple locations, but few owners with
multiple companies, each with a different location. David's reminder about
many-to-many tables will do the job.

Thanks,

Rich



pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: DDL issue
Next
From: Rich Shepard
Date:
Subject: Re: DDL issue