db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1696051 - in /db/derby/docs/trunk/src/ref: refderby.ditamap rrefsqlj33923.dita rrefsqljstddevpop.dita rrefsqljstddevsamp.dita rrefsqljvarpop.dita rrefsqljvarsamp.dita
Date Sat, 15 Aug 2015 13:33:36 GMT
Author: rhillegas
Date: Sat Aug 15 13:33:36 2015
New Revision: 1696051

URL: http://svn.apache.org/r1696051
Log:
DERBY-6830: Add reference documentation for the var_pop(), var_samp(), stddev_pop(), and stddev_samp()
aggregates. Commit derby-6830-01-ab-refguide.diff.

Added:
    db/derby/docs/trunk/src/ref/rrefsqljstddevpop.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsqljstddevsamp.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsqljvarpop.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsqljvarsamp.dita   (with props)
Modified:
    db/derby/docs/trunk/src/ref/refderby.ditamap
    db/derby/docs/trunk/src/ref/rrefsqlj33923.dita

Modified: db/derby/docs/trunk/src/ref/refderby.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/refderby.ditamap?rev=1696051&r1=1696050&r2=1696051&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/refderby.ditamap (original)
+++ db/derby/docs/trunk/src/ref/refderby.ditamap Sat Aug 15 13:33:36 2015
@@ -827,6 +827,8 @@ limitations under the License.
 <topicref href="rrefbuiltsmallint.dita" navtitle="SMALLINT function"></topicref>
 <topicref href="rrefsqlj73147.dita" navtitle="SQRT function"></topicref>
 <topicref href="rrefsqlj93082.dita" navtitle="SUBSTR function"></topicref>
+<topicref href="rrefsqljstddevpop.dita" navtitle="STDDEV_POP function"></topicref>
+<topicref href="rrefsqljstddevsamp.dita" navtitle="STDDEV_SAMP function"></topicref>
 <topicref href="rrefsqlj13083.dita" navtitle="SUM function"></topicref>
 <topicref href="rreffunctan.dita" navtitle="TAN function"></topicref>
 <topicref href="rreffunctanh.dita" navtitle="TANH function"></topicref>
@@ -835,6 +837,8 @@ limitations under the License.
 <topicref href="rreftrimfunc.dita" navtitle="TRIM function"></topicref>
 <topicref href="rrefsqlj29930.dita" navtitle="UCASE or UPPER function"></topicref>
 <topicref href="rrefsqlj42476.dita" navtitle="USER function"></topicref>
+<topicref href="rrefsqljvarpop.dita" navtitle="VAR_POP function"></topicref>
+<topicref href="rrefsqljvarsamp.dita" navtitle="VAR_SAMP function"></topicref>
 <topicref href="rrefbuiltvarchar.dita" navtitle="VARCHAR function"></topicref>
 <topicref href="rreffuncxmlexists.dita" navtitle="XMLEXISTS operator"></topicref>
 <topicref href="rreffuncxmlparse.dita" navtitle="XMLPARSE operator"></topicref>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj33923.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj33923.dita?rev=1696051&r1=1696050&r2=1696051&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj33923.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj33923.dita Sat Aug 15 13:33:36 2015
@@ -33,8 +33,8 @@ database literature).</shortdesc>
 <section><p>Aggregates provide a means of evaluating an expression over a set
of
 rows. Whereas the other built-in functions operate on a single expression,
 aggregates operate on a set of values and reduce them to a single scalar value.
-Built-in aggregates can calculate the minimum, maximum, sum, count, and average
-of an expression over a set of values as well as count rows.</p></section>
+Built-in aggregates can count rows as well as calculate the minimum, maximum, sum, count,
average,
+variance, and standard deviation of an expression over a set of values.</p></section>
 <section><p>In addition to the built-in aggregates,
 <ph conref="../conrefs.dita#prod/productshortname"></ph> allows you to create
 custom aggregate operators, called user-defined aggregates (UDAs). For
@@ -64,25 +64,41 @@ the data types shown in the following ta
 </thead>
 <tbody>
 <row>
+<entry colname="1"><xref href="rrefsqlj32693.dita#rrefsqlj32693">AVG</xref></entry>
+<entry colname="2">Numeric built-in data types</entry>
+</row>
+<row>
 <entry colname="1"><xref href="rrefsqlj38716.dita#rrefsqlj38716">COUNT</xref></entry>
 <entry colname="2">All types</entry>
 </row>
 <row>
-<entry colname="1"><xref href="rrefsqlj33520.dita#rrefsqlj33520">MIN</xref></entry>
+<entry colname="1"><xref href="rrefsqlj27781.dita#rrefsqlj27781">MAX</xref></entry>
 <entry colname="2">Data types that can be indexed</entry>
 </row>
 <row>
-<entry colname="1"><xref href="rrefsqlj27781.dita#rrefsqlj27781">MAX</xref></entry>
+<entry colname="1"><xref href="rrefsqlj33520.dita#rrefsqlj33520">MIN</xref></entry>
 <entry colname="2">Data types that can be indexed</entry>
 </row>
 <row>
-<entry colname="1"><xref href="rrefsqlj32693.dita#rrefsqlj32693">AVG</xref></entry>
+<entry colname="1"><xref href="rrefsqljstddevpop.dita#rrefsqljstddevpop">STDDEV_POP</xref></entry>
+<entry colname="2">Numeric built-in data types</entry>
+</row>
+<row>
+<entry colname="1"><xref href="rrefsqljstddevsamp.dita#rrefsqljstddevsamp">STDDEV_SAMP</xref></entry>
 <entry colname="2">Numeric built-in data types</entry>
 </row>
 <row>
 <entry colname="1"><xref href="rrefsqlj13083.dita#rrefsqlj13083">SUM</xref></entry>
 <entry colname="2">Numeric built-in data types</entry>
 </row>
+<row>
+<entry colname="1"><xref href="rrefsqljvarpop.dita#rrefsqljvarpop">VAR_POP</xref></entry>
+<entry colname="2">Numeric built-in data types</entry>
+</row>
+<row>
+<entry colname="1"><xref href="rrefsqljvarsamp.dita#rrefsqljvarsamp">VAR_SAMP</xref></entry>
+<entry colname="2">Numeric built-in data types</entry>
+</row>
 </tbody>
 </tgroup>
 </table></section>

Added: db/derby/docs/trunk/src/ref/rrefsqljstddevpop.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljstddevpop.dita?rev=1696051&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljstddevpop.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljstddevpop.dita Sat Aug 15 13:33:36 2015
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at      
+
+http://www.apache.org/licenses/LICENSE-2.0  
+
+Unless required by applicable law or agreed to in writing, software  
+distributed under the License is distributed on an "AS IS" BASIS,  
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
+See the License for the specific language governing permissions and  
+limitations under the License.
+-->
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<reference id="rrefsqljstddevpop" xml:lang="en-us">
+<title>STDDEV_POP function</title>
+<shortdesc>STDDEV_POP is an aggregate function that evaluates the
+ standard deviation of an expression over a population.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>STDDEV_POP aggregate function</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section><p>See <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>
for more
+information about these functions.</p>
+<p>STDDEV_POP is allowed only on expressions that evaluate to numeric data
+types.</p></section>
+
+<refsyn><title>Syntax</title>
+<codeblock><b>STDDEV_POP ( <i>expression</i> )</b></codeblock>
+
+<p>The <i>expression</i> can contain multiple
+column references or expressions, but it cannot contain another aggregate
+or subquery. It must evaluate to a built-in numeric data type. If an expression
+evaluates to NULL, the aggregate skips that value.</p> <p>The resulting data
+type is DOUBLE (it might overflow).</p> </refsyn>
+
+<example id="rrefstddevpopformula"><title>Formula</title>
+
+<p>
+Standard deviation is calculated as follows:
+</p>
+
+<codeblock><b>
+sqrt( var_pop() )
+</b></codeblock> </example>
+
+<example><title>Example</title>
+<codeblock><b>-- find the standard deviation in flight time per aircraft
+SELECT AIRCRAFT, STDDEV_POP( flying_time )
+FROM flights GROUP BY aircraft;
+</b></codeblock> </example>
+
+
+</refbody>
+</reference>
+

Propchange: db/derby/docs/trunk/src/ref/rrefsqljstddevpop.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/docs/trunk/src/ref/rrefsqljstddevsamp.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljstddevsamp.dita?rev=1696051&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljstddevsamp.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljstddevsamp.dita Sat Aug 15 13:33:36 2015
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at      
+
+http://www.apache.org/licenses/LICENSE-2.0  
+
+Unless required by applicable law or agreed to in writing, software  
+distributed under the License is distributed on an "AS IS" BASIS,  
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
+See the License for the specific language governing permissions and  
+limitations under the License.
+-->
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<reference id="rrefsqljstddevsamp" xml:lang="en-us">
+<title>STDDEV_SAMP function</title>
+<shortdesc>STDDEV_SAMP is an aggregate function that evaluates the
+ sample deviation of an expression over a set of rows.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>STDDEV_SAMP aggregate function</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section><p>See <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>
for more
+information about these functions.</p>
+<p>STDDEV_SAMP is allowed only on expressions that evaluate to numeric data
+types.</p></section>
+
+<refsyn><title>Syntax</title>
+<codeblock><b>STDDEV_SAMP ( <i>expression</i> )</b></codeblock>
+
+<p>The <i>expression</i> can contain multiple
+column references or expressions, but it cannot contain another aggregate
+or subquery. It must evaluate to a built-in numeric data type. If an expression
+evaluates to NULL, the aggregate skips that value.</p> <p>The resulting data
+type is DOUBLE (it might overflow).</p> </refsyn>
+
+<example id="rrefstddevpopformula"><title>Formula</title>
+
+<p>
+Sample deviation is calculated as follows:
+</p>
+
+<codeblock><b>
+sqrt( var_samp() )
+</b></codeblock> </example>
+
+<example><title>Example</title>
+<codeblock><b>-- find the sample deviation in flight time per aircraft
+SELECT AIRCRAFT, STDDEV_SAMP( flying_time )
+FROM flights GROUP BY aircraft;
+</b></codeblock> </example>
+
+
+</refbody>
+</reference>
+

Propchange: db/derby/docs/trunk/src/ref/rrefsqljstddevsamp.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/docs/trunk/src/ref/rrefsqljvarpop.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljvarpop.dita?rev=1696051&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljvarpop.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljvarpop.dita Sat Aug 15 13:33:36 2015
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at      
+
+http://www.apache.org/licenses/LICENSE-2.0  
+
+Unless required by applicable law or agreed to in writing, software  
+distributed under the License is distributed on an "AS IS" BASIS,  
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
+See the License for the specific language governing permissions and  
+limitations under the License.
+-->
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<reference id="rrefsqljvarpop" xml:lang="en-us">
+<title>VAR_POP function</title>
+<shortdesc>VAR_POP is an aggregate function that evaluates the
+ population variance of an expression over a set of rows.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>VAR_POP aggregate function</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section><p>See <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>
for more
+information about these functions.</p>
+<p>VAR_POP is allowed only on expressions that evaluate to numeric data
+types.</p></section>
+
+<refsyn><title>Syntax</title>
+<codeblock><b>VAR_POP ( <i>expression</i> )</b></codeblock>
+
+<p>The <i>expression</i> can contain multiple
+column references or expressions, but it cannot contain another aggregate
+or subquery. It must evaluate to a built-in numeric data type. If an expression
+evaluates to NULL, the aggregate skips that value.</p> <p>The resulting data
+type is DOUBLE (it might overflow).</p> </refsyn>
+
+<example id="rrefvarpopformula"><title>Formula</title>
+
+<p>
+Population variance is calculated as follows:
+</p>
+
+<codeblock><b>
+sum(x<sub>i</sub><sup>2</sup>)/n - m<sup>2</sup>
+
+where
+
+n is the number of items in the population
+m is the population average
+x<sub>1</sub> ... x<sub>n</sub> are the items in the population
+</b></codeblock> </example>
+
+<example><title>Example</title>
+<codeblock><b>-- find the variance in flight time per aircraft
+SELECT AIRCRAFT, VAR_POP( flying_time )
+FROM flights GROUP BY aircraft;
+</b></codeblock> </example>
+
+
+</refbody>
+</reference>
+

Propchange: db/derby/docs/trunk/src/ref/rrefsqljvarpop.dita
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/docs/trunk/src/ref/rrefsqljvarsamp.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljvarsamp.dita?rev=1696051&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljvarsamp.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljvarsamp.dita Sat Aug 15 13:33:36 2015
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at      
+
+http://www.apache.org/licenses/LICENSE-2.0  
+
+Unless required by applicable law or agreed to in writing, software  
+distributed under the License is distributed on an "AS IS" BASIS,  
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
+See the License for the specific language governing permissions and  
+limitations under the License.
+-->
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<reference id="rrefsqljvarsamp" xml:lang="en-us">
+<title>VAR_SAMP function</title>
+<shortdesc>VAR_SAMP is an aggregate function that evaluates the
+ sample variance of an expression over a set of rows.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>VAR_SAMP aggregate function</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section><p>See <xref href="rrefsqlj33923.dita#rrefsqlj33923"></xref>
for more
+information about these functions.</p>
+<p>VAR_SAMP is allowed only on expressions that evaluate to numeric data
+types.</p></section>
+
+<refsyn><title>Syntax</title>
+<codeblock><b>VAR_SAMP ( <i>expression</i> )</b></codeblock>
+
+<p>The <i>expression</i> can contain multiple
+column references or expressions, but it cannot contain another aggregate
+or subquery. It must evaluate to a built-in numeric data type. If an expression
+evaluates to NULL, the aggregate skips that value.</p> <p>The resulting data
+type is DOUBLE (it might overflow).</p> </refsyn>
+
+<example id="rrefvarsampformula"><title>Formula</title>
+
+<p>
+Sample variance is calculated as follows:
+</p>
+
+<codeblock><b>
+[ sum(x<sub>i</sub><sup>2</sup>) - sum(x<sub>i</sub>)<sup>2</sup>/n
]/(n-1)
+
+where
+
+n is the number of items in the population
+x<sub>1</sub> ... x<sub>n</sub> are the items in the population
+</b></codeblock> </example>
+
+<example><title>Example</title>
+<codeblock><b>-- find the sample variance in flight time per aircraft
+SELECT AIRCRAFT, VAR_SAMP( flying_time )
+FROM flights GROUP BY aircraft;
+</b></codeblock> </example>
+
+
+</refbody>
+</reference>
+

Propchange: db/derby/docs/trunk/src/ref/rrefsqljvarsamp.dita
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message