From: Dan Langille <dan@langille.org>
To: Jodi Kanter <jkanter@virginia.edu>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: proper db standard
Date: Fri, 06 Dec 2002 11:02:09 -0500
Message-ID: <3DF083B1.10740.B82095C@localhost> (raw)
In-Reply-To: <005a01c29d3e$8ad6c7a0$de138f80@virginia.edu>
On 6 Dec 2002 at 10:45, Jodi Kanter wrote:
> I am creating a simple database that will hold information about
> various pu= blications. There are keywords that are associated with
> these publications = and there can be anywhere from 1 to about 6 of
> these different keywords.
>
> As I see it I have two choices:
>
> 1) create keyword fields 1-6 in the publications database and accept
> that s= ome of these fields will be empty.
That is unnormalized data and will make queries more awkward.
> 2) create two tables:
> "publication" and "keyword". In this scenario I have = no limit on the
> amount of keywords that are used
You can control the number of keywords in the application and via
triggers in the database.
> and I don't have empty fie= lds.
What is the signifiance of empty fields? You can always determine
the number of keywords for a given publication with this:
select count(*)
from keywords, pubication
where keywords.publication_id = publication.id;
> However, many of the keywords repeat for different publications. In
> th= is situation I would have some repeating words in the columns.
There's nothing wrong with that
> I lean toward #2 but wanted to see if there was a preferred standard
> or ano= ther possibility that I am overlooking??
I would recommend #2.
--
Dan Langille : http://www.langille.org/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: dan@langille.org, jkanter@virginia.edu
Subject: Re: proper db standard
In-Reply-To: <3DF083B1.10740.B82095C@localhost>
References: <005a01c29d3e$8ad6c7a0$de138f80@virginia.edu> <3DF083B1.10740.B82095C@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox