Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dates
7. Dates with logical operators
Time
Timestamps
Extract functions
Timezone conversion
Current date and time
Review

Instruction

Good. It is also quite easy to use dates with logical operators other than the equality sign. Take a look at the following example:

SELECT
  id,
  model,
  produced
FROM aircraft
WHERE produced > '2010-12-31';

In SQL, a date which is "greater than" 2010-12-31 means that you will get all the production dates after that date (i.e., from 2011-01-01 until today). Similarly, putting the "less than" sign instead (<) will show older dates.

Exercise

Select the columns id, model, produced for all the aircraft which were produced after December 31, 2012.

Stuck? Here's a hint!

Remember the proper date format and use apostrophes: 'YYYY-MM-DD'.