SQL WHERE Tutorial

SQL Tutorial: WHERE Statement with Example

This tutorial walks through the basics of the WHERE statement in SQL and an example of how to use it.

WHERE Statement

  • 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

Example

Let’s say we have a basketball league and we keep records of each player, which team they are on, and their basic statistics. 

Stats Table

If we wanted to use a SQL query to find all the players with more than 10 points, we would write the following:

SQL WHERE statement

Once we hit enter and run, our result should be as follows:

SQL WHERE Result

How to Learn SQL

Master SQL with hands-on training. SQL is one of the most in-demand programming languages and is used across a variety of professions.

Yelp Facebook LinkedIn YouTube Twitter Instagram