DT2: Data quality you can prove

Lesson 2 of 5 · reading 15–25 minutes; practice and project time is on the module page

Profiling a new dataset

🎯You'll be able to

Produce a quick profile of a dataset (counts, distinct values, minimums, maximums, missing values) and spot problems from it.

🏠The everyday picture

A doctor's first check (temperature, pulse, blood pressure) takes two minutes and points to where to look next. A profile does the same for a table.

📘What it really is

📝A worked example

Input:

import duckdb
duckdb.sql("summarize select * from read_csv('raw/orders/2026-10-05.csv', all_varchar=true)").show()

Expected output: one row per column. Three surprises stand out: customer_id has a maximum of TEST, qty a minimum of -1, and sku a maximum of SKU-999. status has 10 distinct values. Because everything was read as text, the maximum is the last value in alphabetical order, which is why TEST shows up there. Checked on 1 November 2026 with DuckDB 2.0.0.

🌍Where it's used

📝Case scenario

A logistics company took over a smaller rival's delivery records. A five-minute profile showed that 12% of delivery dates were 1 January 1900: the rival's system used it for "unknown". Those rows were marked as unknown before the merge, instead of being counted as deliveries made 126 years ago.

🖱️Try it

Run SUMMARIZE on raw/customers.csv read as text. Success: you can name two columns with surprises and say what each one means.

⚠️Common mistakes

🛠️For your project

Your Project 1 notes should start with a profile of the raw order files; each surprise becomes a rule.

✅Quick check

What does a profile show for each column?

Show the answer

Count, missing values, distinct values, minimum, maximum and common values.

Why profile raw data as text?

Show the answer

So you see exactly what arrived, not a guessed conversion.

← PreviousWhat "good data" means
ProLearners Assist