SELECT COUNT(*) FROM orders; returns one row with one number: how many rows the table has. Add a WHERE to count only matching rows. COUNT(city) counts rows where that column is not NULL, and COUNT(DISTINCT city) counts different values.
Aggregate functions collapse many rows into one value. On their own they return a single row; combined with GROUP BY they return one row per group.
SELECT COUNT(*) FROM employees WHERE dept = 'Sales';Your task
Count the orders placed in 2024 from April onwards, that is with ordered_at of '2024-04-01' or later.
Hint 1
WHERE ordered_at >= '2024-04-01'; dates stored as ISO text compare correctly as text.
Show the solution
SELECT COUNT(*) FROM orders WHERE ordered_at >= '2024-04-01';