text: -- file:window.sql ln:130 expect:true
  SELECT empno, depname, salary, bonus, depadj, MIN(bonus) OVER (ORDER BY empno), MAX(depadj) OVER () FROM(
  	SELECT *,
  		CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(YEAR FROM enroll_date) END * 500 AS bonus,
  		CASE WHEN
  			AVG(salary) OVER (PARTITION BY depname) < salary
  		THEN 200 END AS depadj FROM empsalary
  )s
  