ระบุจำนวนผู้ป่วยเข้าฉุกเฉินที่มีรหัส icd9 5091 ไม่จำเป็นต้องใช้ทุกตาราง
specify the number of patients admitted to emergency who had icd9 code 5091It is not neccessary to use all the tables.
 lab:  subject_id [ text]  hadm_id [ text]  itemid [ text]  charttime [ text]  flag [ text]  value_unit [ text]  label [ text]  fluid [ text] 
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "5091"