MESSAGE
DATE | 2014-12-17 |
FROM | Ruben Safir
|
SUBJECT | Subject: [LIU Comp Sci] why is this textbook just off the look
|
From owner-learn-outgoing-at-mrbrklyn.com Wed Dec 17 16:46:40 2014 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix) id BFFBB161161; Wed, 17 Dec 2014 16:46:40 -0500 (EST) Delivered-To: learn-outgoing-at-mrbrklyn.com Received: by mrbrklyn.com (Postfix, from userid 28) id A6501161165; Wed, 17 Dec 2014 16:46:40 -0500 (EST) Delivered-To: learn-at-nylxs.com Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by mrbrklyn.com (Postfix) with ESMTP id D8F52161161 for ; Wed, 17 Dec 2014 16:46:39 -0500 (EST) Received: from [10.0.0.42] (unknown [96.57.23.82]) by mailbackend.panix.com (Postfix) with ESMTPSA id D06B413902; Wed, 17 Dec 2014 16:46:38 -0500 (EST) Message-ID: <5491F9D6.1020108-at-panix.com> Date: Wed, 17 Dec 2014 16:47:02 -0500 From: Ruben Safir User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: learn-at-nylxs.com, Ping-Tsai Chung Subject: [LIU Comp Sci] why is this textbook just off the look Content-Type: multipart/alternative; boundary="------------030303030901020108070401" Sender: owner-learn-at-mrbrklyn.com Precedence: bulk Reply-To: learn-at-mrbrklyn.com
This is a multi-part message in MIME format. --------------030303030901020108070401 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit
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 EMPLOYEE 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
Division:
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 MEANINING
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)
DONE
If I am wrong, correct me or let me know how you would do this
--------------030303030901020108070401 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
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 EMPLOYEE
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
Division:
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 MEANINING
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)
DONE
If I am wrong, correct me or let me know how you would do this
--------------030303030901020108070401--
|
|