Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Patients on Multiple Drugs

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.