Skip to content

Commit

Permalink
docs: Add * EXCEPT documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
KingMob committed Apr 29, 2024
1 parent d14f8ce commit 987b5ca
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/modules/ROOT/partials/base/table-expressions/select.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ SELECT * FROM satellites
SELECT Users, Apogee_km, Perigee_km FROM satellites
----
====

.Exclude a subset of a table's columns
[example]
====
[source,gensql]
----
SELECT * EXCEPT Contractor, Country_of_Operator FROM satellites
----
====
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
=== `+GIVEN+`

.Compute the probability of the satellite's period from the model, given the class of orbit.
[example]
====
[source,gensql]
----
SELECT
PROBABILITY OF Period_minutes
UNDER satellites_model GIVEN Class_of_Orbit
UNDER satellites_model
GIVEN Class_of_Orbit
FROM satellites
----
====

.Compute the probability of the satellite's period from the model, given everything but the contractor and operator's country.
[example]
====
[source,gensql]
----
SELECT
PROBABILITY OF Period_minutes
UNDER satellites_model
GIVEN * EXCEPT Contractor, Country_of_Operator
FROM satellites
----
====
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The `+GENERATE+` expression evaluates to a table of samples from a model.

WARNING: The tables returned by `+GENERATE+` are infinite. A query comprised of a generate expression will run forever. In order to view the output if a `+GENERATE+` expression you should limit its output by wrapping it with a <<select expression,Select>> that includes a `+LIMIT+` clause.

.Generate 10 rows of 3 columns from the model
[example]
====
[source,gensql]
Expand All @@ -18,3 +19,19 @@ FROM
LIMIT 10
----
====

.Generate 10 rows containing almost all columns from the model, but excluding 2
[example]
====
[source,gensql]
----
SELECT *
FROM
GENERATE *
EXCEPT
Contractor,
Country_of_Operator
UNDER model
LIMIT 10
----
====
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
=== `+CONDITIONED BY+`

.Compute the probability density of a model variable after conditioning on another variable
[example]
====
[source,gensql]
Expand All @@ -10,3 +11,16 @@ SELECT
FROM satellites_model
----
====


.Compute the probability density of a model variable after conditioning on all other variables except one
[example]
====
[source,gensql]
----
SELECT
PROBABILITY DENSITY OF VAR Apogee_km < 1000
UNDER model CONDITIONED BY * EXCEPT VAR Country
FROM satellites_model
----
====
17 changes: 17 additions & 0 deletions docs/modules/ROOT/partials/strict/table-expressions/generate.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The `+GENERATE+` expression evaluates to a table of samples from a model.

WARNING: The tables returned by `+GENERATE+` are infinite. A query comprised of a generate expression will run forever. In order to view the output if a `+GENERATE+` expression you should limit its output by wrapping it with a <<select expression,Select>> that includes a `+LIMIT+` clause.

.Generate 10 rows of three columns from the model
[example]
====
[source,gensql]
Expand All @@ -18,3 +19,19 @@ FROM
LIMIT 10
----
====

.Generate 10 rows containing almost all columns from the model, but excluding 2
[example]
====
[source,gensql]
----
SELECT *
FROM
GENERATE *
EXCEPT
VAR Contractor,
VAR Country_of_Operator
UNDER model
LIMIT 10
----
====

0 comments on commit 987b5ca

Please sign in to comment.