นับจำนวนผู้ที่ได้รับยา tamsulosin hcl 0.4 mg po caps ภายใน 2 เดือนภายหลังการวินิจฉัยอาการเจ็บหน้าอก จนถึงปี 2104 ไม่จำเป็นต้องใช้ทุกตาราง
count the number of people who were prescribed tamsulosin hcl 0.4 mg po caps within 2 months following a diagnosis of chest pain until 2104.It is not neccessary to use all the tables.
 microlab:  microlabid [ number]  patientunitstayid [ number]  culturesite [ text]  organism [ text]  culturetakentime [ time] 
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'tamsulosin hcl 0.4 mg po caps' AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')