Filtering out nulls
One way to deal with nulls is to simply filter them out. There are two important conditionals related to nulls:
IS NULLis true for any value that is null.IS NOT NULLis true for any value that is not null. Note that a zero or a blank cell is not the same as a null.
These conditionals can be leveraged by several clauses, such as CASE statements, WHERE statements, and HAVING statements. In this exercise, you will learn how to filter out nulls using two separate techniques.
Feel free to reference the E:R Diagram.
Deze oefening maakt deel uit van de cursus
Reporting in SQL
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
-- Show total gold_medals by country
SELECT
____,
____ AS gold_medals
FROM ____ AS w
JOIN ____ AS c
ON ____
GROUP BY ____
-- Order by gold_medals in descending order
ORDER BY ____;