Труды Института системного программирования РАН (Oct 2018)

Solving NULL issue in queries to a relational database using the operators of relational algebra A

  • Ivan V. Bludov

Journal volume & issue
Vol. 21, no. 0

Abstract

Read online

Suggest interpreting logical expressions in the relational restriction operator as relational expressions. To be more precise, the relational restriction operator (R WHERE b) over the relation R on some logical expression b can be represented as join (R<AND>B) of given relation R and relational expression B, which is derived from original logical expression b replacing of logical operators AND, OR, NOT for corresponding relational operators <AND>, <OR>, <NOT>. Then for some tuple T we define a value of attribute A as the relation with the single tuple with the single value of concerned attribute – RELATION<A> {{a}}. The value of attribute marked as NULL meaning the unknown value we define as the relation with a head including concerned attribute and the body including all possible values over the type of attribute A – REALTIONAL<A>{…}. The equality values of attributes are definite as equijoin of these attributes represented as relation. The tuple T, which could be presented as Cartesian product over all its attributes, is also definite as a relation RT. The validity of this tuple T represented as relation RTover the original logical expression b means the truth of universal quantifier over the tuples of RT on expression b, which means equality of join (RT <AND> B)and RT – (RT <AND> B)= RT.

Keywords