The Relational Model & Queries That Naturally Return Duplicate Rows

From: Seun Osewa <seun.osewa_at_gmail.com>
Date: Fri, 8 Oct 2010 06:44:34 -0700 (PDT)
Message-ID: <0d9300b0-88be-40f3-ae94-97d1beac56dd_at_j18g2000yqd.googlegroups.com>



Hi,

It's commonly understood that in the relational model:

  1. Every relational operation should yield a relation.
  2. Relations, being sets, cannot contain duplicate rows.

Imagine a 'USERS' relation that contains the following data.

ID FIRST_NAME LAST_NAME

 1 Mark       Stone
 2 Jane       Stone

 3 Michael Stone

If someone runs the query "select LAST_NAME from USERS", a typical database will return:

LAST_NAME
Stone
Stone
Stone

Since this is not a relation - because it contains duplicate rows - what should an ideal RDBMS return?

Regards. Received on Fri Oct 08 2010 - 08:44:34 CDT

Original text of this message