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?
- A. The data is corrupted
- B. The two tables have different grain - one row means something different in each
- C. order_items has duplicates
- D. 3,400 orders were placed
2. Before writing any query, which question prevents the most wrong answers?
- A. Which index should I use?
- B. What does one row in this table represent?
- C. How many columns are there?
- D. Which database engine is this?
3. A manager asks for 'average order value'. You have order_items(price, quantity). AVG(price) returns…
- A. The correct answer
- B. The average line price, not the average order value
- C. The median order value
- D. An error
4. Which is a primary key's actual promise?
- A. It is the first column
- B. It is indexed
- C. It uniquely identifies a row and is never null
- D. It is an integer
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?
- A. Nothing useful
- B. customer_id is not unique - it cannot be the primary key as-is
- C. 52 customers were deleted
- D. The table needs an index
---
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.
