Learn with Abdou

Chapter 10 · Concept 4 of 5 · Practice

The audit calls every row excluded

source = loaded + excluded, counted independently · level 1 of 6

Opening your saved work…

Sign in to save across devices → · Download your guest work before switching accounts.

The audit calls every row excluded · source = loaded + excluded, counted independently · level 1 of 6

One decision per source row

Level 1: Watch it answered · Exercise 1 of 1

How did the load decide? Count load_audit's rows by decision, in decision order.

Data: Trail Gear: build rehearsal.

Why it works, clause by clause

  1. load_audit holds one row per staged row, so its rows are the source rows, each with the decision the load made.
  2. GROUP BY decision: one output row per decision, Excluded 3 and Loaded 3.
  3. These counts come from the decisions themselves, not from a subtraction. The next question is whether items really holds the three marked Loaded.

From the reading: Count every population on its own, paragraph 2

The queryOpening the database…
SELECT decision, COUNT(*) AS source_rows
FROM load_audit
GROUP BY decision
ORDER BY decision;
Open in the playground

Query results

Run it to see the result here.

Run it to see the result here.

Practice here is evidence for you and your instructor, never a grade. Grades live in Canvas.