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

From: Alexandr Savinov <savinov_at_host.com>
Date: Tue, 21 Jun 2005 11:39:37 +0200
Message-ID: <42b7e05e$1_at_news.fhg.de>


Alfredo Novoa schrieb:

>>>for each s in employee
>>>    print(getName(s), getAge(s),
>>>getName(getBuilding(getDepartment(s))))
>>
>>What's imperative about this?

>
>
> Everything!

This example is equivalent to

select s.name, s.age, s.department.building.name from employee s

>>Where are the assignments?

>
>
> s in employee

The same as in SELECT in SQL

>>Where are the 
>>while loops?

>
>
> for each

With the same success SELECT in SQL can be considered a loop statement.

Such simple example do not have differences in many data model. Writing

foreach(o:O) {

   return(o.property);
}

is the same as writing

SELECT o.property FROM O o

Equivalents exist in most other languages.

Differences appear and are visible only with more complex queries when we add the following features:

- multiple source collections,
- constraints
- access paths
- grouping and aggregation
- ...

-- 
http://conceptoriented.com
Received on Tue Jun 21 2005 - 11:39:37 CEST

Original text of this message