Queries/healthdb.sql
Costas K 8a4af4c33e
IOS
2019-06-18 17:22:10 +03:00

28 lines
963 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

select
-- iPhone 7 (9.3.1)
sources.name,
case datatype_source_order.data_type -- https://www.sans.org/cyber-security-summit/archives/file/summit-archive-1528385073.pdf
when 3 then 'Weight'
when 5 then 'Heart Rate'
when 7 then 'Steps'
when 8 then 'Distance'
when 9 then 'Resting Energy'
when 10 then 'Active Energy'
when 12 then 'Flights Climbed'
when 67 then 'Weekly Calorie Goal'
when 70 then 'Watch On'
when 75 then 'Standing'
when 76 then 'Activity'
when 79 then 'Workout'
when 83 then 'Some workouts'
else datatype_source_order.data_type -- 20s ~ 30s = Nutrition
end as 'DataType',
subscription_data_anchors.last_anchor,
datatype_source_order.ROWID,
datatype_source_order.user_preferred,
datatype_source_order.provenance
from datatype_source_order
join sources on datatype_source_order.source = sources.ROWID
join subscription_data_anchors on subscription_data_anchors.code = datatype_source_order.data_type