Drop links or images here to add them to the editor.

Overzicht commando’s en functies
| Commando/Functie |
Gebruik |
Voorbeeld |
LIMIT n |
Toon alleen de eerste n rijen |
LIMIT 5 |
ORDER BY col ASC |
Sorteer oplopend |
ORDER BY naam ASC |
ORDER BY col DESC |
Sorteer aflopend |
ORDER BY prijs DESC |
DISTINCT |
Toon alleen unieke waarden |
SELECT DISTINCT woonplaats |
COUNT() |
Tel het aantal rijen |
COUNT(bestelcode) |
COUNT(DISTINCT ...) |
Tel unieke waarden |
COUNT(DISTINCT klantnummer) |
MIN() |
Laagste waarde |
MIN(basisprijs) |
MAX() |
Hoogste waarde |
MAX(basisprijs) |
SUM() |
Som van alle waarden |
SUM(korting) |
AVG() |
Gemiddelde van waarden |
AVG(basisprijs) |
Volgorde van SQL-commando’s
SELECT ...
FROM ...
WHERE ... -- optioneel
GROUP BY ... -- optioneel (hoofdstuk 7)
HAVING ... -- optioneel (hoofdstuk 7)
ORDER BY ... -- optioneel
LIMIT ... -- optioneel