instruction: count the number of patients whose admission type is elective and who were given the drug tramadol (ultram).
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "TraMADOL (Ultram)"