Skip to main content

Containment of Conjunctive Queries over Databases with Null Values

  • Conference paper
Database Theory – ICDT 2007 (ICDT 2007)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 4353))

Included in the following conference series:

Abstract

We study containment of conjunctive queries that are evaluated over databases that may contain tuples with null values. We assume the semantics of SQL for single block queries with a SELECT DISTINCT clause. This problem (“null containment” for short) is different from containment over databases without null values and sometimes more difficult.

We show that null-containment for boolean conjunctive queries is NP-complete while it is \(\mathit\Pi^{\rm P}_{2}\)-complete for queries with distinguished variables. However, if no relation symbol is allowed to appear more than twice, then null-containment is polynomial, as it is for databases without nulls. If we add a unary test predicate IS NULL, as it is available in SQL, then containment becomes \(\mathit\Pi^{\rm P}_{2}\)-hard for boolean queries, while it remains in \(\mathit\Pi^{\rm P}_{2}\) for arbitrary queries.

This work was supported by the British EPSRC (Grant GR/SS44830/01 MAGIK-I) and the Spanish Ministerio de Educacion y Ciencia (Grant TIN 2005-05406).

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Calvanese, D., Giacomo, G.D., Lenzerini, M., Vardi, M.Y.: Containment of conjunctive regular path queries with inverse. In: Proc. 7th KR, pp. 176–185 (2000)

    Google Scholar 

  2. Calvanese, D., Giacomo, G.D., Vardi, M.Y.: Decidable containment of recursive queries. In: Calvanese, D., Lenzerini, M., Motwani, R. (eds.) ICDT 2003. LNCS, vol. 2572, pp. 1–18. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  3. Chandra, A., Merlin, P.: Optimal implementation of conjunctive queries in relational databases. In: Proc. 9th STOC (1977)

    Google Scholar 

  4. Chaudhuri, S., Vardi, M.: Optimization of real conjunctive queries. In: Proc. 12th PODS (1993)

    Google Scholar 

  5. Cohen, S., Nutt, W., Sagiv, Y.: Containment of aggregate queries. In: Calvanese, D., Lenzerini, M., Motwani, R. (eds.) ICDT 2003. LNCS, vol. 2572, Springer, Heidelberg (2002)

    Google Scholar 

  6. Fernandez, M., Florescu, D., Levy, A., Suciu, D.: Verifying integrity constraints on web-sites. In: Proc. 16th IJCAI, pp. 614–619 (1999)

    Google Scholar 

  7. Garcia-Molina, H., Ullman, J., Widom, J.: Database Systems: The Complete Book. Pearson Education International, London (2002)

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  9. Kolaitis, P., Martin, D., Thakur, M.: On the complexity of the containment problem for conjunctive queries with built-in predicates. In: Proc. 17th PODS, pp. 197–204 (1998)

    Google Scholar 

  10. Levy, A., Mendelzon, A., Sagiv, Y., Srivastava, D.: Answering queries using views. In: Proc. 14th PODS, pp. 95–104 (1995)

    Google Scholar 

  11. Levy, A., Sagiv, Y.: Queries independent of updates. In: Proc. 19th VLDB, pp. 171–181 (1993)

    Google Scholar 

  12. Miklau, G., Suciu, D.: Containment and equivalence for an XPath fragment. In: Proc. 21st PODS, pp. 65–76 (2002)

    Google Scholar 

  13. Popa, L., Tannen, V.: An equational chase for path-conjunctive queries, constraints, and views. In: Beeri, C., Bruneman, P. (eds.) ICDT 1999. LNCS, vol. 1540, pp. 39–57. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  14. Sagiv, Y., Saraiya, Y.: Minimizing restricted-fanout queries. Discrete Applied Mathematics 40, 245–264 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  15. Sagiv, Y., Yannakakis, M.: Equivalence among relational expressions with the union and difference operators. J. ACM 27(4), 633–655 (1981)

    Article  MathSciNet  Google Scholar 

  16. Shmueli, O.: Equivalence of datalog programs is undecidable. Theoretical Computer Science 15(3), 231–242 (1993)

    MATH  MathSciNet  Google Scholar 

  17. Ullman, J.: Information integration using logical views. In: Afrati, F.N., Kolaitis, P.G. (eds.) ICDT 1997. LNCS, vol. 1186, pp. 19–40. Springer, Heidelberg (1996)

    Google Scholar 

  18. van der Meyden, R.: The complexity of querying indefinite data about linearly ordered domains. J. Computer and System Sciences 54(1), 113–135 (1997)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Farré, C., Nutt, W., Teniente, E., Urpí, T. (2006). Containment of Conjunctive Queries over Databases with Null Values. In: Schwentick, T., Suciu, D. (eds) Database Theory – ICDT 2007. ICDT 2007. Lecture Notes in Computer Science, vol 4353. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11965893_27

Download citation

  • DOI: https://doi.org/10.1007/11965893_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-69269-0

  • Online ISBN: 978-3-540-69270-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics