Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 031C3476778 for ; Fri, 6 Dec 2002 11:04:09 -0500 (EST) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by postgresql.org (Postfix) with ESMTP id 59842475E7B for ; Fri, 6 Dec 2002 11:02:05 -0500 (EST) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id A9AE43F4E; Fri, 6 Dec 2002 11:02:09 -0500 (EST) From: "Dan Langille" To: Jodi Kanter Date: Fri, 06 Dec 2002 11:02:09 -0500 MIME-Version: 1.0 Subject: Re: proper db standard Cc: Postgres Admin List Message-ID: <3DF083B1.10740.B82095C@localhost> In-reply-to: <005a01c29d3e$8ad6c7a0$de138f80@virginia.edu> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/75 X-Sequence-Number: 6570 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/