Instruction
Super! Now, let's see how we can manipulate dates, times, and timestamps. PostgreSQL provides a special function:
DATE_PART(part, source)
Here part is one of the following: day, month, year, hour, minute, second, etc. And source is one of the date and time data types.
Take a look:
SELECT DATE_PART('year', launched_timestamp) AS year
FROM aircraft
ORDER BY year;
The above query will extract the year from the column launched_timestamp for each aircraft and will show it in ascending order.
Exercise
For each aircraft show the id, the withdrawn_timestamp column and the withdrawn_month column (extracted month from the withdrawn_timestamp column).
Stuck? Here's a hint!
Use this expression:
DATE_PART('month', withdrawn_timestamp) AS withdrawn_month


