ยาอะไรที่ต้องสั่งจ่ายบ่อยที่สุดสำหรับผู้ป่วย 3 ชนิดที่ได้รับแคลเซียมคาร์บอเนตในเวลาเดียวกันในปีที่แล้ว? ไม่จำเป็นต้องใช้ทุกตาราง
what were the three most commonly prescribed drugs for patients, who were also prescribed with calcium carbonate at the same time in the previous year?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 t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'calcium carbonate' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, prescriptions.drug, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE DATETIME(t1.startdate) = DATETIME(t2.startdate) GROUP BY t2.drug) AS t3 WHERE t3.c1 <= 3