relational algrabra division?
Date: Thu, 11 Dec 2014 13:04:27 -0500
Message-ID: <m6cmb4$3la$1_at_reader1.panix.com>
Does anyone understand this. The way this is written it is not comprehendable. The text doesn't flow logically and the example, which in theory is supposed to explain what the text does not, does not explain it either, which leaves this as "magic logic" -
"And Blood of a Nwet and Poof, you get the desired chicken!"
<<6.3.4 The DIVISION Operation
The DIVISION operation, denoted by ÷, is useful for a special kind of
query that
sometimes occurs in database applications.>>
<< An example is Retrieve the names of employees who work on all the
projects that ‘John Smith’ works on. >>
What class of query is this called and how is it generlized mathmatically.
<<To express this query using the DIVISION operation, proceed as follows.>>
OK - we will learn by exmple since we have no definitions
<<First, retrieve the list of project numbers that ‘John Smith’ works on
in the intermediate relation
SMITH_PNOS:>>
OK
<<SMITH ← σFname=‘John’ AND Lname=‘Smith’(EMPLOYEE)
SMITH_PNOS ← πPno(WORKS_ONEssn=SsnSMITH)>>
OK - that makes sense
<< Next, create a relation that includes a tuple <Pno, Essn> whenever
the employee
whose Ssn is Essn works on the project whose number is Pno in the
intermediate
relation SSN_PNOS:>>
That is a lot of words that make NO SENSE. This sentence doesn't parse English Gammar in a way that is meaningful, which is interesting since this is a chapter on Relational Algrabra for which Grammar is a specific subset and application of.
In other words, I don't think the auther knows what he wrote here and his editor didn't know enough to fix it or clarify it. But we have an example:
<<SSN_PNOS ← πEssn, Pno(WORKS_ON)>>
Fine this MEANS project all the tuples in WORKS_ON by restricting them to the attributes of Essn and Pno and assign it to a relationship we call SSN_PNOS
<<Finally, apply the DIVISION operation to the two relations, which
gives the desired employees’ Social Security numbers:>>
PRESTO!!! Use this magic symbol and get your desired result!
<<SSNS(Ssn) ← SSN_PNOS ÷ SMITH_PNOS>>
I have no idea what this does and it hasn't been explained.
<<RESULT ← πFname, Lname(SSNS * EMPLOYEE)>>
And this says take a natural join of SSNS and EMPLOYEE and project just the names.
Now dissect the example more closely. Maybe "Presto" will show itself and a logical contruction.
SSN_PNOS Essn Pno
123456789 1
123456789 2
666884444 3
453453453 1
453453453 2
333445555 2
333445555 3
333445555 10
333445555 20
999887777 30
999887777 10
987987987 10
987987987 30
987654321 30
987654321 20
888665555 20
SMITH_PNOS
Pno
1
2
SSNS
Ssn
123456789
453453453
Magic Results, no explanation. This is the kind of soft material that litters this class everywhere. I don't understand it Received on Thu Dec 11 2014 - 19:04:27 CET