The SELECT command is used to read data and the WHERE command is used to adding a condition on the SELECT statement.
Syntax:
SELECT * FROM table_name;
Example:
SELECT * FROM employees;
Syntax:
SELECT column1, column2, ....
FROM table_name;
Example:
SELECT city, name
FROM employees;
Syntax:
SELECT column1, column2, ....
FROM table_name
WHERE condition;
Example:
SELECT city, name
FROM employees
WHERE id = 2;
SELECT * FROM employees WHERE id > 2 ALLOW FILTERING;
Using ALLOW FILTERING is very bad for performance. So we should try to avoid using ALLOW FILTERING.