Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer De SUM() Functie | Aggregatiefuncties
Inleiding tot SQL

book
De SUM() Functie

SUM() retourneert het totaal van alle waarden in een gegeven kolom.

Hier is een voorbeeld:

SELECT SUM(population)
FROM country
WHERE continent='Asia';
123
SELECT SUM(population) FROM country WHERE continent='Asia';
copy

De SUM() functie berekent de totale bevolking van alle Aziatische landen die in de country tabel worden gevonden.

Hier is de country tabel waarmee we werken:

Taak

Swipe to start coding

Schrijf een SQL-query die de som van de surfacearea van landen uit 'Europa' retourneert.

Oplossing

SELECT SUM(surfacearea)
FROM country
WHERE continent='Europe';

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 5. Hoofdstuk 8

Query ResultQuery Result
No query executed yet...

Vraag AI

expand
ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt