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

Instruction

Excellent! Of course, OR isn't the only logical operator out there. Take a look at the next example:

SELECT
  Id,
  Name
FROM User
WHERE Age < 70
  AND Age > 13;

AND is another logical operator.

In this case, only users older than 13 and younger than 70 will be selected. In other words, with the AND operator, both conditions must be fulfilled to retrieve a particular row.

Exercise

Select the Vin of all cars produced after 1999 and cheaper than 7,000.

Stuck? Here's a hint!

Type:

SELECT
  Vin
FROM Car
WHERE ProductionYear > 1999
  AND Price < 7000;