How would you write SQL queries for different business scenarios?
Use the provided TikTok creator, video, and event data. Write one PostgreSQL query that evaluates creators with at least two public videos published in June 2025 and measures their June event performance.
Output
- One row per qualifying creator.
- Columns:
display_name, eligible_video_count, total_views, engagement_rate_pct, and creator_rank.
- Include views, likes, and shares from June 2025 only. Calculate engagement rate as
(likes + shares) / views * 100, rounded to two decimals.
- Order by
creator_rank, then creator_id ascending for deterministic ties.