Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Covarpop #5340

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
Title: 'MySQL: COVAR_POP() function'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Title: 'MySQL: COVAR_POP() function'
Title: 'MySQL: COVAR_POP() function'

According to the documentation standards, the file name should be the same as the title, but lowercase, with dashes instead of spaces, and all punctuation removed, and here the title name is different from the file name.

Description: 'Covariance built-in function calculates the covariance of two variables in a population from a table.'
Subjects:
- 'Code Foundations'
- 'Data Science'
Tags:
- 'Comparison'
- 'Database'
- 'MySQL'
CatalogContent:
- 'learn-sql'
- 'paths/analyze-data-with-sql'
- 'paths/data-science'
- 'paths/data-science-foundations'
---

The **`COVAR_POP`** function in MYSQL calculates the full covariance between two variables, which returns the result in decimal format. This function is different from `COVAR_SAMP`, which calculates the sample covariance.


## Subsection 1

The text for the command is SELECT COVAR_POP(y,x).
The y is the independent variable and the x is the dependent.


## Codebyte Example (if applicable)

SELECT COVAR_POP(weight, warehouse_inventory)
FROM warehouse_13_tab

We can currently support:

- Python
- JavaScript
- Ruby
- C++
- C#
- Go
- PHP

See [content-standards.md](https://github.com/Codecademy/docs/blob/main/documentation/content-standards.md) for more details!

```codebyte/js
# Example runnable code block.
console.log('Hello, World!');
```
Loading