Re: [GENERAL] How to express categorized items in relational tables

From: Doo Suk Yang <microbe(at)mail(dot)lgchem(dot)co(dot)kr>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] How to express categorized items in relational tables
Date: 1999-05-14 02:41:09
Message-ID: Pine.LNX.4.05.9905141134400.770-100000@maldives.rnd.lgchem.co.kr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 13 May 1999, Chris Bitmead wrote:

> Doo Suk Yang wrote:
> >
> > I'm novice in database world.
> > Now I have to make design a database where categorized items should be
> > stored. It resembles the structure something like seen in Yahoo.
> >
> > Thanks for reading and generous comments of yours.
>
> I do it something like this..
> create table category (title text, category oid);
> so that categories have parent categories. If the category attribute is
> null then it's a parent category. For urllinks (like in yahoo) I have
> create table urllink (title text, url text, category oid);
>
Thank you for your answer. It is going to be working.

BTW, when inserting a parents category I had to go through two steps;
selecting category of parents and inserting new title and selected
category. Of course I'm using Perl and the above two steps are not great
matter. But still I'm curious is it possible to write an SQL statement to
do it.

===============================================================================
Science is the game we play with God to find out what his rules are.
-------------------------------------------------------------------------------
Doo Suk Yang
Research Scientist Voice: 82-42-866-2222
LG Chemical Ltd. Research Park
Biotech Research Institute I FAX: 82-42-861-2566
-------------------------------------------------------------------------------
A fool hath no delight in understanding, but that his heart may discover itself.
(Proverbs 18:2)
===============================================================================

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Bitmead 1999-05-14 05:08:56 Re: [GENERAL] How to express categorized items in relational tables
Previous Message Tom Lane 1999-05-14 01:16:14 Re: backend dies suddenly after a lot of error messages