Skip to course content
Free SQL course

SQL for Data Analysis and AI

Module 08 Knowledge Check

5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.

1. Why prefer placed_at >= '2026-06-01' AND placed_at < '2026-07-01' over BETWEEN '2026-06-01' AND '2026-06-30'?

2. Comparing this month to last month, the biggest correctness risk is…

3. Storing timestamps without timezone causes trouble because…

4. Applying DATE(placed_at) = '2026-06-01' to a large table is often slow because…

5. A cohort analysis groups users by…

---

Answer Key and Explanations

Check these only after attempting every question.

1. B - BETWEEN drops timestamps after midnight on the final day

If the column is a timestamp, 2026-06-30 14:00 is outside BETWEEN ... '2026-06-30'.

2. B - Unequal period lengths or an incomplete current month

A partial current month against a full prior month always looks like a decline.

3. B - The same instant is bucketed into different days depending on the reader's zone

Daily aggregates shift across a date boundary, and reconciliations stop matching.

4. B - Wrapping the column in a function can prevent index use

Prefer a range predicate on the raw column so the index remains usable.

5. B - A shared starting period, then tracks them forward over time

The defining feature is a fixed origin period, so later behaviour is comparable across cohorts.

Practical Check

Apply this module to your own work: complete the module activity for *Date and Time Analysis with Period Comparisons*, then write one sentence naming what your result shows and one naming what it does not.

Strong Answer Pattern

A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.