Syntax:
EXTRACT(unit FROM date)

The EXTRACT() function uses the same kinds of unit specifiers as
DATE_ADD() or DATE_SUB(), but extracts parts from the date rather than
performing date arithmetic. For information on the unit argument, see
https://dev.mysql.com/doc/refman/8.0/en/expressions.html#temporal-inter
vals. Returns NULL if date is NULL.

URL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

