Runtyme
All practice problems

Data Engineering · SQL · Intermediate

SQL interview question: COUNT(*) Lies

How many of Viman Nagar's orders have actually been rated? 100% of customers left a rating? Sure.

The problem

  • How many of Viman Nagar's orders have actually been rated?

You'll use: SQL (SQLite) · SELECT & WHERE · JOIN · GROUP BY · TRIM & datetime() · Data cleaning

Solve it (expert level)3–6 min · You write SQL
Show a hint

Look at the stars column. Some are NULL.

What this teaches (spoiler)

NULL means unknown. COUNT(column) and AVG ignore NULLs; COUNT(*) doesn't. Choose on purpose.

Bug of the Day: a new problem every midnight, free for everyone. Keep a streak with your friends.