I strongly recommend you to learn the basics of SQL.
It's a very simple stuff to do if you know the very basics as far I understood your question.
Check this extremely simplified tutorials
SQL Tutorial[
^]
I'll not give the direct solution, rather will help you to get it done yourself.
Hints for your solution-
SQL WHERE Clause[
^]
If you still haven't find the solution, come back here and share what you think you forgot to share in the question.
Hope, you'll take the right direction to the solution :)