SQL where clause with query example – Where clause in SQL is used to fetch records on the basis of some condition.
List the books whose cost is greater than 400.
Delete the book whose price is less than 100.
Update the book value price where the price is equal to 500 etc.
- WHERE condition is used to filter the data from the table when using SELECT statement, Update statement and DELETE statement.
- WHERE can be used with single or multiple conditions.
SQL WHERE Syntax
SELECT [column_1],…. FROM [Table_name]
SQL WHERE Example
Find the titles where price greater than 400 from books table.
SELECT TITLE FROM BOOKS WHERE PRICE > 400;
|PRIDE AND PREJUDICE|