Re: Does Codd's view of a relational database differ from that ofDate&Darwin?[M.Gittens]

From: VC <boston103_at_hotmail.com>
Date: Tue, 21 Jun 2005 06:25:28 -0400
Message-ID: <O9SdnRO7lIhldyrfRVn-sw_at_comcast.com>


Hi,

"Alexandr Savinov" <savinov_at_host.com> wrote in message news:42b7e05e$1_at_news.fhg.de...
[...]

>>>>for each s in employee
>>>> print(getName(s), getAge(s),
>>>>getName(getBuilding(getDepartment(s))))
>>>
[...]

> This example is equivalent to
>
> select s.name, s.age, s.department.building.name from employee s

[...]

Well, no. Whilst the SQL above can be interpeted as a relational algebra expression : X = SELECT EMPLOYEE; Y=PROJECT(X, name, age, building), and thus looked upon in an imperative way, there exists an equivalent relational calculus expression which is purely declarative and more natural for those accustomed to reasoning in terms of sets:

(employee.name, employee.age, employee.department):true; -- we did not specify any predicate so the condition is true.

Now, one might have looked upon 'for each s in employee' in the Dalog fragment as a predicate describing the entire set of employees (similar to the RC formula), but the 'print' word kills any attempt at such interpretation admitting only imperative/navigational reading with 'for each' being just a loop.

vc Received on Tue Jun 21 2005 - 12:25:28 CEST

Original text of this message