1. A computer-implemented method comprising: providing a dictionary containing a plurality of predefined codes, wherein the plurality of predefined codes includes a first predefined code representing a null value, wherein the first predefined code is not a null value; encoding data in a database table using the dictionary, wherein the data includes at least one null value, wherein encoding the data results in the at least one null value being encoded as the first predefined code; receiving a query having a predicate; rewriting the query based on the received query, the data dictionary, and one or more predicate generation rules, wherein the rewritten query excludes any three-valued logic; and evaluating, by operation of one or more computer processors, the rewritten query against the encoded data, whereby the rewritten query is evaluated on at least the first predefined code, wherein the encoded data is evaluated without decoding the encoding data.