Skip to course content
Free SQL course

SQL for Data Analysis and AI

Module 11 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. When should aggregation happen in SQL rather than pandas?

2. Building SQL by string-concatenating user input risks…

3. After loading a query result into a DataFrame, the first check should be…

4. A reproducible analysis notebook must be able to…

5. Keeping the SQL in a separate readable file rather than buried in code helps because…

---

Answer Key and Explanations

Check these only after attempting every question.

1. B - When the data is large - aggregate in the database and move less data

Pushing work to the database reduces transfer volume and memory pressure.

2. B - SQL injection and broken quoting

Use parameterised queries; this is a correctness and security issue, not a style preference.

3. B - Row count and dtypes against what you expected

Silent type coercion and unexpected row counts invalidate everything downstream.

4. B - Re-run top to bottom and produce the same result

Hidden state from out-of-order cells is the most common cause of unreproducible analysis.

5. B - It can be reviewed, diffed, and re-run independently of the notebook

Reviewability is what turns a query into evidence.

Practical Check

Apply this module to your own work: complete the module activity for *SQL plus Python and pandas for Analysis Workflows*, 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.