Find Patients with a Condition using MySQL Wildcard
Intuition\n Describe your first thoughts on how to solve this problem. \nWe need to find patients with Type I Diabetes.\n\n- Type I Diabetes always starts with 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe need to find patients with Type I Diabetes.\n\n- Type I Diabetes always starts with `DIAB1` prefix.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Select specific columns from the table.\n\n    > `SELECT` \u2192 This command retrieves data from a database\n\n    > Asterisk (`*`) \u2192 This symbol specifies that the query should return all columns of the queried tables\n\n2. Filter the results to include only those patients with `DIAB1` prefix.\n\n    > `WHERE` \u2192 This command filters a result set to include only records that fulfill a specified condition\n\n    > `OR` \u2192 This operator displays a record if any of the conditions separated by it are `TRUE`\n\n    > `LIKE` \u2192 This operator searches for a specified pattern in a column\n\n    > `%` \u2192 This symbol (wildcard) matches any sequence of characters\n\n    > `wildcard characters` \u2192 These characters are used to substitute one or more characters in a string\n\n# Complexity\n- Time complexity: $O(n)$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n`n` is the number of rows in the table. This is because the query processes each row in the table to check the conditions.\n\n# Code\n```\n# Write your MySQL query statement below\nSELECT *\nFROM Patients\nWHERE conditions LIKE \'% DIAB1%\' OR \n      conditions LIKE \'DIAB1%\'\n```
['MySQL']