See the whole table
Select some columns
Filtering rows
Logic
Text patterns
To be or NULL to be
A little bit of mathematics
Let's practice
22. Put your skills into practice

Instruction

Pretty good! Now let's put together all the information we've learnt so far. Let's imagine a customer who walks in and wants to know if we have any cars that meet his needs.

Exercise

Select all columns of those cars that:

  • were produced between 1999 and 2003,
  • are not Volkswagens,
  • their model begins with either 'P' or 'T',
  • have their price set.

Stuck? Here's a hint!

Type:

SELECT *
FROM car 
WHERE production_year BETWEEN 1999 AND 2003
  AND brand != 'Volkswagen'
  AND (model LIKE 'P%' OR model LIKE 'T%')
  AND price IS NOT NULL;