public inbox for [email protected]  
help / color / mirror / Atom feed
Re: DDL issue
2+ messages / 2 participants
[nested] [flat]

* Re: DDL issue
@ 2024-09-12 23:32  David G. Johnston <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: David G. Johnston @ 2024-09-12 23:32 UTC (permalink / raw)
  To: Rich Shepard <[email protected]>; +Cc: pgsql-general

On Thursday, September 12, 2024, Rich Shepard <[email protected]>
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.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: DDL issue
@ 2024-09-13 12:36  Rich Shepard <[email protected]>
  parent: David G. Johnston <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Rich Shepard @ 2024-09-13 12:36 UTC (permalink / raw)
  To: pgsql-general

On Thu, 12 Sep 2024, David G. Johnston wrote:

> 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,

Thanks very much. I knew about those a long time ago but haven't needed them
in a long time so I forgot about them. Will re-learn.

Much appreciated,

Rich






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-09-13 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-12 23:32 Re: DDL issue David G. Johnston <[email protected]>
2024-09-13 12:36 ` Rich Shepard <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox