Skip to content

Commit c5228f2

Browse files
committed
task: #1527
1 parent e8a7216 commit c5228f2

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Have a good contributing!
6060
- [1378. Replace Employee ID With The Unique Identifier](./leetcode/easy/1378.%20Replace%20Employee%20ID%20With%20The%20Unique%20Identifier.sql)
6161
- [1407. Top Travellers](./leetcode/easy/1407.%20Top%20Travellers.sql)
6262
- [1484. Group Sold Products By The Date](./leetcode/easy/1484.%20Group%20Sold%20Products%20By%20The%20Date.sql)
63+
- [1527. Patients With a Condition](./leetcode/easy/1527.%20Patients%20With%20a%20Condition.sql)
6364
- [1581. Customer Who Visited but Did Not Make Any Transactions](./leetcode/easy/1581.%20Customer%20Who%20Visited%20but%20Did%20Not%20Make%20Any%20Transactions.sql)
6465
- [1587. Bank Account Summary II](./leetcode/easy/1587.%20Bank%20Account%20Summary%20II.sql)
6566
- [1633. Percentage of Users Attended a Contest](./leetcode/easy/1633.%20Percentage%20of%20Users%20Attended%20a%20Contest.sql)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
Question 1527. Patients With a Condition
3+
Link: https://leetcode.com/problems/patients-with-a-condition/description/?envType=study-plan-v2&envId=top-sql-50
4+
5+
Table: Patients
6+
7+
+--------------+---------+
8+
| Column Name | Type |
9+
+--------------+---------+
10+
| patient_id | int |
11+
| patient_name | varchar |
12+
| conditions | varchar |
13+
+--------------+---------+
14+
patient_id is the primary key (column with unique values) for this table.
15+
'conditions' contains 0 or more code separated by spaces.
16+
This table contains information of the patients in the hospital.
17+
18+
19+
Write a solution to find the patient_id, patient_name, and conditions of the patients who have Type I Diabetes. Type I Diabetes always starts with DIAB1 prefix.
20+
21+
Return the result table in any order.
22+
*/
23+
24+
SELECT
25+
patient_id,
26+
patient_name,
27+
conditions
28+
FROM Patients
29+
WHERE conditions LIKE '% DIAB1%' OR conditions LIKE 'DIAB1%'

0 commit comments

Comments
 (0)