Aller au contenu principal

Support Queue SLA: Pick the Query Shape

Choose a query shape that joins the right entities, filters source rows first, then aggregates at the requested grain.

SQL basics5 min read

The support lead needs breached tickets by channel before the standup. Which query shape should Rina use for a reliable SLA-by-channel number? Start from ticket-level SLA facts, join channel names, filter to yesterday's eligible tickets in WHERE, then GROUP BY channel. Right. The source rows match the entity being counted, the row filter defines the evidence before aggregation, and GROUP BY creates one output row per channel. Join tickets to all messages first, then count rows by channel because every message proves work happened. Weaker. That violates the grain: message rows can multiply a ticket, so COUNT() would measure ticket-message…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

What you’ll learn

Choose a query shape that joins the right entities, filters source rows first, then aggregates at the requested grain.

About this lesson

Format: scenario snapshot. Estimated lesson time: 5 minutes. Skill: sql-basics.

Explore related skills or browse lessons by role and format.

Related lessons

Bring daily learning to your team

Nous contacter