Re: DDL issue

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: DDL issue
Date: 2024-09-12 23:32:25
Message-ID: CAKFQuwahuUyPAqG2hVi=uzVdRdU-jMmQ2eZizAKAxr=s_iVVDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, September 12, 2024, Rich Shepard <rshepard(at)appl-ecosys(dot)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.

In response to

  • DDL issue at 2024-09-12 23:01:30 from Rich Shepard

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-09-12 23:46:51 Re: DDL issue
Previous Message Rich Shepard 2024-09-12 23:01:30 DDL issue