L07 / 7 labs AI SQL Red Team
0 / 20 complete
Rookie Analyst 0 XP
+100 XP Mission complete.
Practice Lab · 10 · Evaluate the AI

AI SQL Red Team

An AI-generated query runs and returns a polished answer. Run validation to uncover three analytical bugs.

AI reviewSQL validationMetric logicClaim audit
Case brief

Find the duplicated join, wrong denominator and unsupported causal claim before the result reaches leadership.

01
Your task

Break it. Run the checks. Explain the evidence.

01

Run the failure

Use the red CTA to create the analytical problem intentionally.

02

Predict the result

Before validating, decide what you expect row counts or metrics to do.

03

Run validation

Use the green CTA to reveal the checks that catch the failure.

04

Explain it

Say what broke in plain business language, not only SQL language.

02
Interactive case

Run this.

RUN THIS CASE ↓

AI SQL Red Team

Find the duplicated join, wrong denominator and unsupported causal claim before the result reaches leadership.

15 min Red team 10 · Evaluate the AI
Ready — run the case. Plausible output passes syntax but fails meaning.
AI-generated SQLruns successfully
JOIN status_events e ON o.order_id = e.order_id
WHERE e.event_time >= CURRENT_DATE - 7
COUNT(CASE WHEN e.status='cancelled' THEN 1 END) / COUNT(*)
AS cancellation_rate
AI conclusion“Marketing caused cancellations to rise.”
01Join grain

Events can multiply each order.

02Denominator

Event rows are not eligible orders.

03Claim audit

No causal evidence connects marketing to cancellations.

Three failures found: duplicated grain, wrong denominator, unsupported causal language. The query running successfully is not enough.

Debrief unlocked

What should the analyst learn?

  1. Fluent output is not evidence of correctness.
  2. Validate definitions, grain and claims independently.
  3. AI should accelerate analysis, not bypass analytical review.
03
Transfer

Use the same checks at work.

01

Fluent output is not evidence of correctness.

02

Validate definitions, grain and claims independently.

03

AI should accelerate analysis, not bypass analytical review.