I am reading about Codd’s Eight Original Operators in Inside Microsoft SQL Server 2008: T-SQL Querying by Itzik Ben-Gan, Lubor Kollar, Dejan Sarka, and Steve Kass and do not understand the Divide operator.
Quotes defining the Divide operator:
“A divisor relation is used to partition a dividend relation and produce a quotient relation. The quotient relation is made up of those values of one column from the dividend table for which the second column contains all of the values in the divisor.”
This statement is in agreement with Wikipedia's definition and example.
“The formula for the Divide operator includes three relations: a divide by b per c, where a is the dividend, b is the divisor, and c is the mediator relation. Let relation a have attributes A and relation b attributes B. The Divide operator returns a relation that includes of all tuples from divisor such that a tuple {A, B} appears in the mediator relation for all tuples from divisor relation.”
The diagram below is used to demonstrate this statement. I believe the relations are presented in the following order: dividend, divisor, mediator, and end result.
The second relation (the divisor) has {a, x}, {a, z}, {b, x} and {b, z} for tuples. My thought process follows that since there are tuples {b, x} and {b, z} that b should be included in the end result. I've check the book corrections on the book's website (linked at the beginning of this post) and am certain that I am wrong.
Why is the result of the diagram example a and not a and b?