mysql> select date(date_joined),count(*) from users
where MONTH(date_joined)=MONTH(now())
and YEAR(date_joined)=YEAR(now())
group by date(date_joined);
+-------------------+----------+
| date(date_joined) | count(*) |
+-------------------+----------+
| 2020-05-01 | 3 |
| 2020-05-04 | 6 |
| 2020-05-05 | 4 |
| 2020-05-06 | 2 |
+-------------------+----------+
mysql> select * from sales
where MONTH(order_date)=MONTH(now())
and YEAR(order_date)=YEAR(now());
+------------+------+--------+
| order_date | sale | orders |
+------------+------+--------+
| 2020-05-01 | 250 | 14 |
| 2020-05-02 | 150 | 20 |
| 2020-05-03 | 300 | 21 |
| 2020-05-04 | 200 | 15 |
| 2020-05-05 | 200 | 17 |
| 2020-05-06 | 250 | 12 |
| 2020-05-07 | 150 | 15 |
| 2020-05-08 | 300 | 12 |
| 2020-05-09 | 200 | 18 |
+------------+------+--------+
mysql> SELECT * FROM sales
WHERE order_date >= (LAST_DAY(NOW()) + INTERVAL 1 DAY - INTERVAL 1 MONTH)
AND order_date < (LAST_DAY(NOW()) + INTERVAL 1 DAY);
+------------+------+--------+
| order_date | sale | orders |
+------------+------+--------+
| 2020-05-01 | 250 | 14 |
| 2020-05-02 | 150 | 20 |
| 2020-05-03 | 300 | 21 |
| 2020-05-04 | 200 | 15 |
| 2020-05-05 | 200 | 17 |
| 2020-05-06 | 250 | 12 |
| 2020-05-07 | 150 | 15 |
| 2020-05-08 | 300 | 12 |
| 2020-05-09 | 200 | 18 |
+------------+------+--------+
mysql> select count(*) from users
where MONTH(date_joined)=MONTH(now())
and YEAR(date_joined)=YEAR(now());