Re: Logical equivalence of simple and complex types under the relational model?

From: Costin Cozianu <c_cozianu_at_hotmail.com>
Date: Tue, 30 Nov 2004 07:08:03 -0800
Message-ID: <313gnaF37921qU1_at_uni-berlin.de>


Rene de Visser wrote:
> "Costin Cozianu" <c_cozianu_at_hotmail.com> wrote in message
> news:311b0fF35fc3vU1_at_uni-berlin.de...
>

>>Rene de Visser wrote:
>>It makes big logical difference with regards to one very important
>>criteria: Economy of Expression.
>>
>>In other words why should you say
>>
>>-> select street1,street2, city, state,zip, country from users
>>
>>when you can simply say
>>
>>-> select address from country
>>
>>That's one of the reasons you have complex type in the first place in
>>common languages, otherwise languages without complex type are
>>computationally just as powerful. Anything that can be expressed using
>>complex type can be expressed with simple type by unfolding a large
>>number of variables.
>>

>
> While I get what your saying, your example does not show this because your
> two statements do completely different things.
>
> Under Model1 it should be
>
> select address_id from country
>
> and under model2 it should be
>
> select address from country
>
> They look pretty similar to me.
>
> i.e. your first select is also extracting the components/ related variables
> from the address, which your second select is not doing.
> They are not equivalent and so can not be compared.
>

No, the second select is doing just that. Consider that the complex type address contains embeddded as components street, city, zip., etc.

> A different example is when you want to have multi-dimensional versiong on
> about 100 relations. You want to use the same machinary to update and read
> all relations. However complex types don't help with this. Or not in any way
> I could find, as you have to take the other key fields and tuples into
> account.
>

Update users set address= :new_address where user_id= :v_user_id

Versus updating the components of an address one by one.

> Rene.
>
>

So again, you are spared the effort of manipulating several variables by grouping them into a complex type.

Costin Received on Tue Nov 30 2004 - 16:08:03 CET

Original text of this message