pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Jamie Tufnell <diesql@googlemail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Having difficulty writing a "best-fit" query..
Date: Tue, 16 Oct 2007 10:14:59 -0700 (PDT)
Message-ID: <354400.92381.qm@web31810.mail.mud.yahoo.com> (raw)
In-Reply-To: <b0a4f3350710160946y4a31a227sbffbf085cdbfa487@mail.gmail.com>

--- Jamie Tufnell <diesql@googlemail.com> wrote:
> movie_id, genre_id, relevance (i've used movie/genre titles for clarity
> here, but in reality they're id's)
> --------------------------------------------
> beverly hills cop, action, 2
> beverly hills cop, comedy, 1
> the heartbreak kid, comedy, 2
> the heartbreak kid, romance, 1
> First of all, if there's a better way to model this kind of ranking/ordering
> of many-to-many relationships, please let me know.

Joe Celko had an example like this in his book:

17: EMPLOYMENT AGENCY PUZZLE 
http://www.elsevier.com/wps/find/bookdescription.cws_home/710075/description#description

the only difference was that he was modeling employees and skillsets.  IIRC, the terminology for
the improved model was the "full disjuctive" model.
Regards,
Richard Broersma Jr.




view thread (5+ messages)  latest in thread

Message-ID: <354400.92381.qm@web31810.mail.mud.yahoo.com>
Permalink:  ../354400.92381.qm@web31810.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/354400.92381.qm@web31810.mail.mud.yahoo.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com, diesql@googlemail.com
  Subject: Re: Having difficulty writing a "best-fit" query..
  In-Reply-To: <354400.92381.qm@web31810.mail.mud.yahoo.com>

* 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