Guest1
Guest1

Reputation: 9

Can an sql query ever return a different result than the relational algebra version?

Can an sql query ever return a different result than the relational algebra version?

Upvotes: 0

Views: 40

Answers (2)

Jared Beck
Jared Beck

Reputation: 17528

Yes. For example, phenomena caused by interactions between insufficiently isolated transactions: e.g. dirty read, nonrepeatable read, and/or phantom read.

See http://www.postgresql.org/docs/9.3/static/transaction-iso.html

Upvotes: 1

Barmar
Barmar

Reputation: 781583

Yes. In relational algebra, duplicates are removed. SQL can return duplicate rows, you have to use SELECT DISTINCT to force it to remove duplicates.

There are probably other cases, but this is the simplest example.

Upvotes: 1

Related Questions