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

Instruction

Good. As you can see, dates are shown in the following format: YYYY-MM-DD. First we provide the year, then the month, finally the day. Be aware, though, that some databases may use other formats, depending on the database configuration. If we want to use dates in our queries, then we need to provide them within apostrophes:

SELECT
  id,
  model
FROM aircraft
WHERE produced = '2012-04-05';

The above query will select the id and model of all the aircraft produced on April 5, 2012.

Exercise

Select the columns id, model and produced for those aircraft which were produced on April 6, 2008 or March 1, 2010.

Stuck? Here's a hint!

You will need two conditions joined by OR. Remember to use the proper date format and to use apostrophes: 'YYYY-MM-DD'.