Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: How to represent category, subcategory, product

Re: How to represent category, subcategory, product

From: Neo <neo55592_at_hotmail.com>
Date: 23 Nov 2006 07:55:19 -0800
Message-ID: <1164297318.992755.185930@k70g2000cwa.googlegroups.com>

> The classic scenario calls for a root class with all the common
> attributes and then specialized sub-classes under it.  As an example,
> let's take the class of Vehicles and find an industry standard
> identifier (VIN), and add two mutually exclusive sub-classes, Sport
> utility vehicles and sedans ('SUV', 'SED').

Below is an alternative solution using dbd where a vehicle can have 0 to many classifications. Disadv: subClasses need to be derived. Adv: flexibility to classify things as desired.

(new 'vin)

(new 'vehicle0)
(set vehicle0 vin (val+ '@1234))

(new 'vehicle1 'car '1-door)
(set vehicle1 vin (val+ '45?67))

(new 'vehicle2 'car 'suv)
(set vehicle2 vin (val+ 'JFH#3638))

(new 'vehicle3 'car 'sedan '5-door)
(set vehicle3 vin (val+ '8-9-A0))

(new 'vehicle4 'car 'suv 'sedan)
(set vehicle4 vin (val+ '3G$67))

(new 'vehicle5 'car 'boat 'suv 'sedan)
(set vehicle5 vin (val+ 'NH&74H6))

(new 'vehicle6 'boat 'airplane 'suv 'sedan 'rv '9-door)
(set vehicle6 vin (val+ 'N5*J4H6))

(new 'vehicle7 'car 'economy 'beetle 'bug)
(set vehicle7 vin (val+ 'VW=578))

(; Find suvs)
(; Returns vehicle2, vehicle4, vehicle5, vehicle6)
(get suv instance *)
Received on Thu Nov 23 2006 - 09:55:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US