Skip to main content

Difference

  • Reference work entry
  • First Online:
Encyclopedia of Database Systems
  • 5 Accesses

Synonyms

Set difference

Definition

The difference of two relation instances R1 and R2 over the same set of attributes U, denoted by R1 âˆ’ R2, is another relation instance over U containing precisely the set of tuples occurring in R1 and not occurring in R2.

Key Points

The difference is one of the primitive operators of the relational algebra. It coincides with the notion of set difference, with the additional restriction that it can be applied only to relations over the same set of attributes. However the difference of two arbitrary relations having the same arity can be obtained by first renaming attributes in one of the two relations.

As an example, consider a relation Students over attributes (number, name), containing tuples {(1001, Black), (1002, White)}, and a relation Employees over attributes (number, name), containing tuples {(1001, Black), (1003, Brown)}. Then the difference Students âˆ’ Employees is a relation over attributes (number, name) containing the only tuple (1002, White)....

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 4,499.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 6,499.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Cristina Sirangelo .

Editor information

Editors and Affiliations

Section Editor information

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Science+Business Media, LLC, part of Springer Nature

About this entry

Check for updates. Verify currency and authenticity via CrossMark

Cite this entry

Sirangelo, C. (2018). Difference. In: Liu, L., Özsu, M.T. (eds) Encyclopedia of Database Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-8265-9_1262

Download citation

Publish with us

Policies and ethics