Re: Schema design question - Mailing list pgsql-general

From Sebastian Hennebrueder
Subject Re: Schema design question
Date
Msg-id 4303A313.5040602@laliluna.de
Whole thread Raw
In response to Schema design question  (Bill Moseley <moseley@hank.org>)
List pgsql-general
Bill Moseley schrieb:

>On Wed, Aug 17, 2005 at 10:05:39PM +0200, Sebastian Hennebrueder wrote:
>
>
>>> Con: Column duplication in the two tables -- two tables look a lot alike
>>>      Need to have duplicate link tables (one pointing to each table)
>>>
>>>
>>>
>>>
>>They are not duplicated. As you say later in your explanation the course
>>settings may change. So the data may be the same right at the beginning
>>but can differ by the time. => It is not the same data!!
>>
>>
>
>I meant that I would have two tables that look like they hold very
>similar data.  That's not really a problem -- just bugs me to see
>duplication.  Plus, it could introduce errors if I ever modified, say,
>a columns type in one table and not the matching column in the other
>table.
>
>Any opinions on which table layout you would use?
>
>Thanks,
>
>
>
It is still not the same data. When my name is Sebastian Hennebrueder
and your name is Sebastian Hennebrueder, than we are not the same person.
Class and Course is not the same, they only have accidentally the same
data right at the beginning.
And as they have a reference to each other you should put them in two
separate tables, so that you can create a foreign key relation to
enforce the relation.

I do not now a good online tutorial for database normalisation but just
try Google or ask here.

--
Best Regards / Viele Grüße

Sebastian Hennebrueder

----

http://www.laliluna.de

Tutorials for JSP, JavaServer Faces, Struts, Hibernate and EJB

Get support, education and consulting for these technologies - uncomplicated and cheap.


pgsql-general by date:

Previous
From: Matt Miller
Date:
Subject: Re: Schema design question
Next
From: Tom Lane
Date:
Subject: Re: COMMIT in ps output