# How to decide if two conjunctive queries cannot have any result in common

Consider the following queries:

Q1: age > 18 & age < 24 & gender = ‘male’

Q2: age > 25 & gender = ‘male’ & major = ‘CS’

Q3: age = 20 & major = ‘CS’

Clearly, given any database instance $$D$$, we can decide $$Q1(D) \cap Q2(D) = \emptyset$$ and $$Q2(D) \cap Q3(D) = \emptyset$$. However, we cannot decide about the result of $$Q1(D) \cap Q3(D)$$.

I’m aware of query containment, in where the result of one query always is a subset of the results of another query. Also, I’m aware of query equivalence, in where the results of two queries should be exactly the same given any database instance.

However, I’m looking for an algorithm/terminology for my case, where before evaluating the two queries, I can decide the intersection of their results are always empty. Indeed, due to conflicting selection conditions, they cannot have any common result.