How do you approach data modeling for new product features?
Use the provided feature, status history, and project relationship data to produce a concise feature-level view. Include features even when they have no status history or project assignments.
Output
- One row per feature with
feature_id, feature_name, current_status, project_count, and lifecycle_stage.
- Order by
feature_id ascending.
Output details
- Use the status with the latest
status_date, breaking ties by greatest status_history_id.
- Set
current_status to NULL when a feature has no status history.
- Map
NULL status to not_started; map proposed, beta, active, and deprecated to planned, validation, launched, and retired.
- Map any other status to
unknown.
- Count project assignments, returning
0 when a feature has none.