Project: Okul Database · Hub: Okul Database — Reference
Reference: School Badges (school_badges)
Badges are awarded to schools based on engagement rank within their district + school type combination.
Badge Types (from configs, type = 'school_badge_type')
| item_id | item_value | English | Criteria |
|---|---|---|---|
| 1 | MOST_COMMENTED | Most Reviewed | Top schools by comment count in their district + school_type |
| 2 | MOST_CONTACTED | Most Contacted | Top schools by lead count in their district + school_type |
| 3 | MOST_VIEWED | Most Viewed | Top schools by view count in their district + school_type |
school_badges Table Schema
school_id INT — FK → schools
badge_type INT — 1, 2, or 3 (from config above)
awarded_at TIMESTAMP
deleted_at TIMESTAMP NULLABLEImportant Note on Badge Analysis
Exclude test leads when computing MOST_CONTACTED badges:
-- Badge eligibility uses: leads WHERE is_test = 0 OR is_test IS NULLBadges are recomputed periodically. school_filters has pre-computed badge flags:
has_most_commented_badgehas_most_contacted_badgehas_most_viewed_badge
Related
- table-school-filters — badge flag columns (denormalized)
- domain-schools — Schools domain