Re: Unknown SQL

From: Lee Fesperman <firstsql_at_ix.netcom.com>
Date: Wed, 30 May 2001 23:07:53 -0700
Message-ID: <3B15DFB9.1D0C_at_ix.netcom.com>


Roedy Green wrote:
>
> On Wed, 30 May 2001 18:02:37 GMT, Mikito Harakiri
> <nospam_at_newsranger.com> wrote or quoted :
>
> >find all employees who earn more
> >than their managers".
>
> Was this famous for ambiguity or for difficulty to compute?

In hierarchical data models (and some object dbms's), managers and employees are arranged in tree -- employees under managers. Employee entities can only be reached through their associated manager. In such a system, this query must be expressed an iteration through each manager and then processing each employee under the manager looking for 'over-acheivers'.

In a relational system, you can express it either way, including the more intuitive --- iterate through each employee and retrieve those who make more than their associated manager.

-- 
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
===================================================================
* Check out Database Debunkings (http://www.firstsql.com/dbdebunk/)
* "The Forum Where Database Matters Are Set Straight"
Received on Thu May 31 2001 - 08:07:53 CEST

Original text of this message