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
Logic
12. Logical operators – NOT
Text patterns
To be or NULL to be
A bit of mathematics
Let's practice

## Instruction

Keep up the good work! There is one more logical operator worth mentioning: NOT. Basically, the NOT operator negates any condition that comes after it:

SELECT
*
FROM User
WHERE Age NOT BETWEEN 20 AND 30;


In the above example we placed NOT in front of a BETWEEN clause. As a result, we'll get all users except for those aged 20 to 30. In other words, we'll get all users who are younger than 20 or older than 30.

## Exercise

Select the Vin, Brand, and Model of all cars except for those produced between 1995 and 2005.

### Stuck? Here's a hint!

Type:

SELECT
Vin,
Brand,
Model
FROM Car
WHERE ProductionYear NOT BETWEEN 1995 AND 2005;