Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Returning all data from a table
Select some columns
Filtering rows
6. Conditional operators
Logic
Text patterns
To be or NULL to be
A bit of mathematics
Let's practice

Instruction

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

SELECT
  *
FROM User
WHERE Age < 20;

Instead of the equality operator (=), we used the less‐than operator (<). Now, our instruction selects only those users who are younger than 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 that cost more than 10,000.

Stuck? Here's a hint!

Type:

SELECT
  *
FROM Car
WHERE Price > 10000;