Autumn Offers - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dealing with dates
Working with time
Date and time data types in PostgreSQL
Extracting dates and times
Intervals
Timezone conversion
Format date and time
Current date and time data
Summary

Instruction

Good! The query worked this time. Intervals are typically used with BETWEEN to select facts from a given day, month, year etc. Take a look:

SELECT id
FROM aircraft
WHERE produced_date >= '2010-01-01'
  AND produced_date <  '2010-01-01'::date + INTERVAL '1 year';

This query will look for aircraft produced in 2010. Note we needed to cast the string to date with the :: operator in order to add an interval.

Exercise

Show the id and the model for all the aircraft produced in 2014 and 2015.