Skip to main content

Query Containment

  • Reference work entry
  • First Online:
  • 30 Accesses

Definition

One query is contained in another if, independent of the values of the “stored data” (that is, database), the set of answers to the first query on the database is a subset of the set of answers to the second query on the same database. A formal definition of containment is as follows: denote with Q(D) the result of computing query Q over database D. A query Q1 is said to be contained in a query Q2, denoted by Q1Q2, if for all databases D, the set of tuples Q1(D) is a subset of the set of tuples Q2(D), that is, Q1(D) ⊆ Q2(D). This definition of containment, as well as the related definition of query equivalence, can be used to specify query containment and equivalence on databases conforming to both relational and nonrelational data models, including XML and object-oriented databases.

Historical Background

Testing for query containment on finite databases is, in general, co-recursively enumerable: The procedure is going through all possible databases and simultaneously...

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

Buying options

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

Learn about institutional subscriptions

Recommended Reading

  1. Abiteboul S, Hull R, Vianu V. Foundations of databases. Reading: Addison-Wesley; 1995.

    MATH  Google Scholar 

  2. Afrati FN, Li C, Mitra P. Rewriting queries using views in the presence of arithmetic comparisons. Theor Comput Sci. 2006;368(1–2):88–123.

    Article  MathSciNet  MATH  Google Scholar 

  3. Chandra AK, Merlin PM. Optimal implementation of conjunctive queries in relational data bases. In: Proceedings of the 9th Annual ACM Symposium on Theory of Computing; 1977. p. 77–90.

    Google Scholar 

  4. Halevy AY. Answering queries using views: a survey. VLDB J. 2001;10(4):270–94,

    Article  MATH  Google Scholar 

  5. Jayram TS, Kolaitis PG, Vee E. The containment problem for REAL conjunctive queries with inequalities. In: Proceedings of the 25th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems; 2006. p. 80–89.

    Google Scholar 

  6. Kanellakis PC. Elements of relational database theory. In: Handbook of theoretical computer science. Volume B: formal models and sematics (B). New York/Cambridge: Elsevier/MIT Press; 1990. p. 1073–156.

    Google Scholar 

  7. Kimelfeld B, Sagiv Y. Revisiting redundancy and minimization in an XPath fragment. In: Advances in Database Technology, Proceedings of the 11th International Conference on Extending Database Technology; 2008. p. 61–72.

    Google Scholar 

  8. Klug AC. On conjunctive queries containing inequalities. J ACM. 1988;35(1):146–60.

    Article  MathSciNet  MATH  Google Scholar 

  9. Kolaitis PG, Vardi MY. Conjunctive-query containment and constraint satisfaction. J Comput Syst Sci. 2000;61(2):302–32.

    Article  MathSciNet  MATH  Google Scholar 

  10. Miklau G, Suciu D. Containment and equivalence for a fragment of XPath. J ACM. 2004;51(1):2–45.

    Article  MathSciNet  MATH  Google Scholar 

  11. Saraiya Y. Subtree elimination algorithms in deductive databases. Ph.D. thesis, Stanford University; 1991.

    Google Scholar 

  12. Ullman JD. CS345 lecture notes. http://infolab.stanford.edu/~ullman/cs345-notes.html.

  13. Ullman JD. Principles of database and knowledge-base systems, vol. II. Rockville: Computer Science Press; 1989.

    Google Scholar 

  14. Ullman JD. The database approach to knowledge representation. In: Proceedings of 13th National Conference on Artificial Intelligence and 8th Innovative Applications of AI Conference; 1996. p. 1346–48.

    Google Scholar 

  15. Ullman JD. Information integration using logical views. Theor Comput Sci. 2000;239(2):189–210.

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rada Chirkova .

Editor information

Editors and Affiliations

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

Chirkova, R. (2018). Query Containment. 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_1269

Download citation

Publish with us

Policies and ethics