Algorithm Search⌘K

Theoremcore

Equivalence rules of relational algebra

Also called algebraic laws of query rewriting.

Laws such as join commutativity, associativity and the pushing of selections and projections, which let an optimizer rewrite a plan. Some hold for sets only, others for sets and bags.

The equivalence rules of relational algebra are equations between two algebra expressions that hold on every database. An optimizer uses them to rewrite a query plan into a cheaper plan with the same result: it moves selections and projections down, reorders joins and turns subqueries into joins. This page states the laws as one theorem. For each law it says whether it holds under set semantics, under bag semantics (the semantics of SQL) or under both, and it gives the side conditions, and the proof section proves each law. Predicate pushdown is the rewrite strategy that applies the selection laws of this page to a plan; that page describes the strategy, and this page holds the laws and their proofs.

Statement

Relations. A relation RR over a finite set AA of attributes is a function from tuples over AA to the natural numbers: R(t)R(t) is the number of copies of tt in RR. Under bag semantics any number is allowed. Under set semantics every value is 0 or 1. Write [P][P] for 1 if the statement PP is true and 0 if it is false, and δ(R)(t)=min⁡(1,R(t))\delta(R)(t) = \min(1, R(t)) for duplicate elimination. Below, RR, SS and TT are relations over AA, BB and CC, and J=A∩BJ = A \cap B. A condition θ\theta is TRUE or FALSE on each tuple, except in law 3, which treats the value UNKNOWN of SQL.

Operators under bag semantics. For tuples tt, uu and ww over the right attributes:

  • σθ(R)(t)=R(t)⋅[θ(t)]\sigma_\theta(R)(t) = R(t) \cdot [\theta(t)], and πD(R)(u)=∑t:t[D]=uR(t)\pi_D(R)(u) = \sum_{t : t[D] = u} R(t) for D⊆AD \subseteq A.
  • (R⋈S)(w)=R(w[A])⋅S(w[B])(R \bowtie S)(w) = R(w[A]) \cdot S(w[B]) for ww over A∪BA \cup B. The product R×SR \times S is the case J=∅J = \emptyset, and R⋈θS=σθ(R×S)R \bowtie_\theta S = \sigma_\theta(R \times S).
  • For RR and SS over the same attributes: (R∪S)(t)=R(t)+S(t)(R \cup S)(t) = R(t) + S(t), which is UNION ALL; (R∩S)(t)=min⁡(R(t),S(t))(R \cap S)(t) = \min(R(t), S(t)); and (R−S)(t)=max⁡(0,R(t)−S(t))(R - S)(t) = \max(0, R(t) - S(t)), the monus, which is EXCEPT ALL.
  • (R⋉S)(t)=R(t)⋅[some s with S(s)>0 has s[J]=t[J]](R \ltimes S)(t) = R(t) \cdot [\text{some } s \text{ with } S(s) > 0 \text{ has } s[J] = t[J]], the semijoin.

Operators under set semantics. They are the same functions on relations with values 0 and 1, except that union and projection apply δ\delta to the result: R∪S=δ(R+S)R \cup S = \delta(R + S) and πD(R)=δ\pi_D(R) = \delta of the sum above. On values 0 and 1 the monus is the set difference.

Two expressions are equivalent under a semantics if they have the same attributes and give the same relation on every database of that semantics. Attributes have names, so the order of the columns does not matter.

Theorem. The following equivalences hold under the semantics and the side conditions given.

law equivalence side condition holds under
1 σθ1∧θ2(R)=σθ1(σθ2(R))=σθ2(σθ1(R))\sigma_{\theta_1 \wedge \theta_2}(R) = \sigma_{\theta_1}(\sigma_{\theta_2}(R)) = \sigma_{\theta_2}(\sigma_{\theta_1}(R)) none both
2 σθ1∨θ2(R)=σθ1(R)∪σθ2(R)\sigma_{\theta_1 \vee \theta_2}(R) = \sigma_{\theta_1}(R) \cup \sigma_{\theta_2}(R) none sets only
3 σ¬θ(R)=R−σθ(R)\sigma_{\neg\theta}(R) = R - \sigma_\theta(R) θ\theta is never UNKNOWN on a tuple of RR both
4 σθ(R×S)=R⋈θS\sigma_\theta(R \times S) = R \bowtie_\theta S J=∅J = \emptyset both
5 σθ(R⋈S)=σθ(R)⋈S\sigma_\theta(R \bowtie S) = \sigma_\theta(R) \bowtie S, and the same for ⋈φ\bowtie_\varphi and ×\times θ\theta reads only attributes in AA both
6 σθ(R∘S)=σθ(R)∘σθ(S)\sigma_\theta(R \circ S) = \sigma_\theta(R) \circ \sigma_\theta(S) for ∘\circ in ∪,∩,−\cup, \cap, -, and σθ(R−S)=σθ(R)−S\sigma_\theta(R - S) = \sigma_\theta(R) - S A=BA = B both
7 πD(πE(R))=πD(R)\pi_D(\pi_E(R)) = \pi_D(R) D⊆E⊆AD \subseteq E \subseteq A both
8 πD(σθ(R))=σθ(πD(R))\pi_D(\sigma_\theta(R)) = \sigma_\theta(\pi_D(R)) θ\theta reads only attributes in DD both
9 πL(R⋈S)=πL(πLR(R)⋈πLS(S))\pi_L(R \bowtie S) = \pi_L(\pi_{L_R}(R) \bowtie \pi_{L_S}(S)) L⊆A∪BL \subseteq A \cup B, LR=(L∩A)∪JL_R = (L \cap A) \cup J, LS=(L∩B)∪JL_S = (L \cap B) \cup J both
10 πD(R∪S)=πD(R)∪πD(S)\pi_D(R \cup S) = \pi_D(R) \cup \pi_D(S) A=BA = B both
11 πD(R−S)=πD(R)−πD(S)\pi_D(R - S) = \pi_D(R) - \pi_D(S) A=BA = B, and no two different tuples with a positive value in RR or in SS agree on DD both
12 R⋈S=S⋈RR \bowtie S = S \bowtie R, and the same for ×\times, ∪\cup and ∩\cap none both
13 (R⋈S)⋈T=R⋈(S⋈T)(R \bowtie S) \bowtie T = R \bowtie (S \bowtie T), and the same for ×\times, ∪\cup and ∩\cap none both
14 (R⋈θ1S)⋈θ2T=R⋈θ1(S⋈θ2T)(R \bowtie_{\theta_1} S) \bowtie_{\theta_2} T = R \bowtie_{\theta_1} (S \bowtie_{\theta_2} T) AA, BB, CC pairwise disjoint, θ1\theta_1 reads only A∪BA \cup B, θ2\theta_2 reads only B∪CB \cup C both
15 R⋈(S∪T)=(R⋈S)∪(R⋈T)R \bowtie (S \cup T) = (R \bowtie S) \cup (R \bowtie T) B=CB = C both
16 R⋈(S−T)=(R⋈S)−(R⋈T)R \bowtie (S - T) = (R \bowtie S) - (R \bowtie T) B=CB = C both
17 R∪R=RR \cup R = R none sets only
18 R∩(S∪T)=(R∩S)∪(R∩T)R \cap (S \cup T) = (R \cap S) \cup (R \cap T) A=B=CA = B = C sets only
19 (R∪S)−T=(R−T)∪(S−T)(R \cup S) - T = (R - T) \cup (S - T) A=B=CA = B = C sets only
20 R⋉S=πA(R⋈S)R \ltimes S = \pi_A(R \bowtie S) none sets only
21 R⋉S=R⋈δ(πJ(S))R \ltimes S = R \bowtie \delta(\pi_J(S)) none both

"Sets only" means that the law holds under set semantics and fails under bag semantics. Law 11 fails under both semantics without its side condition. Moreover (law 22, transfer): if two expressions use only σ\sigma, π\pi, ×\times, ⋈\bowtie, ∪\cup and ∩\cap, and they are equivalent under bag semantics, then they are equivalent under set semantics.

In plain words

A database can compute the same answer in many ways. The laws on this page say which changes to a query never change the answer, on any data. Two kinds matter most. A filter can move down, closer to the tables, so that the later steps see fewer rows. And the joins can be done in any order. An optimizer applies the laws again and again to find a cheaper form of the same query.

SQL tables can hold the same row twice. Some laws that are true for sets of rows are then false. For example, if you put a list of rows together with itself and keep the copies, every row is there twice, so the result is not the list you started with. So each law here says if it is true for sets, for tables with copies, or for both.

Proof

Under set semantics, the operators σ\sigma, ×\times, ⋈\bowtie, ∩\cap, −- and ⋉\ltimes are the bag operators restricted to relations with values 0 and 1, and they give such relations again. So a proof of a law in these operators under bag semantics is also a proof under set semantics. For the laws with ∪\cup or π\pi and no difference, law 22 gives the set case from the bag case. The other set cases are proved directly. Below, tt is a tuple over AA, xx a tuple over AA, yy a tuple over BB, and ww a tuple over all attributes of the expression.

Law 22. First, δ\delta commutes with each positive operator, in the sense δ(opbag(R,S))=opset(δR,δS)\delta(\mathrm{op}_{\text{bag}}(R, S)) = \mathrm{op}_{\text{set}}(\delta R, \delta S). For selection, [R(t)[θ(t)]>0]=[R(t)>0][θ(t)][R(t)[\theta(t)] > 0] = [R(t) > 0][\theta(t)]. For join and product, [R(x)S(y)>0]=[R(x)>0]⋅[S(y)>0][R(x) S(y) > 0] = [R(x) > 0] \cdot [S(y) > 0]. For union, [R(t)+S(t)>0]=max⁡([R(t)>0],[S(t)>0])[R(t) + S(t) > 0] = \max([R(t) > 0], [S(t) > 0]), which is the set union of δR\delta R and δS\delta S. For projection, a sum of natural numbers is positive exactly when one of its terms is positive, so δ(πD(R))=δ(πD(δR))\delta(\pi_D(R)) = \delta(\pi_D(\delta R)), the set projection of δR\delta R. For intersection, [min⁡(R(t),S(t))>0]=min⁡([R(t)>0],[S(t)>0])[\min(R(t), S(t)) > 0] = \min([R(t) > 0], [S(t) > 0]). By induction on the expression, δ(Ebag(D))=Eset(δD)\delta(E_{\text{bag}}(D)) = E_{\text{set}}(\delta D) for every positive expression EE and every database DD. If DD is a set database, then δD=D\delta D = D, so E1,set(D)=δ(E1,bag(D))=δ(E2,bag(D))=E2,set(D)E_{1,\text{set}}(D) = \delta(E_{1,\text{bag}}(D)) = \delta(E_{2,\text{bag}}(D)) = E_{2,\text{set}}(D). Difference does not commute with δ\delta: for R={t,t}R = \{t, t\} and S={t}S = \{t\}, δ(R−S)={t}\delta(R - S) = \{t\} but δR−δS=∅\delta R - \delta S = \emptyset. So the law needs the restriction to positive expressions.

Law 1. [θ1(t)∧θ2(t)]=[θ1(t)]⋅[θ2(t)][\theta_1(t) \wedge \theta_2(t)] = [\theta_1(t)] \cdot [\theta_2(t)], and multiplication is commutative. In SQL a conjunction is TRUE exactly when both parts are TRUE, and selection keeps a tuple exactly when its condition is TRUE, so the law also holds with UNKNOWN.

Law 2. Under sets, R(t)∈{0,1}R(t) \in \{0, 1\} and [θ1∨θ2]=max⁡([θ1],[θ2])[\theta_1 \vee \theta_2] = \max([\theta_1], [\theta_2]), so the left side is R(t)max⁡([θ1(t)],[θ2(t)])R(t) \max([\theta_1(t)], [\theta_2(t)]), which is δ(R(t)[θ1(t)]+R(t)[θ2(t)])\delta(R(t)[\theta_1(t)] + R(t)[\theta_2(t)]), the right side. Under bags, take R={t}R = \{t\} with θ1(t)\theta_1(t) and θ2(t)\theta_2(t) both true: the left side holds tt once and the right side twice.

Law 3. max⁡(0,R(t)−R(t)[θ(t)])=R(t)(1−[θ(t)])=R(t)[¬θ(t)]\max(0, R(t) - R(t)[\theta(t)]) = R(t)(1 - [\theta(t)]) = R(t)[\neg\theta(t)], because θ(t)\theta(t) is TRUE or FALSE. If θ(t)\theta(t) is UNKNOWN, then ¬θ(t)\neg\theta(t) is UNKNOWN too, so tt is in neither σθ(R)\sigma_\theta(R) nor σ¬θ(R)\sigma_{\neg\theta}(R), and the right side keeps tt while the left side drops it.

Law 4. This is the definition of ⋈θ\bowtie_\theta.

Law 5. The left side at ww is R(w[A])S(w[B])[θ(w)]R(w[A]) S(w[B]) [\theta(w)]. Because θ\theta reads only attributes in AA, θ(w)=θ(w[A])\theta(w) = \theta(w[A]), so this equals R(w[A])[θ(w[A])]⋅S(w[B])R(w[A])[\theta(w[A])] \cdot S(w[B]), the right side. A join condition φ\varphi adds the same factor [φ(w)][\varphi(w)] to both sides.

Law 6. [θ](R+S)=[θ]R+[θ]S[\theta](R + S) = [\theta]R + [\theta]S and [θ]min⁡(R,S)=min⁡([θ]R,[θ]S)[\theta] \min(R, S) = \min([\theta]R, [\theta]S). Because [θ][\theta] is 0 or 1, [θ]max⁡(0,R−S)=max⁡(0,[θ]R−[θ]S)[\theta] \max(0, R - S) = \max(0, [\theta]R - [\theta]S), and this also equals max⁡(0,[θ]R−S)\max(0, [\theta]R - S): if [θ]=1[\theta] = 1 the two are the same, and if [θ]=0[\theta] = 0 both are 0. The case of ∪\cup under sets follows by law 22, and the other cases are among the operators that sets and bags share.

Law 7. πD(πE(R))(u)=∑v:v[D]=u∑t:t[E]=vR(t)=∑t:t[D]=uR(t)\pi_D(\pi_E(R))(u) = \sum_{v : v[D] = u} \sum_{t : t[E] = v} R(t) = \sum_{t : t[D] = u} R(t), because D⊆ED \subseteq E gives t[D]=(t[E])[D]t[D] = (t[E])[D], so each tt is counted once. Law 22 gives the set case.

Law 8. If t[D]=ut[D] = u, then θ(t)=θ(u)\theta(t) = \theta(u), because θ\theta reads only attributes in DD. So ∑t:t[D]=uR(t)[θ(t)]=[θ(u)]∑t:t[D]=uR(t)\sum_{t : t[D] = u} R(t)[\theta(t)] = [\theta(u)] \sum_{t : t[D] = u} R(t). Law 22 gives the set case.

Law 9. Write R′=πLR(R)R' = \pi_{L_R}(R) and S′=πLS(S)S' = \pi_{L_S}(S), and let zz be a tuple over LR∪LSL_R \cup L_S. Then (R′⋈S′)(z)=∑x,yR(x)S(y)(R' \bowtie S')(z) = \sum_{x, y} R(x) S(y) over the xx with x[LR]=z[LR]x[L_R] = z[L_R] and the yy with y[LS]=z[LS]y[L_S] = z[L_S]. Each such pair agrees on JJ, because J⊆LR∩LSJ \subseteq L_R \cap L_S and both agree with zz there, so it forms one tuple ww over A∪BA \cup B with w[LR∪LS]=zw[L_R \cup L_S] = z. Each such ww comes from exactly one pair, x=w[A]x = w[A] and y=w[B]y = w[B]. So R′⋈S′=πLR∪LS(R⋈S)R' \bowtie S' = \pi_{L_R \cup L_S}(R \bowtie S). Since L⊆LR∪LSL \subseteq L_R \cup L_S, law 7 gives πL(R′⋈S′)=πL(R⋈S)\pi_L(R' \bowtie S') = \pi_L(R \bowtie S). Law 22 gives the set case.

Law 10. A sum over the tt with t[D]=ut[D] = u of R(t)+S(t)R(t) + S(t) splits into two sums. Law 22 gives the set case.

Law 11. By the side condition, for each tuple uu over DD at most one tuple tt with t[D]=ut[D] = u has a positive value in RR or in SS. If there is none, both sides are 0 at uu. Otherwise both sides are max⁡(0,R(t)−S(t))\max(0, R(t) - S(t)). The same computation with values 0 and 1 is the set case. Without the condition the law fails under both semantics: for R={(1,2)}R = \{(1, 2)\} and S={(1,3)}S = \{(1, 3)\} over (a,b)(a, b) and D={a}D = \{a\}, πa(R−S)={(1)}\pi_a(R - S) = \{(1)\}, but πa(R)−πa(S)=∅\pi_a(R) - \pi_a(S) = \emptyset.

Laws 12 and 13. The two sides of each law are the products R(w[A])S(w[B])R(w[A]) S(w[B]) and R(w[A])S(w[B])T(w[C])R(w[A]) S(w[B]) T(w[C]), the sums or the minimums of the same numbers, grouped or ordered in another way. Multiplication, addition and the minimum are commutative and associative. Law 22 gives the case of ∪\cup under sets.

Law 14. By law 4 and law 5 (with θ1\theta_1 on the left input R×SR \times S), the left side is σθ2(σθ1(R×S)×T)=σθ2(σθ1(R×S×T))\sigma_{\theta_2}(\sigma_{\theta_1}(R \times S) \times T) = \sigma_{\theta_2}(\sigma_{\theta_1}(R \times S \times T)). By law 5 and law 12 (with θ2\theta_2 on the right input S×TS \times T), the right side is σθ1(σθ2(R×S×T))\sigma_{\theta_1}(\sigma_{\theta_2}(R \times S \times T)). Law 1 makes the two equal. The side conditions are what makes θ1\theta_1 readable on R×SR \times S and θ2\theta_2 readable on S×TS \times T.

Law 15. R(x)(S(y)+T(y))=R(x)S(y)+R(x)T(y)R(x)(S(y) + T(y)) = R(x)S(y) + R(x)T(y). Law 22 gives the set case.

Law 16. Because R(x)≥0R(x) \ge 0, R(x)max⁡(0,S(y)−T(y))=max⁡(0,R(x)S(y)−R(x)T(y))R(x) \max(0, S(y) - T(y)) = \max(0, R(x)S(y) - R(x)T(y)).

Law 17. Under sets, δ(R+R)=R\delta(R + R) = R when the values of RR are 0 and 1. Under bags, (R∪R)(t)=2R(t)(R \cup R)(t) = 2R(t), which differs from R(t)R(t) when R(t)>0R(t) > 0.

Law 18. Under sets, the law is the distributive law of AND over OR at each tuple. Under bags, take R=S=T={t}R = S = T = \{t\}: the left side is min⁡(1,2)=1\min(1, 2) = 1 copy and the right side is 1+1=21 + 1 = 2 copies.

Law 19. Under sets, (r∨s)∧¬u=(r∧¬u)∨(s∧¬u)(r \vee s) \wedge \neg u = (r \wedge \neg u) \vee (s \wedge \neg u) at each tuple. Under bags, take R=S=T={t}R = S = T = \{t\}: the left side is max⁡(0,2−1)=1\max(0, 2 - 1) = 1 copy and the right side is 0+0=00 + 0 = 0 copies.

Law 20. Under bags, πA(R⋈S)(t)=R(t)⋅∑y:y[J]=t[J]S(y)\pi_A(R \bowtie S)(t) = R(t) \cdot \sum_{y : y[J] = t[J]} S(y), so each copy of tt is repeated once for each match. Under sets this value is positive exactly when R(t)=1R(t) = 1 and some match exists, which is (R⋉S)(t)(R \ltimes S)(t). For bags, take R={(1)}R = \{(1)\} over aa and S={(1,5),(1,6)}S = \{(1, 5), (1, 6)\} over (a,c)(a, c): πa(R⋈S)\pi_a(R \bowtie S) holds (1)(1) twice, and R⋉SR \ltimes S holds it once.

Law 21. Since J⊆AJ \subseteq A, the join has the attributes AA, and (R⋈δ(πJ(S)))(t)=R(t)⋅[πJ(S)(t[J])>0](R \bowtie \delta(\pi_J(S)))(t) = R(t) \cdot [\pi_J(S)(t[J]) > 0]. The sum πJ(S)(t[J])\pi_J(S)(t[J]) is positive exactly when some ss with S(s)>0S(s) > 0 has s[J]=t[J]s[J] = t[J], so this is (R⋉S)(t)(R \ltimes S)(t). With values 0 and 1 it is the set case. □\square

Consequences

  • Predicate pushdown. Laws 1, 5, 6 and 8 move a selection below joins, unions and projections, and law 4 turns a selection over a product into a join. They hold under both semantics, so they are safe for SQL. Predicate pushdown applies them to plans, also through outer joins on the preserved side, which needs rules that are not on this page.
  • Join reordering. By laws 12 and 13, all join trees over the same relations give the same result, under bags too. This is why the join ordering problem can choose the tree by cost alone. Law 14 says that a theta-join condition must move with the relations it reads.
  • Narrow rows. Law 9 lets a plan drop the columns that no later operator reads, as soon as each relation is read, if it keeps the join columns.
  • OR under bags. Law 2 fails under bags, but σθ1∨θ2(R)=σθ1(R)∪σ¬θ1∧θ2(R)\sigma_{\theta_1 \vee \theta_2}(R) = \sigma_{\theta_1}(R) \cup \sigma_{\neg\theta_1 \wedge \theta_2}(R) holds under both semantics for conditions that are TRUE or FALSE, because [θ1∨θ2]=[θ1]+[¬θ1∧θ2][\theta_1 \vee \theta_2] = [\theta_1] + [\neg\theta_1 \wedge \theta_2]. In SQL, write the second condition with θ1\theta_1 IS NOT TRUE in place of NOT θ1\theta_1.
  • Semijoins. Law 21 is the rewrite of EXISTS into a join with the distinct join values of the inner table, as in subquery unnesting. Law 20 is right only after duplicate elimination, so a plan for SQL must use law 21.
  • Example. Take R(a,b)={(1,10),(1,10),(2,20)}R(a, b) = \{(1, 10), (1, 10), (2, 20)\} and S(b,c)={(10,x),(20,y),(20,z)}S(b, c) = \{(10, x), (20, y), (20, z)\} as bags. Then R⋈SR \bowtie S holds (1,10,x)(1, 10, x) twice, (2,20,y)(2, 20, y) and (2,20,z)(2, 20, z). Selecting a=1a = 1 gives (1,10,x)(1, 10, x) twice, and so does σa=1(R)⋈S\sigma_{a=1}(R) \bowtie S, as law 5 says. R⋉SR \ltimes S is RR itself. πa,b(R⋈S)\pi_{a,b}(R \bowtie S) holds (1,10)(1, 10) twice and (2,20)(2, 20) twice, which is not RR, as law 20 says. δ(πb(S))={(10),(20)}\delta(\pi_b(S)) = \{(10), (20)\} and R⋈δ(πb(S))=RR \bowtie \delta(\pi_b(S)) = R, as law 21 says.

Tightness

  • Sets and bags. Laws 2, 17, 18, 19 and 20 hold under sets and fail under bags, by the examples in the proof. So law 22 has no converse: a law that holds under sets need not hold under bags. Law 22 also fails for expressions with difference, by the example in its proof.
  • Side conditions. Law 11 fails without its condition under both semantics. Law 3 fails when the condition can be UNKNOWN: for R={(NULL)}R = \{(\mathrm{NULL})\} over aa and θ\theta equal to a=1a = 1, σ¬θ(R)=∅\sigma_{\neg\theta}(R) = \emptyset, but R−σθ(R)=RR - \sigma_\theta(R) = R. In laws 5, 8 and 14 the side condition is what makes the right side defined.
  • Outer joins. Joins and outer joins do not reassociate freely. For R(a)={(1)}R(a) = \{(1)\}, S(a,b)=∅S(a, b) = \emptyset and T(b)={(5)}T(b) = \{(5)\}, RR LEFT JOIN (S⋈T)(S \bowtie T) is {(1,NULL)}\{(1, \mathrm{NULL})\}. But RR LEFT JOIN SS is {(1,NULL)}\{(1, \mathrm{NULL})\}, and its join with TT is empty, because NULL = 5 is not TRUE.
  • Aggregation. No law on this page moves a grouping. That needs its own conditions, given on eager aggregation.

History

Codd (1970) defined the operations of the relational model on sets of tuples. Textbooks list the algebraic laws that optimizers use; Garcia-Molina, Ullman and Widom give them in Section 16.2 of their book, with the laws for selections, projections, joins and products and for duplicate elimination. Green, Karvounarakis and Tannen (2007) put sets and bags in one model, relations annotated by a commutative semiring, with the Boolean semiring for sets and the natural numbers for bags, and showed that positive queries commute with semiring homomorphisms. Law 22 is the case of the homomorphism from the natural numbers to the Boolean values.

References

  1. Hector Garcia-Molina, Jeffrey D. Ullman and Jennifer Widom, Database Systems: The Complete Book, second edition, Pearson Prentice Hall (2009), Section 16.2, Algebraic laws for improving query plans (commutative and associative laws, laws involving selection, pushing selections, laws involving projection, laws about joins and products, laws involving duplicate elimination)
  2. Todd J. Green, Grigoris Karvounarakis and Val Tannen, Provenance semirings, Proceedings of the 26th ACM Symposium on Principles of Database Systems (PODS), 31 to 40 (2007), K-relations, with the Boolean semiring for sets and the natural numbers for bags, and the commutation of positive queries with semiring homomorphisms
  3. Edgar F. Codd, A relational model of data for large shared data banks, Communications of the ACM 13(6), 377 to 387 (1970), the operations on relations

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/00WBVB/text.yaml