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_iditem_valueEnglishCriteria
1MOST_COMMENTEDMost ReviewedTop schools by comment count in their district + school_type
2MOST_CONTACTEDMost ContactedTop schools by lead count in their district + school_type
3MOST_VIEWEDMost ViewedTop schools by view count in their district + school_type

school_badges Table Schema

school_id   INT — FK → schools
badge_type  INT1, 2, or 3 (from config above)
awarded_at  TIMESTAMP
deleted_at  TIMESTAMP NULLABLE

Important Note on Badge Analysis

Exclude test leads when computing MOST_CONTACTED badges:

-- Badge eligibility uses: leads WHERE is_test = 0 OR is_test IS NULL

Badges are recomputed periodically. school_filters has pre-computed badge flags:

  • has_most_commented_badge
  • has_most_contacted_badge
  • has_most_viewed_badge