# google-big-queryHow can I calculate the median value using Google BigQuery?

Calculating the median value using Google BigQuery is relatively simple. To calculate the median, you can use the `PERCENTILE_CONT`

function. This function takes two arguments, the first being the expression which will be used to calculate the median, and the second being the percentile which is 0.5 to calculate the median.

For example, the following code will calculate the median `salary`

value from the `employees`

table:

```
SELECT PERCENTILE_CONT(salary, 0.5) AS median_salary
FROM employees;
```

The output of this code will be the median salary of the employees table:

```
median_salary
45000
```

The code consists of the following parts:

`SELECT`

- This statement specifies the columns or expressions that are returned by the query.`PERCENTILE_CONT`

- This function takes two arguments, the first being the expression which will be used to calculate the median, and the second being the percentile which is 0.5 to calculate the median.`AS median_salary`

- This statement specifies the column name of the output.

For more information on the `PERCENTILE_CONT`

function, please see the documentation.

### More of Google Big Query

- How can I use Google Big Query to integrate with Zephyr?
- How do I use Google Big Query with Zoom?
- How can I use Google Big Query to count the number of zeros in a given dataset?
- How do I use Google Big Query to zip files?
- ¿Cuáles son las ventajas y desventajas de usar Google BigQuery?
- How can I export data from Google Big Query to an XLSX file?
- How can I use Google BigQuery to retrieve data from a specific year?
- How do I use the YEAR function in Google BigQuery?
- How do I set up a Google Big Query zone?
- How do I query Google BigQuery using XML?

See more codes...