Given a table, you can select a subset of records.
Use the SELECT query combined with the WHERE clause to do that.
The WHERE clause will filter the records to those that match the condition.
You may like:
Learning SQL: Master SQL Fundamentals
You can select all records from a table using this query
SELECT * FROM table;
But what if you don’t want all records? You can select a specific record like this:
SELECT * FROM table WHERE id = 3;
This can work with any column from a table, e.g.
SELECT * FROM table WHERE age > 21;
You can combine this with other conditions:
SELECT * FROM table WHERE age > 21 AND age < 70;
You can use the WHERE clause to filter results. The WHERE clause can be used not only on the SELECT query but also on the UPDATE and DELETE query.
Some quick examples to get the idea:
If you want to delete a record:
DELETE FROM table WHERE id=3;
To use with the update query:
UPDATE table SET column = 'value' WHERE ID = 2;
Video tutorial of the WHERE clause