Aan de slagGa gratis aan de slag

Detecting out of range values

Sometimes you can find out of range values in your data. If you don't detect them before analyzing, they can disrupt your results.

The logical operator BETWEEN, and the comparison operators > and <, can help you to detect the rows with out of range values.

The num_ratings column of the series table stores the number of ratings each series has received. The total amount of people surveyed is 5000. However, this column has some out of range values, i.e., there are values greater than 5000 or smaller than 0.

Try to find them!

Deze oefening maakt deel uit van de cursus

Cleaning Data in SQL Server Databases

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

SELECT * FROM series
-- Detect the out of range values
WHERE ___ ___ ___ 0 AND 5000
Code bewerken en uitvoeren