Constraints and Functional Dependencies
Markeren
Berichten 81 - 90 van 184 - Alles samenvouwen
/groups/adfetch?hl=nl&adid=gown_RAAAAB1pJYHGmPfMvMDWM4892ai
De groep waarnaar je een bericht verzendt, is een Usenet-groep. Berichten die je in deze groep verzendt, zijn zichtbaar voor iedereen op het Internet
Je antwoord is niet verzonden.
Uw bericht is geplaatst
 
Van:
Aan:
Cc:
Reactie op:
Cc toevoegen | Reactie toevoegen | Onderwerp bewerken
Onderwerp:
Validatie:
Typ ter verificatie de tekens uit de onderstaande afbeelding of de getallen die je hoort wanneer je klikt op het pictogram voor toegankelijkheid. Luister en typ de nummers die je hoort
 
81.  Bob Badour  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 25 feb 2007, 22:57
Nieuwsgroepen: comp.databases.theory
Van: Bob Badour <bbad...@pei.sympatico.ca>
Datum: Sun, 25 Feb 2007 21:57:13 GMT
Lokaal: zo 25 feb 2007 22:57
Onderwerp: Re: Constraints and Functional Dependencies

paul c wrote:
> Bob Badour wrote:

>> ...
>> Simply put, b != {b} because the type of b is different from the type
>> of {b}. Equating them would be the exact same error as equating {}
>> with {{}}.
>> ...

> That may be right and sensible, but ignoring questions of syntax, I'm
> not yet sure of that as I still don't understand much of type theory for
> example that of TTM.

It is not a question of syntax. The semantics of types demand inequality
for any two values with different most specific types. A set has a very
different type from what it contains just as a forest is different from
a tree or a flock is different from a goose.

   I do believe there are times when TTM allows

> equality comparisons between different types but I don't know if this is
> allowed only for subtypes/supertypes.

TTM always allows the comparisons. If the values have different most
specific types, the comparison simply evaluates to false.

> In any event, I didn't say any of this was important - it is just my
> little obsession to try to see singletons in a different light, even if
> that means upsetting the applecart that has been rolling along so well
> for so many years.

I suggest a more interesting question to ask is whether one should allow
implicit type conversions between a singleton set and its contents.
Another is whether one should allow implicit type conversions of any kind.

    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
82.  paul c  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 25 feb 2007, 23:39
Nieuwsgroepen: comp.databases.theory
Van: paul c <toledobythe...@oohay.ac>
Datum: Sun, 25 Feb 2007 22:39:44 GMT
Lokaal: zo 25 feb 2007 23:39
Onderwerp: Re: Constraints and Functional Dependencies

Bob Badour wrote:
> paul c wrote:

>> Bob Badour wrote:
> ...
> It is not a question of syntax.

(I made that syntax qualification only so it wouldn't read as if I was
denying your "{}" versus "{{}}" point.)

The semantics of types demand inequality

> for any two values with different most specific types. A set has a very
> different type from what it contains just as a forest is different from
> a tree or a flock is different from a goose.
> ...

No argument.  I just want to see what happens when all values in the
triples of tuples are sets of individuals and a relation is in a kind of
canonical form when those sets are all singletons.  (Not sure if that
would deny rva's.)

> ...
> I suggest a more interesting question to ask is whether one should allow
> implicit type conversions between a singleton set and its contents.
> Another is whether one should allow implicit type conversions of any kind.

Could be.  Maybe that's in fact what I'm talking about ... (if I'm
talking about anything!)

p


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
83.  Marshall  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 26 feb 2007, 09:16
Nieuwsgroepen: comp.databases.theory
Van: "Marshall" <marshall.spi...@gmail.com>
Datum: 26 Feb 2007 00:16:40 -0800
Lokaal: ma 26 feb 2007 09:16
Onderwerp: Re: Constraints and Functional Dependencies
On Feb 25, 1:57 pm, Bob Badour <bbad...@pei.sympatico.ca> wrote:

> I suggest a more interesting question to ask is whether one should allow
> implicit type conversions between a singleton set and its contents.
> Another is whether one should allow implicit type conversions of any kind.

Yeah, that's a good question.

I note that "Java Puzzlers" by Bloch and Gafter

http://www.amazon.com/Java-TM-Puzzlers-Pitfalls-Corner/dp/032133678X/

lists a fair number of "puzzlers" which are based on implicit type
conversions. It appears that many standard implicit conversions
are fraught with peril!

Although the question of singleton-set / contents is not one
that I have any experience with, and it strikes me as being
at least somewhat qualitatively different from, say, int to long
conversion. However I would be inclined to be cautious and
want a soundness proof before admitting that feature.

I actually think there might be another approach entirely,
one that is found when one turns the "relational closure"
dial to 11, as it were.

Marshall


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
84.  paul c  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 25 feb 2007, 21:54
Nieuwsgroepen: comp.databases.theory
Van: paul c <toledobythe...@oohay.ac>
Datum: Sun, 25 Feb 2007 20:54:12 GMT
Lokaal: zo 25 feb 2007 21:54
Onderwerp: Re: Constraints and Functional Dependencies

paul c wrote:
> ...
> Let me give a simplified small example relation that I hope will either
> show I don't understand TTM's GROUP or maybe show what I thought I meant:
> ...

Actually, I can probably give my own different example to show that I'm
probably not following TTM's intent for GROUP:

R
{a}
---
{1
  2}
  1

(I'm trying to show that R has two rows, not three as the picture might
suggest.)  If I UNGROUP {a}, I think I would like the result to contain
the same two rows, ie., it would be as if UNGROUP had no effect!

My reason for this will seem vague until I can put it better, but
basically I think R's meaning, whatever it is, is not the same if I give
a result of:

R
a
-
1
2

It seems to me that we already have projection for this kind of
existential qualification, so I don't see why UNGROUP should duplicate that.

(Another vague thought is that while I think an engine never knows the
human meaning of a relation, it must do its darndest to not disturb all
possible meanings.)

Also, I'm sure most will see all this as a distraction from Marshall's
topic and I wouldn't argue with that.

p


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
85.  Marshall  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 26 feb 2007, 09:07
Nieuwsgroepen: comp.databases.theory
Van: "Marshall" <marshall.spi...@gmail.com>
Datum: 26 Feb 2007 00:07:06 -0800
Lokaal: ma 26 feb 2007 09:07
Onderwerp: Re: Constraints and Functional Dependencies
On Feb 25, 9:56 am, paul c <toledobythe...@oohay.ac> wrote:

> Marshall wrote:
> > ...
> > Hmmm. Can we express keyness otherwise? I can't think how.
> > ...

> I've long imagined that Codd would have defined it (as you also did) via
> a cartesian product but some others like to use cardinality, eg., adding
> a "count" operation to their theory.  My guess is that they see this as
> something many implementations would want anyway.

I don't know why exactly but I have this vague aversion
to using aggregate operators in constraints. I think I'm doing
premature optimization, and should probably slap my own
wrist for it, but I can't shake the feeling that given two ways to
write a constraint, one using an aggregate, and one not, one
should use the form without the aggregate.

Of course, I can imagine how enforcing constraints with aggregates
could be trivially easy. And aggregates, especially count, being
as transparent as they are, I'm probably doubly in the wrong.

Now that you mention it, a constraint that said that the count of
a relation projected over the candidate key attributes equals
the count of the unprojected relation would enforce uniqueness;
that is, would also serve as a key constraint.

(Happily I managed to avoid the word "keyness" in this post.)

> I can't guess whether Codd would have also required a RENAME operator or
> whether he would have stuck with the math approach of numbering
> attributes for explanatory purposes.

The question of naming vs. positioning crops up various places
in computer science. I'm specifically thinking of Backus's 1977
Turing award paper, "Can Programming Be Liberated from the
Von Neumann Style?" which advocates for what is sometimes
called "point free style" or coding without names, a la APL.
I have to say I found the advocacy part of the paper totally
unconvincing. My current thinking is names are the better choice
about 97-98% of the time. The big advantage of point free style
is being able to write things like:

  avg = sum / count

instead of the supposedly-cumbersome:

  avg(x) = sum(x) / count()

Woo hoo!

Nonetheless there are some very few cases where inferring
or avoiding names entirely seems beneficial.

In fact, there is even some tiny support for this mentioned in TTM:

"If the <agg op name> is COUNT, <attribute ref> is irrelevant and
must be omitted; otherwise, it can be omitted if and only if the
<relation exp> denotes a relation of degree one, in which case
the sole attribute of the result of <relation exp> is assumed by
default."

(TTM, 2nd ed, page 71)

Which I take to mean you can invoke an aggregate directly
on a relation, and not on a specific attribute in the case
where either the relation has exactly one attribute or the
aggregate operator is COUNT, or both. If R is a relation
with one attribute, you can say "sum(R)" and it will infer
the attribute name and sum over it.

> Then there is projection, always
> lurking in the background, and we can't ignore it without breaking who
> knows what.

Projection more than anything else is what dissatisfies me about
the canonical relational algebra, and draws me to the Tropashko
algebra. I mean, those operators are supposed to be *algebraic*
and they don't even limit themselves to relation operands.

(And yes, Paul, I do owe you a longer post about that topic.)

> I sometimes wonder whether an alternative concept or two,
> such as a variation on D&D's GROUP/UNGROUP operators might allow
> definition of keys without rename or your prime operator.  By itself I
> doubt whether there would be any practical point to examining that
> unless some other useful questions could be handled as well, perhaps
> deciding when two relations that involve seemingly different rva's are
> equivalent but I don't have anything actually useful to say about that.

I would like to explore group/ungroup and rva issues in general in
more depth relatively soon. I don't really know the right questions
to get the ball rolling, though.

The problem that primes solve is a fundamental one, though.
There are other ways to solve it, but the problem itself derives
directly from the system having named attributes and needing
to refer to more than one instance of an attribute in a single
constraint. Once you have both of those, you cannot escape
needing to have multiple names for the same thing.

Marshall

PS. This was supposed to be a short post; what happened?!


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
86.  Bob Badour  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 26 feb 2007, 15:22
Nieuwsgroepen: comp.databases.theory
Van: Bob Badour <bbad...@pei.sympatico.ca>
Datum: Mon, 26 Feb 2007 14:22:39 GMT
Lokaal: ma 26 feb 2007 15:22
Onderwerp: Re: Constraints and Functional Dependencies

No, you are right to avoid avoidable aggregations. Elegance still counts
for something.

    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
87.  paul c  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 26 feb 2007, 15:31
Nieuwsgroepen: comp.databases.theory
Van: paul c <toledobythe...@oohay.ac>
Datum: Mon, 26 Feb 2007 14:31:45 GMT
Lokaal: ma 26 feb 2007 15:31
Onderwerp: Re: Constraints and Functional Dependencies
Marshall wrote:

...

> The problem that primes solve is a fundamental one, though.
> There are other ways to solve it, but the problem itself derives
> directly from the system having named attributes and needing
> to refer to more than one instance of an attribute in a single
> constraint. Once you have both of those, you cannot escape
> needing to have multiple names for the same thing.
> ...

Multiple names have always been hard for me to deal with, there could be
several reasons but I'd say for me the reasons are psychological which
makes them a practical problem in my case.  Apart from attributes, using
one name for several relations has been even harder, ie., mutable
variables.  Not sure, but the first time I saw prime notation might have
been in grade school when we were introduced to algebra.  I still want
to write programs that way.

p


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
88.  Cimode  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 25 feb 2007, 11:43
Nieuwsgroepen: comp.databases.theory
Van: "Cimode" <cim...@hotmail.com>
Datum: 25 Feb 2007 02:43:33 -0800
Lokaal: zo 25 feb 2007 11:43
Onderwerp: Re: Constraints and Functional Dependencies
On 24 fév, 20:22, mAsterdam <mAster...@vrijdag.org> wrote:
[Snipped]

> Obviously you did not yet read the responses to the OP when you wrote
> this. By now you may have. This is the same point paul c raises in his
> second reply to the OP, stated another way, right?

Maybe (not sure).  The primary key issue is not in fact as important
as the underlying domain concept beneath.   See the proposed alternate
formal definition for understanding better what I am getting at.

> One minor nitpick: The distinction between *primary* key and other
> keys is considered to be a practical choice for implementing DBMS's.
> As long as there is no established theoretical
> need for this distinction, we can just use these:
> key and candidate key (candidate key if there are more keys).

> Slightly more important: at this stage in the OP's
> argumentation the term (candidate) key has not yet been defined.

Indeed.  But there is an important domain prerequisite definition to
define of both pk and ck or choose to ignore them .

> Who cares about proofs these days ;-)

Honest people.

> A reductio ad absurdem, no less.

Indeed.  Effective to reveal conceptual dead ends.

> ... because P is not really key to S. QED.

Did anybody mention ck?

> > Second reason: the formalism R(a) *may* lead to the confusion between
> > relation variable and attribute...

Attribute based relational conceptual handling in computing quickly
reveals limitations when drawn into pure mathematics formal
demonstration.  I do not see how Codd could not have been aware of
this.  I extrapolate he had to make a choice to give a chance of
implementing relation into computing . (I thank him *even* for that
else the notion of domain would have never been put on our hand)

    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
89.  Walt  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 28 feb 2007, 16:45
Nieuwsgroepen: comp.databases.theory
Van: "Walt" <wami...@verizon.net>
Datum: Wed, 28 Feb 2007 15:45:05 GMT
Lokaal: wo 28 feb 2007 16:45
Onderwerp: Re: Constraints and Functional Dependencies

"mAsterdam" <mAster...@vrijdag.org> wrote in message

news:45e09029$0$327$e4fe514c@news.xs4all.nl...

Big fleas have little fleas, upon their backs to bit 'em,
And little fleas have lesser fleas, so on ad infinitum.

A nitpick on your nitpick:

The distinction between *primary* key and other candidate keys is considered
to be a practical choice for database design,  and is therefore supported in
some DBMS's.


    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.
90.  mAsterdam  
Profiel weergeven   Naar het vertalen Vertaald (origineel weergeven)
 Meer opties 24 feb 2007, 16:35
Nieuwsgroepen: comp.databases.theory
Van: mAsterdam <mAster...@vrijdag.org>
Datum: Sat, 24 Feb 2007 16:35:33 +0100
Lokaal: za 24 feb 2007 16:35
Onderwerp: Re: Constraints and Functional Dependencies
Hi Marshall,

[snip intro]

> With such a system, a relation R with attribute a (which I will
> write as R(a)) having a as a foreign key into S(b) is expressed
> as follows:

>   forall R(a): exists S(b): a = b

Just to be sure notationally: the first colon reads
' it is true that ', the second ' such that it is true that ', right?

> So we can express foreign keys this way.

> In the context of relations with named attributes, it is not necessary
> to declare or make up logic variable names, the way we have to when we
> are using sets of ordered pairs. We can use the existing attribute
> names as the names of the logic variables. However that raises the
> question of what happens when we want to quantify over an attribute
> more than once in a given formula. In that case let a primed attribute
> name be considered a second instance of a logic variable quantified
> over the attribute.
> So if we want to say that for every row of R
> with attribute a there exists a row of R with an unequal value
> for attribute a, we can say:

>   forall R(a): exists R(a'): a != a'

This looks like setting up a (unintended) trap of mixing attributes
and attribute values.
Why not prime the first instance^W^W^W all instances?

     forall R(a): exists R(a'), exists R(a''): a' != a''
?
(saying that R has at least two rows with different
values for a, just like above.)

> The way quantification is usually expressed we can only introduce
> one quantified variable at a time, however it makes sense to relax
> this syntactic restriction when dealing with relations with
> named attributes. We can introduce quantified variables matching
> many attributes at once. However we have to be aware that when
> we do so, they are all quantified the same way, and they are
> all considered to come from the same row.

> What about candidate keys? Suppose we have a relation R with

... only the ...

> *sets* of attributes A and B:  R{A, B}. Again, A is a set of
> attributes, possibly just one or even none; likewise B. Then
> if we can express the functional dependency:

>    A -> B

> that is the same as expressing that A is a candidate key.

(if R has no attributes outside A u B)

So, let's have a notational shorthand: A' is an instance of A.

A = {a1, ... an}
A' = {a1', ... an'}

So it becomes:

    R{A, B}
    A = {a1, ... an}
    B = {b1, ... bn}

    A -> B =def=
      forall ( R(A', B'), R(A'', B'') ):
      (A'=A'') => (B' = B'')

would become
    A -> B =
      forall R(A'),
        forall R(A''):
          A'=A'' => ()

Nice!

Very nice :-)

    Doorsturen  
Je moet je aanmelden voordat je berichten kunt plaatsen.
Als je een bericht wilt verzenden, moet je eerst deelnemen aan deze discussiegroep.
Werk je bijnaam bij op de pagina met abonnementsinstellingen voordat je een bericht plaatst.
Je hebt geen toestemming om berichten te plaatsen.

Discussiegroep maken - Google Discussiegroepen - Google Startpagina - Servicevoorwaarden - Privacybeleid
©2010 Google