-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWH-reports.sql
More file actions
23 lines (21 loc) · 977 Bytes
/
WH-reports.sql
File metadata and controls
23 lines (21 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- Email Campaign Performance --
SELECT CampaignName, Audience, Version, SubjectLine, DeploymentDate,
(EmailsSent - EmailsBounced) AS EmailsDelivered,
EmailsOpened,
EmailsClicked,
(EmailsOpened / (EmailsSent - EmailsBounced)) AS OpenRate,
(EmailsClicked / EmailsOpened) AS ClickToOpenRate,
(EmailsClicked / (EmailsSent - EmailsBounced)) AS ClickRate,
(EmailsUnsubscribed / EmailsOpened) AS UnsubRate
FROM EmailCampaignPerformance
ORDER BY OpenRate DESC, ClickToOpenRate DESC, CampaignName;
-- Account Registration Report --
SELECT MonthName, Month, Year, State, Permission, NumCustomers
FROM AccountDeviceRegistrations
GROUP BY State, MonthName, Month, Year, Permission
ORDER BY Year DESC, Month DESC, State, Permission;
-- Device Registration Report --
SELECT Carrier, MonthName, Month, Year, DeviceModel, NumCustomers
FROM AccountDeviceRegistrations
GROUP BY Carrier, MonthName, Month, Year, DeviceModel
ORDER BY Carrier, Year DESC, Month DESC;