ขอทราบจำนวนคนไข้เพศ m และ item id 51146 ครับ ไม่จำเป็นต้องใช้ตารางทั้งหมดครับ
give me the number of patients whose gender is m and item id is 51146?It is not neccessary to use all the tables.
 prescriptions:  subject_id [ text]  hadm_id [ text]  icustay_id [ text]  drug_type [ text]  drug [ text]  formulary_drug_cd [ text]  route [ text]  drug_dose [ text] 
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.itemid = "51146"