Re: relation algebra query
From: Cimarron Taylor <cimarron+google_at_taylors.org>
Date: 22 Apr 2002 04:08:12 -0700
Message-ID: <29e28c51.0204220308.4202d943_at_posting.google.com>
Date: 22 Apr 2002 04:08:12 -0700
Message-ID: <29e28c51.0204220308.4202d943_at_posting.google.com>
Here's how I would do it with the following ascii notation:
projection: R [x, y...] selection: R [x = y] join: R [x = y] S division: R [x / y] S
we can get the names of subjects:
subject[sname]
the ids of all students:
student[sid]
the subjects and ids of students enrolled in in a given year
(enrolled[year=YEAR])[subid, sid]
the subjects and ids of all students in a given year
((enrolled[year=YEAR])[subid, sid]) [sid/sid] (student[sid])
the names of subjects with all students in a given year
(subject [subid=subid] ((enrolled[year=YEAR])[subid, sid])
[sid/sid] (student[sid]) )[sname]
Cim Received on Mon Apr 22 2002 - 13:08:12 CEST