instruction: tell me the three most common medical diagnoses until 3 years ago?
response: SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3