"Subclassing" in SQL

From: Andrew Perrin <aperrin(at)socrates(dot)berkeley(dot)edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: "Subclassing" in SQL
Date: 2001-02-02 19:47:14
Message-ID: Pine.LNX.4.21.0102021442430.17941-100000@nujoma.perrins
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I hope that title line is reasonably accurate. Here's what I'm trying to
do, and would love it anyone can provide guidance.

I have a table of utterances in a focus group setting; each record
contains an identifier for the speaker and group, as well as the length of
the utterance (in words) and then several boolean variables, each
representing whether a substantive concept is present in the utterance or
not. The trouble is that some of these concept variables (called
'codes') really are subsets of one another. For example, one code (called
`cd_interest') is a particular instance of another code (called
'cd_pragmatic'). My question is whether there is any way to represent
this relationship in SQL, without changing the underlying data. That is, I
don't want to simply do:

UPDATE statements SET cd_pragmatic = 't' WHERE cd_interest;

because it's theoretically possible for me to change this conceptual
relationship in the future. What I think I'm looking for is some sort of
a join that will cause postgres to consider cd_pragmatic as True whenever
cd_interest is true.

Any thoughts?

----------------------------------------------------------------------
Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology
Chapel Hill, North Carolina, USA - http://demog.berkeley.edu/~aperrin
aperrin(at)socrates(dot)berkeley(dot)edu - aperrin(at)igc(dot)apc(dot)org

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fork 2001-02-02 20:48:15 Re: const cast ?
Previous Message Albert REINER 2001-02-02 19:30:00 Re: Suggestion for psql: --file -