ยาสี่ชนิดที่พบบ่อยที่สุดที่สั่งจ่ายในโรงพยาบาลเดียวกันพบผู้ป่วยอายุ 30 ปีตั้งแต่ 5 ปีที่แล้วหลังจากได้รับการวินิจฉัยว่าเป็น s/p exploratory laparotomy ไม่จำเป็นต้องใช้ตารางทั้งหมด
what is the four most frequent drugs that were prescribed in the same hospital encounter to the patients of age 30s since 5 years ago after having been diagnosed with s/p exploratory laparotomy.It is not neccessary to use all the tables.
 lab:  labid [ number]  patientunitstayid [ number]  labname [ text]  labresult [ number]  labresulttime [ time] 
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p exploratory laparotomy' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.age BETWEEN 30 AND 39 AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-5 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 4