The WHERE clause helps limit the results of your queries. For example, if you only wanted to see players with more than 40 appearances in games, you can create a WHERE clause to include only those players that meet the criteria.
Using the WHERE clause
Understanding how and when to use the WHERE clause to limit query results
The WHERE clause is placed after the FROM clause in a SELECT query. Using the example of players with more than 40 appearances in games, you can execute the following query:
USE lahmansbaseballdb;
SELECT playerid, g_all, g_batting, g_defense FROM appearances
WHERE g_all > 40;
The criterion we are setting in the WHERE clause (for example, g_all > 40) is called an expression. There are different expression...