Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Instances For
Dependency graph
Instances For
Dependency graph
Equations
- r_tropical = Relation.annotate (fun (x : Tuple String 4) => MinTropical.trop 1) r
Instances For
Dependency graph
Equations
- d_tropical = [("Personnel", ⟨4, r_tropical⟩)]
Instances For
Dependency graph
The general (kind-indexed) syntax and its rewriting #
The same database, now through AggQuery: aggregation, HAVING, and the
rewriting of both into the composite domain String ⊕ ℕ.
Equations
- qgPersonnel = AggQueryIn.Rel 4 "Personnel"
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
- φexactlyTwo = GenPredIn.and (GenPredIn.fusedCmp CompOp.ge 0 (TermIn.const "2")) (GenPredIn.fusedCmp CompOp.le 0 (TermIn.const "2"))
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
- cityCols x✝ = ProjColIn.term (TermGIn.index (Fin.castAdd 1 0) cityCols._proof_1)
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
Instances For
Dependency graph
Equations
- φbigOrBerlin = GenPredIn.or (GenPredIn.fusedCmp CompOp.ge 0 (TermIn.const "3")) (GenPredIn.cmp CompOp.eq (TermGIn.index (Fin.castAdd 1 0) cityCols._proof_1) (TermGIn.const "Berlin"))
Instances For
Dependency graph
Equations
Instances For
Dependency graph
A window #
SUM(1) OVER (PARTITION BY city) – the size of each city's group, given to
every row of that city. A window removes no row and merges none, so the
answer has as many rows as the input and every row keeps the annotation it
came with: no group is created, so no group-existence factor arises.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The rows strictly before the current row's peers: a frame that contains neither the row nor its equals, so it can be empty in a world where the row is present. Its token is therefore read in the scalar convention, and the first row of each city aggregates over nothing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
An aggregate over no row #
With a null in the value domain, SUM over no row is NULL, as SQL has it,
and not the zero the domain happened to offer. A window is where that
becomes reachable on ordinary data: under the frame of the rows strictly
before, the first row of each city aggregates over nothing.
Equations
- rNull = Multiset.map (fun (u : Tuple String 4) (k : Fin 4) => WithNull.val (u k)) r
Instances For
Dependency graph
Instances For
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Where the nulls go is the clause's business #
Three rows of one city, one of them with a null id. The frame is the same
in both queries below – the rows strictly before the current row's peers –
and so is the data; only the ORDER BY differs, in where it places the
null. The running counts come out different, which is the point: the
domain's own order has nothing to say about it, and a frame stated against
that order cannot express either reading.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Instances For
Dependency graph
Dependency graph
ORDER BY id ASC NULLS FIRST: the null row is counted first.
Equations
- ascNullsFirst x✝ = { desc := OrderCol.ASC.desc, nullsFirst := true }
Instances For
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Equations
- One or more equations did not get rendered due to their size.