-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_data.sql
More file actions
37 lines (31 loc) · 1.16 KB
/
verify_data.sql
File metadata and controls
37 lines (31 loc) · 1.16 KB
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
-- Quick verification script to check the generated data
-- Check total count
SELECT 'Total Records' as metric, COUNT(*) as value FROM user_report_data;
-- Check status distribution
SELECT 'Status Distribution' as category, status, COUNT(*) as count,
ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM user_report_data), 2) as percentage
FROM user_report_data
GROUP BY status
ORDER BY count DESC;
-- Check report type distribution
SELECT 'Report Type Distribution' as category, report_type, COUNT(*) as count
FROM user_report_data
GROUP BY report_type
ORDER BY count DESC;
-- Check date range
SELECT 'Date Range' as metric,
MIN(created_at) as earliest_record,
MAX(created_at) as latest_record
FROM user_report_data;
-- Sample of PENDING reports (these will be processed by scheduled tasks)
SELECT 'Sample PENDING Reports' as info, id, user_id, report_type, created_at
FROM user_report_data
WHERE status = 'PENDING'
ORDER BY created_at
LIMIT 5;
-- Sample of COMPLETED reports
SELECT 'Sample COMPLETED Reports' as info, id, user_id, report_type, created_at, processed_at
FROM user_report_data
WHERE status = 'COMPLETED'
ORDER BY processed_at DESC
LIMIT 5;