Skip to course content
Free SQL course

SQL for Data Analysis and AI

Module 01 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. orders has 1,000 rows and order_items has 3,400. What does that difference tell you?

2. Before writing any query, which question prevents the most wrong answers?

3. A manager asks for 'average order value'. You have order_items(price, quantity). AVG(price) returns…

4. Which is a primary key's actual promise?

5. You run SELECT COUNT(*) AS rows, COUNT(DISTINCT customer_id) AS ids on a customer table you have just been given, and get 9,340 and 9,288. What have you learned?

---

Answer Key and Explanations

Check these only after attempting every question.

1. B - The two tables have different grain - one row means something different in each

Grain is what one row represents. orders is one row per order; order_items is one row per line within an order.

2. B - What does one row in this table represent?

Naming the grain takes seconds and catches mismatches between the question asked and the number produced.

3. B - The average line price, not the average order value

order_items is at line grain. You must collapse to one row per order first, then average.

4. C - It uniquely identifies a row and is never null

Uniqueness and non-nullness are the promise. Type and position are irrelevant.

5. B - customer_id is not unique - it cannot be the primary key as-is

A gap between row count and distinct count means the column repeats, so its uniqueness promise does not hold. Run this on the starter database and you get 4,812 and 4,812 - customer_id really is the primary key there, which is what a clean result looks like.

Practical Check

Apply this module to your own work: complete the module activity for *Tables, Rows, Columns, Schemas, and Relational Thinking*, 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.