Hello,
The following query should select the day, the number of sales for that day and the departments:
SELECT DATE(s.transaction_date) as day, d.name as department, COUNT(s.id) as sale_count FROM sale s JOIN department d on d.id = s.department_id group by d.name, s.transaction_date But he somehow incorrectly counts COUNT. Tell me, what's the problem?

как-то неправильно считает COUNT- doesn’t it seem to you, sir, that under this formulation it’s not clear what it means? - Alexey Shimanskycount()it all right? You have a transaction date with time, since you takedate()from above and ingroup bywhy you don’t use date and the grouping is accurate to a second, i.e. essentially no grouping - Mike