with cte as (select hire_date - lag(hire_date) over (order by hire_date ) hiring_freeze, termination_date-lag(termination_date) over (order by termination_date ) as firing_freeze from uber_employees ) select max(hiring_freeze) max_hire, max(firing_freeze) max_fire from cte