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).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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)
Chandra, A., Merlin, P.: Optimal implementation of conjunctive queries in relational databases. In: Proc. 9th STOC (1977)
Chaudhuri, S., Vardi, M.: Optimization of real conjunctive queries. In: Proc. 12th PODS (1993)
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)
Fernandez, M., Florescu, D., Levy, A., Suciu, D.: Verifying integrity constraints on web-sites. In: Proc. 16th IJCAI, pp. 614–619 (1999)
Garcia-Molina, H., Ullman, J., Widom, J.: Database Systems: The Complete Book. Pearson Education International, London (2002)
Klug, A.: On conjunctive queries containing inequalities. J. ACM 35(1), 146–160 (1988)
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)
Levy, A., Mendelzon, A., Sagiv, Y., Srivastava, D.: Answering queries using views. In: Proc. 14th PODS, pp. 95–104 (1995)
Levy, A., Sagiv, Y.: Queries independent of updates. In: Proc. 19th VLDB, pp. 171–181 (1993)
Miklau, G., Suciu, D.: Containment and equivalence for an XPath fragment. In: Proc. 21st PODS, pp. 65–76 (2002)
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)
Sagiv, Y., Saraiya, Y.: Minimizing restricted-fanout queries. Discrete Applied Mathematics 40, 245–264 (1992)
Sagiv, Y., Yannakakis, M.: Equivalence among relational expressions with the union and difference operators. J. ACM 27(4), 633–655 (1981)
Shmueli, O.: Equivalence of datalog programs is undecidable. Theoretical Computer Science 15(3), 231–242 (1993)
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)
van der Meyden, R.: The complexity of querying indefinite data about linearly ordered domains. J. Computer and System Sciences 54(1), 113–135 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)