SQL WHERE allow us to select the data conditionally according to condition being set when write the command.
The SQL syntax will be:
SELECT [COLUMN NAME] FROM [TABLE NAME] WHERE [CONDITION]
EXAMPLE :
Let's say, we only want to retrieve data from GameScores Table to get person that Scores is more than 2000.
Table GameScores
PlayerName | Department | Scores |
Jason | IT | 3000 |
Irene | IT | 1500 |
Jane | Marketing | 1000 |
David | Marketing | 2500 |
Paul | HR | 2000 |
James | HR | 2000 |
SQL statement :
SELECT PlayerName FROM GameScores WHERE Scores > 2000
Result:
PlayerName |
Jason |
David |