Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sotIi-00EZoA-Hk for pgsql-general@arkaria.postgresql.org; Thu, 12 Sep 2024 23:32:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sotIh-003V5s-BO for pgsql-general@arkaria.postgresql.org; Thu, 12 Sep 2024 23:32:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sotIg-003V30-UM for pgsql-general@lists.postgresql.org; Thu, 12 Sep 2024 23:32:34 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sotIZ-000tOw-3R for pgsql-general@postgresql.org; Thu, 12 Sep 2024 23:32:34 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-277efdcfa63so718382fac.2 for ; Thu, 12 Sep 2024 16:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726183946; x=1726788746; darn=postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DxcyyHgWnmp/yv4D2c14A8dDbc6fDe6sxtoi8uAva6o=; b=HJraptK7+mxbopGGoDuTuSeU/5WFub4SdSy4GdACLJ3aZfuxfITws3EZ+8+NQqz1Ao 3AF3CMoEkWFqYzfV6Rgs+nlb7zmpVOwT59H212NXQ1gOKm5QFpQzeebC3aXwPmkXdlg6 usceWWI+wJz2pw9qv1tkfd91+BOTfyp/+iU84H8fryK8AspbETudUDguhRcMWRiXI5UY Syn+OOgcYhEVaVs0Bw02jPJW+y8OvYmpwMC/cmBxIxWfCOXCqKCLDLbES9J3EkpEjc4X 7aoB4bjRUXFUF8UsflQNUoLy5dScn5v5LoAlk0wVaFS4v207EoUFppZ+9+Y5Cadf0TYn 4r8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726183946; x=1726788746; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DxcyyHgWnmp/yv4D2c14A8dDbc6fDe6sxtoi8uAva6o=; b=p4xox3uQSwVzD3XND6syuidVUj+2f055aldygSR5RCXgEb7r3TLGtKMcwazyqrc/FV eR2BnAlbSx0v9FCy0hRkMPwqJXUW8rQqUdpqsd4/MJRTQKvQ0JWRIWfosJ9PVrexsnNR aJ8JI6Swdgo8ZgVcSS23Ew7gYW+U3Cwg3bNzvrkRGJmH50/qNmCO2ARgy6PhTnjeMlzm CgXuu8PrpsV7+pUbLw207csu4TNyQuvbCswjwMOUnX64AKD0i+6Fr+Rmhs16VTyfxWtR y4L2OZmFx8hPhmB4U60koyOYPGsYtV/k67iWqDaDGf8ENJJO9GZyBjaayXrSe+VyiVyI Q1jg== X-Gm-Message-State: AOJu0YxEusFif8oVTIW2vizhvaUJOh4nS7WN7aZeva9JjDuxhoIU6YSz 1vFeCZE4oqC2XvUCMGHeuVPje0iEJkt910wNkA6z5TFNr8Kwbq8NXKt6dTNltQBh6Ya6TDGHInd 7PiZv6SW+nTk9oFH0OwbMoPN4X/I= X-Google-Smtp-Source: AGHT+IGKeN6wplfc0pxhNAugNbRCfGFrZPanw84//3YsSUdqsk+KR6LAFl34S6dvYin0sznmlbkF37LeJymlWbrhkqQ= X-Received: by 2002:a05:6870:e311:b0:270:463e:4b72 with SMTP id 586e51a60fabf-27c3f2cde68mr3197493fac.20.1726183946356; Thu, 12 Sep 2024 16:32:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:e0e:0:b0:557:c384:fb61 with HTTP; Thu, 12 Sep 2024 16:32:25 -0700 (PDT) In-Reply-To: <91bda8-3bdb-d93-6c17-41a03a3de27a@appl-ecosys.com> References: <91bda8-3bdb-d93-6c17-41a03a3de27a@appl-ecosys.com> From: "David G. Johnston" Date: Thu, 12 Sep 2024 16:32:25 -0700 Message-ID: Subject: Re: DDL issue To: Rich Shepard Cc: "pgsql-general@postgresql.org" Content-Type: multipart/alternative; boundary="000000000000f08fd20621f48404" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f08fd20621f48404 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, September 12, 2024, Rich Shepard wrote: > I have one name in the people table who owns 5 different dairies with thr= ee > 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 tabl= e > 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 a= s > dairy farms, this is not an unusual situation. > Read up on =E2=80=9Cmany-to-many=E2=80=9D data models. In SQL they involve= a linking table, one row per bidirectional edge, in addition to the two node tables. David J. --000000000000f08fd20621f48404 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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<= br> 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<= br> dairy farms, this is not an unusual situation.

Read up on =E2=80=9Cmany-to-many=E2=80=9D = data models.=C2=A0 In SQL they involve a linking table, one row per bidirec= tional edge, in addition to the two node tables.

D= avid J.
=C2=A0
--000000000000f08fd20621f48404--