Write a SQL query using different types of joins (inner, left, right, full) to combine patient and prescription records.
Use the provided patients and prescriptions tables. Return a single result that identifies which join produced each row and preserves matched and unmatched records.
join_type, patient_id, patient_name, prescription_id, medication_namejoin_type, then patient_id, then prescription_id, placing NULL identifiers last.| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_name | VARCHAR(100) | Patient full name |
| Column | Type | Description |
|---|---|---|
| prescription_idPK | INT | Unique prescription identifier |
| patient_id | INT | Patient associated with the prescription |
| medication_name | VARCHAR(100) | Prescribed medication name |