Re: Curious SQL question

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Thu, 04 Jan 2007 16:25:16 GMT
Message-ID: <MT9nh.40480$cz.596667_at_ursa-nb00s0.nbnet.nb.ca>


kvnkrkptrck_at_gmail.com wrote:

> -CELKO- wrote:
>

>>Please post DDL, so that people do not have to guess what the keys,
>>constraints, Declarative Referential Integrity, data types, etc. in
>>your schema are.  Even for the small things, it is just good manners --
>>look at all the assumptions we have to make
>>

[Joe's irrelevant fantasies snipped]

>>

Could someone clue Joe into the fact that this newsgroup is comp.databases.theory and not comp.databases.syntax.sql ?

(Speaking of highly detailed design recommendations on the basis of no information whatsoever... cuckoo... ::rolls eyes:: )

> I disagree. Perhaps his is a data-mining database which does not
> contain any personal identifying information. In such a case, it would
> be quite sensible that from the perspective of the OP's database,
> CUSTOMER_ID is merely an attribute of an ORDER, not an identifier of a
> customer entity.

Indeed. Or the original poster might have changed the names to protect the guilty (and comply with an NDA.) The real question might have nothing to do with customers and orders per se.

In many respects, it would help Guto if he thought about this problem entirely in the abstract without reference to 'real-world' entities.

His relations could just as easily have been:

R1 = { {Y: ydom, N: ndom} }

R2 = { {X: xdom, Y: ydom} }

How could he identify for each X in R2 all the Y's in R1 not associated with X in R2 ?

> As has been pointed out already, the problem is still easily resolved
> by projecting customer_id and crssing that against products.

Indeed.

[more irrelevant fantasies snipped] Received on Thu Jan 04 2007 - 17:25:16 CET

Original text of this message