Re: DDL issue - Mailing list pgsql-general

From David G. Johnston
Subject Re: DDL issue
Date
Msg-id CAKFQuwahuUyPAqG2hVi=uzVdRdU-jMmQ2eZizAKAxr=s_iVVDw@mail.gmail.com
Whole thread Raw
In response to DDL issue  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: DDL issue
List pgsql-general
On Thursday, September 12, 2024, Rich Shepard <rshepard@appl-ecosys.com> wrote:
I have one name in the people table who owns 5 different dairies with three
different phone numbers, but all 5 have the the same email address.

The five dairies each has its own name and location while the people table
has five rows with the same last and first names and email address.

Is there a way to have only one entry for the owner in the people table
while related to five different company names? In some industries, such as
dairy farms, this is not an unusual situation.

Read up on “many-to-many” data models.  In SQL they involve a linking table, one row per bidirectional edge, in addition to the two node tables.

David J.
 

pgsql-general by date:

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