SQLite WHERE Clause
Overview
The SQLite WHERE clause filters the rows a query returns based on a specified condition(s). We can specify conditions while fetching the data from one table or multiple tables. If the given condition is satisfied, it returns the row from the table in the query results.
SQLite WHERE Clause
The WHERE clause is commonly used in SELECT, UPDATE, and DELETE statements. We use the WHERE clause to filter and fetch only necessary records from the table.
The general basic syntax of the WHERE clause in the SELECT statement is as follows:
SELECT column1, column2, …
FROM table_name
WHERE condition(s);
Example
Let’s look at a simple example that uses the WHERE clause. In this example, we use the WHERE clause to filter
the employee table records to fetch only the employees who earn more than 6000 salary.
sqlite>
sqlite> SELECT ename , salary FROM emp
…> WHERE salary > 6000 ;
—
SQLite Tutorials
SQLite tutorials on this website:
https://www.testingdocs.com/sqlite-database-tutorials/
For more information on SQLite, visit the official website: