See the whole table
Select some columns
Filtering rows
6. Conditional operators
Logic
Text patterns
To be or NULL to be
A little bit of mathematics
Let's practice

Instruction

Good job! Now, apart from the equality sign (=), there are also some other conditional operators which you can use. Look at the next example.

SELECT
  * 
FROM user 
WHERE age < 20;

Instead of the equality sign (=), we put the less than sign (<). Now our instruction selects only those users who are below 20. We can apply quite a few operators in the same way:

  • < (less than),
  • > (greater than),
  • <= (less than or equal),
  • >= (greater than or equal).

Easy, right? Why don't we practice it a bit?

Exercise

Select all columns for all cars with price higher than 10 000.

Stuck? Here's a hint!

Type:

SELECT
  * 
FROM car 
WHERE price > 10000;