Window functions can be used in various ways. Let's get to grips with each one of them in the following sections. For these examples to work, you need to add hire_date_year virtual column
mysql> ALTER TABLE employees ADD hire_date_year YEAR AS (YEAR(hire_date)) VIRTUAL;