This tutorial walks through the basics of the WHERE statement in SQL and an example of how to use it.
The WHERE statement is used to filter data from our table.
It sets a condition to be met for data records to be retrieved.
Syntax: SELECT * FROM table WHERE condition
Let’s say we have a basketball league and we keep records of each player, which team they are on, and their basic statistics.
If we wanted to use a SQL query to find all the players with more than 10 points, we would write the following:
Once we hit enter and run, our result should be as follows: