An observability pipeline stores one row per API request:
api_latencies (
request_id INTEGER PRIMARY KEY,
endpoint TEXT,
latency_ms INTEGER
)
SQLite has no MEDIAN() or PERCENTILE() function. Write a SQL query that
computes the median latency per endpoint:
- odd number of requests: the middle value
- even number of requests: the average of the two middle values
Report the median rounded to 1 decimal place.
Return columns: endpoint, median_ms.
Order by endpoint ASC.