-
Notifications
You must be signed in to change notification settings - Fork 0
/
9924.sql
40 lines (29 loc) · 1.49 KB
/
9924.sql
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
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
Find libraries who haven't provided the email address in circulation year 2016 but their notice preference definition is set to email
https://platform.stratascratch.com/coding/9924-find-libraries-who-havent-provided-the-email-address-in-2016-but-their-notice-preference-definition-is-set-to-email?code_type=3
Difficulty: Easy
Find libraries who haven't provided the email address in circulation year 2016 but their notice preference definition is set to email.
Output the library code.
Tables:
<lyft_drivers>
| Column | Data Type |
|-----------------------------------|------------|
| patron_type_code | int |
| patron_type_definition | varchar |
| total_checkouts | int |
| total_renewals | int |
| age_range | varchar |
| home_library_code | varchar |
| home_library_definition | varchar |
| circulation_active_month | varchar |
| circulation_active_year | float |
| notice_preference_code | varchar |
| notice_preference_definition | varchar |
| provided_email_address | bool |
| year_patron_registered | int |
| outside_of_county | bool |
| supervisor_district | float |
*/
select DISTINCT home_library_code
from library_usage
where notice_preference_definition = "email" && provided_email_address = "true";