Re: modelling question - Mailing list pgsql-general

From Jeff Davis
Subject Re: modelling question
Date
Msg-id 1261269415.5364.75.camel@jdavis
Whole thread Raw
In response to modelling question  (Garry Saddington <garry@schoolteachers.co.uk>)
List pgsql-general
On Sat, 2009-12-19 at 20:36 +0000, Garry Saddington wrote:
> Anyone have any ideas/suggestions on how to model siblings in a database
> so that it is possible to eg. only send letters to the parents once. In
> this scenario each sibling has the contact parents input separately
> (secretarial input!).

It's best to always iron out a specific organizational policy before
trying to model it as a database. Think carefully about a policy that
works with paper, and often that makes the database model obvious.

If there are already governmental policies regarding the notices, they
probably already tell you exactly when you can eliminate duplicate
notices.

How will you tell that the parents are the same? By name and address?
Just address? Siblings? What about half-siblings and other complicating
situations?

The query you want to use is pretty simple, and might go something like:
  SELECT DISTINCT address FROM student WHERE ...

But it all depends on what the policy actually is. And if the notice is
something simple, such as announcing a fund-raiser, then you should keep
it simple and just send one to each distinct address in the database.

Regards,
    Jeff Davis



pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: How to use read uncommitted transaction level and set update order
Next
From: "Gauthier, Dave"
Date:
Subject: Re: defining yuor own commands in PG ?