Re: Curious SQL question

From: Marshall <marshall.spight_at_gmail.com>
Date: 5 Jan 2007 12:26:39 -0800
Message-ID: <1168028799.309279.91170_at_42g2000cwt.googlegroups.com>


On Jan 5, 10:19 am, "Neo" <neo55..._at_hotmail.com> wrote:
> Assuming the following:
>
> set A = {shampoo, soap, bread, wine}
> set B = {shampoo, soap, bread}
> set C = {wine}
>
> What is the most appropriate name of the function that does the
> following:
>
> C = f (A, B);
>
> Is it NAND, NOT INTERSECTION, NOT IN? And should the order of the
> inputs (A, B) matter?

You haven't uniquely specified a function. You've shown only one element of the relation. Consider this operation:

  0 op 0 = 0

What is op? Is it addition or multiplication? Or something else?

Both set difference and symmetric difference (among many) meet your criteria. Whether the order of the operands matters depends on whether the function is commutative or not. Set difference is not commutative; symmetric difference is.

Marshall Received on Fri Jan 05 2007 - 21:26:39 CET

Original text of this message