Re: teaching relational basics to people, questions

From: Mr. Scott <do_not_reply_at_noone.com>
Date: Tue, 15 Dec 2009 05:13:00 -0500
Message-ID: <brqdnfpT9daw_LrWnZ2dnUVZ_gWdnZ2d_at_giganews.com>


> <compdb_at_hotmail.com> wrote in message
> news:d84d3f25-b398-4c35-b97d-9155baaefab4_at_o9g2000prg.googlegroups.com...
> On Dec 4, 4:26 pm, com..._at_hotmail.com wrote:
> > So please start out with what the designer gives, then tell me clearly
> > how to form the proposition is that is "the information represented by
> > each row" that is syntactically valid, then what the proposition is
> > that is "the information content of a table".
>
> On Dec 11, 12:07 am, com..._at_hotmail.com wrote:
> > Thanks, but this is no clearer.
>
> Mr. Scott,
>
> I received an early xmas gift from my database designer: a relational
> dbms. Its database has relation variables vr{A,B,C,D} and vs{A,X} with
> respective predicates pr(A,B,C,D) and ps(A,X). Observing the world I
> can determine for a particular tuple whether a given predicate is true
> with corresponding attributes/parameters substituted. All attributes
> are of the same type.
>
> At some point when the database reflects the world:
>
> If pr(a,b,c,d) is true, what does this imply about the tuples in vr?

the fact that there is an (a,b,c,d) such that pr (a,b,c,d) is represented in the database as the tuple {A:a,B:b,C:c,D:d} in vr.

> If pr(a,b,c,d) is false, what does this imply about the tuples in vr?

the fact that there is not an (a,b,c,d) such that pr (a,b,c,d) is represented
in the database as the absence of the tuple {A:a,B:b,C:c,D:d} in vr.

> If a tuple <a,b,c,d> is in vr, what does this imply about the world,
> in terms of pr?

that there is an (a,b,c,d) such that pr (a,b,c,d).

> If a tuple <a,b,c,d> is not in vr, what does this imply about the
> world, in terms of pr?

that there is not an (a,b,c,d) such that pr (a,b,c,d).

> What does vr imply about the world?

that there can be an (A,B,C,D) such that pr (A,B,C,D)

> What does the database imply about the world?

that there can be an (A,B,C,D) such that pr (A,B,C,D) OR there can be an (A,X) such that ps (A,X)

(you didn't specify whether there is an inclusion dependency from vr[A] to vs[A], so the logical connective is OR).

>
> What query (relation expression) returns:
> The set of tuples <a,b,c,d> for which pr(a,b,c,d)?
> The set of tuples <b,c,d> for which there exists an A such that pr
> (A,b,c,d)?
> The set of tuples <a,b,c,d,x> for which pr(a,b,c,d) and ps(a,x)?
> The set of tuples <a,b,c,d> for which pr(a,b,c,d) and not ps
> (a',b',c',d')?

You are being inconsistent. Is <a,b,c,d> a tuple or a set of tuples?

>
> Each of the following queries returns a relation. For each query, what
> does the returned value imply about the world?
> vr

forall A forall B forall C forall D,

    which (A,B,C,D) are such that pr (A,B,C,D)?

> vr project all but {A}

This is really beyond the scope of a single newsgroup post, but,

assuming that A,B,C,D are free in pr,

pr (A,B,C,D) IFF (((pr A) B) C) D IFF (pr A) (B,C,D)

so vr project all but {A} is

forall A forall B forall C forall D,

    which (B,C,D) are such that (pr A) (B,C,D)?

> vr join vs

forall A forall B forall C forall D forall X,

    which (A,B,C,D,Z) are such that pr(A,B,C,D) and ps(A,X)?

> vr minus relation{A a',B b',C c',D d'}

forall A forall B forall C forall D,

    which (A,B,C,D) are such that pr (A,B,C,D)

        and not (A = a' and B = b' and C = c' and D = d')?

> Maybe you don't consider these to be appropriate questions. If so
> please give precise rules mapping between the world and the database
> state and between queries and predicates.
>
> philip
Received on Tue Dec 15 2009 - 11:13:00 CET

Original text of this message