Patent ID: 8229940

Claim:
A computer-implemented method, comprising: receiving a plurality of query conditions for a database, wherein each query condition includes a comparison operator and a comparison value for a database attribute, wherein the comparison operator comprises at least one of a matching operator, a non-matching operator, and a range operator, and wherein the plurality of query conditions include: (i) a first query condition having and a first comparison operator selected from a greater-than operator and a greater-than-or-equal-to operator, wherein the first comparison operator is associated with a first comparison value; and (ii) a second query condition having a second comparison operator selected from a less-than operator and a less-than-or-equal-to operator, wherein the second comparison operator is associated with a second comparison value, and wherein the first condition and the second condition are determined to belong to a first parenthesized group; executing a query predicate generator by one or more computer processors to programmatically determine, based on the query conditions, at least one logical operator to include between the query conditions, wherein the first parenthesized group having the first comparison operator and the second comparison operator is modified based on the at least one logical operator, and wherein determining the at least one logical operator comprises: upon determining that the first comparison value is less than the second comparison value, chaining the first and second query conditions with a logical AND operator; and upon determining that the first comparison value is greater than the second comparison value, chaining the first and second query conditions with a logical OR operator; and programmatically generating at least one database query predicate to include in a database query to apply against the database for obtaining a set of query results, wherein the database query includes the received query conditions chained using the determined at least one logical operator.