> For the complete documentation index, see [llms.txt](https://dshub.gitbook.io/ds-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dshub.gitbook.io/ds-hub/sql/sql-practice/popular-websites-for-sql-practice/hackerrank/sql-basic/revising-aggregations-the-sum-function.md).

# Revising Aggregations - The Sum Function

[Question Link](https://www.hackerrank.com/challenges/revising-aggregations-sum/problem?isFullScreen=true)

Query the total population of all cities in **CITY** where *District* is **California**.&#x20;

**Input Format**

The **CITY** table is described as follows:

![](https://s3.amazonaws.com/hr-challenge-images/8137/1449729804-f21d187d0f-CITY.jpg)

```sql
SELECT SUM(population)
FROM City
WHERE district = 'California'
```
