You are given a table Patients containing information about hospital patients. Each patient has a unique patient_id, a patient_name, and a conditions column that contains medical condition codes separated by spaces.
Your task: Find all patients who have Type I Diabetes. Type I Diabetes codes always start with the prefix DIAB1.
Return the patient_id, patient_name, and conditions for these patients in any order.
Table Schema
| Column Name | Type | Description |
|---|---|---|
patient_id
PK
|
int | Primary key, unique identifier for each patient |
patient_name
|
varchar | Full name of the patient |
conditions
|
varchar | Medical condition codes separated by spaces (can be empty) |
Input & Output
| patient_id | patient_name | conditions |
|---|---|---|
| 1 | Daniel | YFEV COUGH |
| 2 | Alice | |
| 3 | Bob | DIAB100 MYOP |
| 4 | George | ACNE DIAB100 |
| 5 | Alain | DIAB201 |
| patient_id | patient_name | conditions |
|---|---|---|
| 3 | Bob | DIAB100 MYOP |
| 4 | George | ACNE DIAB100 |
| 5 | Alain | DIAB201 |
Patients Bob, George, and Alain have conditions starting with DIAB1. Bob has DIAB100 at the start, George has DIAB100 after a space, and Alain has DIAB201. Daniel and Alice don't have any Type I Diabetes conditions.
| patient_id | patient_name | conditions |
|---|---|---|
| 1 | John | DIAB1 |
| 2 | Jane | XDIAB100 |
| 3 | Mike |
| patient_id | patient_name | conditions |
|---|---|---|
| 1 | John | DIAB1 |
Only John matches because his condition starts with exactly DIAB1. Jane's XDIAB100 doesn't match because DIAB1 is not at the beginning of a word. Mike has no conditions.
Constraints
-
1 ≤ patient_id ≤ 100000 -
patient_nameconsists of uppercase and lowercase letters and spaces -
conditionsconsists of uppercase letters and spaces, separated by single spaces -
Type I Diabetes conditions always start with
DIAB1prefix