Write a SQL statement to calculate year-over-year growth metrics from raw event logs.
Use the provided event log and event type data. Include only event types and years with a matching prior calendar year.
event_type_name, event_year, event_count, prior_year_count, yoy_change, and yoy_growth_pct.event_type_name, then event_year ascending.| Column | Type | Description |
|---|---|---|
| event_type_idPK | INT | Unique event type identifier |
| event_type_name | VARCHAR(100) | Readable event type name |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique raw event identifier |
| event_type_id | INT | Referenced event type identifier |
| occurred_at | TIMESTAMP | Timestamp when the event occurred |