นับจำนวนยาหนึ่งเดือนก่อนสั่งยา 012-63986 ไม่จำเป็นต้องใช้ทุกตาราง
count the number of drugs a month before patient 012-63986 was prescribed.It is not neccessary to use all the tables.
 treatment:  treatmentid [ number]  patientunitstayid [ number]  treatmentname [ text]  treatmenttime [ time] 
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63986')) AND DATETIME(medication.drugstarttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month')