Patients on Multiple Drugs
Medium
Pharmacy & Prescriptions
Return the names of patients who have been prescribed at least two different drugs. Order by name.
Table schema
Patients(patient_id INT PRIMARY KEY, name VARCHAR(30))
Prescriptions(rx_id INT PRIMARY KEY, patient_id INT, drug_id INT, qty INT, rx_date DATE)Sample data
Patients
patient_id | name
1 | Asha
2 | Ben
3 | Chitra
Prescriptions
rx_id | patient_id | drug_id | qty | rx_date
1 | 1 | 1 | 10 | 2026-01-05
2 | 1 | 2 | 2 | 2026-01-20
3 | 2 | 3 | 1 | 2026-01-12
4 | 2 | 1 | 6 | 2026-02-03
5 | 1 | 1 | 4 | 2026-02-10
6 | 3 | 3 | 2 | 2026-02-14
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.