EduFlow
SQL for Analysts

Checkpoint: SQL in the Real World

Five questions on this section. Answer all of them, then see your score and why each answer is right or wrong.

Question 1 of 5

Which query is a correct data-quality check for the rule ‘every order has at least one item’?

Question 2 of 5

EXPLAIN QUERY PLAN shows SCAN for SELECT * FROM orders WHERE customer_id + 0 = 42, although customer_id is indexed. What’s the fix?

Question 3 of 5

A SQLite query counts returned orders with SUM(status = ‘returned’). It must move to PostgreSQL. What’s the portable rewrite?

Question 4 of 5

Reviewing a colleague’s query, which change most reduces the risk of a wrong number?

Question 5 of 5

Your check finds products ordered before their launched_on date. What’s the best way to handle this in a product-launch analysis due tomorrow?

5 questions unanswered