Sometimes we want to filter data that has a specific filter, for these cases we use the WHERE clause.
Structure:
SELECT column_name1, column_name2 FROM table_name WHERE condition;
Example:
SELECT name
FROM Customer
WHERE hair = 'blonde';
We have this data in the table Customer:
CUSTOMERID | NAME | HAIR | SALARY |
---|---|---|---|
1 | Alechandro | brown | 100 |
2 | Katerina | blonde | 150 |
3 | Lucie | blonde | 30 |
4 | Thomas | black | 40 |
5 | Theodor | black | 120 |
6 | Thomassino | black | 99 |
7 | Knor | brown | 50 |
8 | Thor | blonde | 10 |
9 | Lucie | pink | 70 |
Result:
Names that meet this condition are selected from the table, ie. Katerina, Lucie and Thor.
NAME |
---|
Katerina |
Lucie |
Thor |
I give people clear, functional, and proven instructions. I gently guide them so that they can fulfill their IT dreams.
I do agree with
all the ideas you’ve introduced for your post. They’re really
convincing and can certainly work.
Still, the posts are very quick
for novices. May
just you please lengthen them a bit from next time?
Thank you for the post.
Hi Ali,
thank you for the comment. This article is an introduction to the issue. If you are interested in SQL more, an e-book is available, but it is explained in even more detail in the online course, which will be available here, on this website next week. In the online course, the whole SQL is gradually presented from the beginning, including illustrative videos and practical exercises.
Have a nice day,
CR