|FROM ||Ruben Safir
|SUBJECT ||Subject: [LIU Comp Sci] HW 6
|From owner-learn-outgoing-at-mrbrklyn.com Wed Dec 10 23:58:51 2014
Received: by mrbrklyn.com (Postfix)
id AAEB3161162; Wed, 10 Dec 2014 23:58:51 -0500 (EST)
Received: by mrbrklyn.com (Postfix, from userid 28)
id 73230161166; Wed, 10 Dec 2014 23:58:51 -0500 (EST)
Received: from mailbackend.panix.com (mailbackend.panix.com [184.108.40.206])
by mrbrklyn.com (Postfix) with ESMTP id D1ED9161162
for ; Wed, 10 Dec 2014 23:58:49 -0500 (EST)
Received: from [10.0.0.42] (unknown [220.127.116.11])
by mailbackend.panix.com (Postfix) with ESMTPSA id 7351A13CA8;
Wed, 10 Dec 2014 23:58:48 -0500 (EST)
Date: Wed, 10 Dec 2014 23:58:55 -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 ,
"pingtsaichung-at-gmail.com >> Ping-Tsai Chung"
Subject: [LIU Comp Sci] HW 6
Content-Type: text/plain; charset=utf-8
With regard to Problem 1E in the homework
What is this? This can't be right. I don't know what is right, but
this aint it.
In order to do this as division the divisor has to be a SUBSET of of the
(e) Retrieve the names of employees who
work on every project.
PROJ_EMPS(PNO,SSN) ? ? PNO,ESSN (WORKS_ON)
ALL_PROJS(PNO) ? ?PNUMBER (PROJECT)
EMPS_ALL_PROJS ? PROJ_EMPS ÷ ALLPROJS
RESULT ? ? FNAME,MINIT,LNAME (EMPLOYEE
No Data Found.
To quote the text, and this is honestly a weird operation
Produces a relation R(X) that includes all tuples t[X]
in R1(Z) that appear in R1 in combination with every
tuple from R2(Y), where Z = X ? Y.
That means Y MUST BE a SUBSET of Z...
We are trying to find the one the single individal who is all in ALL the
project, and all the other individual lke him.
I have no idea how to solve this.
In general set theory terms,
Inviduals who's Set of pno is equal to the set of pnumbers in the
You can get the sets?
? pno (sigma essn = SSN (works_on))
where each SSn is in the set of
? ssn (employee)
where the set of pno is complete.
Don't ask me how to express this. I have no idea and don't see it in
the books or on line.
FRANKLY, this problem is not done with relational agrebra. This is
where you DITCH SQL and use a peal loop. I don't know of any way of
doing conditional looping in set theory.
You might be able to compare to sets, but that is not covered in the
In sql I would use count
select employee.ssn from employee, works_on
where employee.ssn = works_on.essn
having count( works_on.essn) == subquery(
select count (pnumber) from works_on )
That might not be legl either. I don't think you can put a count in a
having without a group by claus?
Anyway - I am Ccing Dr Ping on this. Maybe he can shed light on this