Skip to main content

Query Containment

  • Reference work entry

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 Q 1 is said to be contained in a query Q 2, denoted by Q 1Q 2, if for all databases D, the set of tuples Q 1(D) is a subset of the set of tuples Q 2(D) – that is, Q 1(D) ⊆ Q 2(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...

This is a preview of subscription content, access via your institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-0-387-39940-9_1269
  • Chapter length: 5 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
eBook
USD   2,500.00
Price excludes VAT (USA)
  • ISBN: 978-0-387-39940-9
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout

Recommended Reading

  1. Abiteboul S., Hull R., and Vianu V. Foundations of Databases. Addison-Wesley, 1995.

    Google Scholar 

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

    MATH  MathSciNet  Google Scholar 

  3. Chandra A.K. and Merlin P.M. Optimal implementation of conjunctive queries in relational data bases. In Proc. 9th Annual ACM Symp. on Theory of Computing, 1977, pp. 77–90.

    Google Scholar 

  4. Halevy A.Y. Answering queries using views: A survey. VLDB J., 10(4):270–294, 2001.

    MATH  Google Scholar 

  5. Jayram T.S., Kolaitis P.G., and Vee E. The containment problem for REAL conjunctive queries with inequalities. In Proc. 25th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems, 2006, pp. 80–89.

    Google Scholar 

  6. Kanellakis P.C. Elements of Relational Database Theory. In Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics (B). Elsevier and the MIT Press, 1990, pp. 1073–1156.

    Google Scholar 

  7. Kimelfeld B. and Sagiv Y. Revisiting Redundancy and Minimization in an XPath Fragment. In Advances in Database Technology, Proc. 11th Int. Conf. on Extending Database Technology, 2008, pp. 61–72.

    Google Scholar 

  8. Klug A.C. On conjunctive queries containing inequalities. J. ACM, 35(1):146–160, 1988.

    MATH  MathSciNet  Google Scholar 

  9. Kolaitis P.G. and Vardi M.Y. Conjunctive-Query Containment and Constraint Satisfaction. J. Comput. Syst. Sci., 61(2):302–332, 2000.

    MATH  MathSciNet  Google Scholar 

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

    MathSciNet  Google Scholar 

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

    Google Scholar 

  12. Ullman J.D. CS345 lecture notes. http://infolab.stanford.edu/∼ullman/cs345-notes.html.

  13. Ullman J.D. Principles of Database and Knowledge-Base Systems, Volume II. Computer Science press, 1989.

    Google Scholar 

  14. Ullman J.D. The database approach to knowledge representation. In Proc. 13th National Conf. on Artificial Intelligence and 8th Innovative Applications of AI Conf., Volume 2, 1996, pp. 1346–1348.

    Google Scholar 

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

    MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2009 Springer Science+Business Media, LLC

About this entry

Cite this entry

Chirkova, R. (2009). Query Containment. In: LIU, L., ÖZSU, M.T. (eds) Encyclopedia of Database Systems. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-39940-9_1269

Download citation