|FROM ||Ruben Safir
|SUBJECT ||Re: [LIU Comp Sci] why is this textbook just off the look
|From owner-learn-outgoing-at-mrbrklyn.com Wed Dec 17 16:53:23 2014
Received: by mrbrklyn.com (Postfix)
id 39B81161161; Wed, 17 Dec 2014 16:53:23 -0500 (EST)
Received: by mrbrklyn.com (Postfix, from userid 28)
id 22CDC161165; Wed, 17 Dec 2014 16:53:23 -0500 (EST)
Received: from mailbackend.panix.com (mailbackend.panix.com [184.108.40.206])
by mrbrklyn.com (Postfix) with ESMTP id 58DE0161161
for ; Wed, 17 Dec 2014 16:53:22 -0500 (EST)
Received: from [10.0.0.42] (unknown [220.127.116.11])
by mailbackend.panix.com (Postfix) with ESMTPSA id 3E21C131C4;
Wed, 17 Dec 2014 16:53:22 -0500 (EST)
Date: Wed, 17 Dec 2014 16:53:45 -0500
From: Ruben Safir
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
To: learn-at-nylxs.com, Ping-Tsai Chung
Subject: Re: [LIU Comp Sci] why is this textbook just off the look
Content-Type: text/plain; charset=utf-8
On 12/17/2014 04:47 PM, Ruben Safir wrote:
> I'm sorry
> I'm so burned out with text, slides and books that aren't well written .
> Someone tell me why this is not just wrong
> Query 3. Find the names of employees who work on all the projects controlled
> by department number 5.
> DEPT5_PROJS ? ?(Pno)(?Pnumber(?Dnum=5(PROJECT)))
> EMP_PROJ ? ?(Ssn, Pno)(?Essn, Pno(WORKS_ON))
> RESULT_EMP_SSNS ? EMP_PROJ ÷ DEPT5_PROJS <<==============WRONG
> RESULT ? ?Lname, Fname(RESULT_EMP_SSNS * EMPLOYEE)
> In this query, we first create a table DEPT5_PROJS that contains the
> project numbers
> of all projects controlled by department 5. Then we create a table
> EMP_PROJ that
> holds (Ssn, Pno) tuples, and apply the division operation. Notice that
> we renamed
> the attributes so that they will be correctly used in the division
> operation. Finally, we
> join the result of the division, which holds only Ssn values, with the
> table to retrieve the desired attributes from EMPLOYEE.
> The entire aproach is stupid
> DEPT5_PROJS is the Project Numbers! FINE
> EMP_PROJ all the tuples of SSN and Pno that works on any Project... FINE
> RESULT_EMP_SSNS ? EMP_PROJ ÷ DEPT5_PROJS
> the book says
> Then we create a table EMP_PROJ that
> holds (Ssn, Pno) tuples, and apply the division operation.
> It fails to say what the result of this is
> In general, the DIVISION operation is applied to two relations R(Z) ÷
> S(X), where
> the attributes of R are a subset of the attributes of S; that is, X ? Z.
> Let Y be the set
> of attributes of R that are not attributes of S; that is, Y = Z – X (and
> hence Z = X ?
> Y ). The result of DIVISION is a relation T(Y) that includes a tuple t
> if tuples tR appear
> in R with tR [Y] = t, and with tR [X] = tS for every tuple tS in S. This
> means that, for
> a tuple t to appear in the result T of the DIVISION, the values in t
> must appear in R in
> combination with every tuple in S.
> Meanwhile, as useless as that is.... and it is USELESS and it is has no
> division is not even NEEDED for this query.
> DEPT5_PROJS ? ?Dnum=5(PROJECT)
> ALL_WHO_WORK_ON_PRJECT5 <- DEPT5_PROJS |x| Pno = PNumber WORKS_ON
> It is a Straight and Simple Join
> RESULT ? ?Lname, Fname(ALL_WHO_WORK_ON_PRJECT5 |x| essn = ssn EMPLOYEE)
> If I am wrong, correct me or let me know how you would do this
This seems to be a good look at relational aglebra division...