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: Eliminating Nulls

Re: Eliminating Nulls

From: Neo <neo55592_at_hotmail.com>
Date: 1 Jul 2005 08:55:56 -0700
Message-ID: <1120233356.746791.196010@f14g2000cwb.googlegroups.com>


> ... ideal way to do this to move the optional attribute into it's own table?

In general, yes. And how many tables would one need to handle all the possible cases (not that it is likely)? Below xrdb script shows some of the possible cases. Note, there are no NULLs.

// Create various types.
// Note: "it" refers to last thing create by "*".

(CREATE type inst *useCase  & dir item it)
(CREATE type inst *number)
(CREATE type inst *goal)

// Create useCase1, #1000, goal1.
(CREATE useCase inst *

& it name +useCase1
& it number +1000
& it goal +"goal 1")

// Create useCase2, #2000.
(CREATE useCase inst *

& it name +useCase2
& it number +2000)

// Create useCase3.
(CREATE useCase inst *

& it name +useCase3)

// Create an unnamed useCase, #4000.
(CREATE useCase inst *

& it number +4000)

// Create an unnamed useCase, goal5.
(CREATE useCase inst *

& it goal +"goal 5")

// Create useCase6, #6000, #sixThousand, goals6.0, etc. (CREATE useCase inst *

& it name +useCase6
& it name +useCaseSix
& it name +useCaseVI
& it number +6000
& it number +"six thousand"
& it goal +"goal 6.0"
& it goal +"goal 6.1"
& it goal +"cgoal 6.2")

// Create useCase7, goal1.
(CREATE useCase inst *

& it name +useCase7
& it goal +"goal 1")

// Find all useCases with goals.
// Returns useCases 1, 5, 6, 7.
(SELECT useCase inst * & * goal)

// Find all useCases with goal 1.
// Returns useCase1 and 7.
(SELECT * goal "goal 1") Received on Fri Jul 01 2005 - 10:55:56 CDT

Original text of this message

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