นับจำนวนยาจนเมื่อ 3 ปีที่แล้ว คนไข้สั่งไว้ 62983 ราย ไม่จำเป็นต้องใช้ทุกโต๊ะ
count the number of drugs until 3 years ago patient 62983 was prescribed.It is not neccessary to use all the tables.
 prescriptions:  row_id [ number]  subject_id [ number]  hadm_id [ number]  startdate [ time]  enddate [ time]  drug [ text]  dose_val_rx [ text]  dose_unit_rx [ text]  route [ text] 
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62983) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-3 year')