-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path019.sql
More file actions
27 lines (22 loc) · 668 Bytes
/
019.sql
File metadata and controls
27 lines (22 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Q: Show patient_id and first_name from patients where their first_name start and ends with 's' and is at least 6 characters long.
Table Info: patients
+--------------+----------+
| Column Name | Type |
+--------------+----------+
| patient_id | INT |
| first_name | TEXT |
| last_name | TEXT |
| gender | CHAR(1) |
| birth_date | DATE |
| city | TEXT |
| province_id | CHAR(2) |
| allergies | TEXT |
| height | INT |
| weight | INT |
+--------------+----------+
*/
-- SOLUTION:
select patient_id, first_name
from patients
where first_name like 's%s'
and length(first_name) >= 6;