Re: Does Codd's view of a relational database differ from that ofDate&Darwin?[M.Gittens]
Date: Tue, 21 Jun 2005 06:25:28 -0400
"Alexandr Savinov" <savinov_at_host.com> wrote in message
>>>>for each s in employee
>>>> print(getName(s), getAge(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