From 66eaea5437134247463363c673827e0c34911a97 Mon Sep 17 00:00:00 2001 From: abdrahimm Date: Thu, 24 Aug 2023 20:56:22 +0100 Subject: [PATCH] Update improve_query.md (#418) --- topics/sql/improve_query.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/topics/sql/improve_query.md b/topics/sql/improve_query.md index 0891a5c..8819445 100644 --- a/topics/sql/improve_query.md +++ b/topics/sql/improve_query.md @@ -3,8 +3,7 @@ 1. Improve the following query ``` -SELECT count(*) +SELECT COUNT(purchased_at) FROM shawarma_purchases -WHERE - YEAR(purchased_at) == '2017' +WHERE purchased_at BETWEEN '2017-01-01' AND '2017-12-31'; ```