Syntax
WEEKDAY(date)
Purpose
WEEKDAY() returns the ordinal number of the day in the week of date.
Examples
obclient> SELECT WEEKDAY('2021-07-16 00:00:00');
+--------------------------------+
| WEEKDAY('2020-07-16 00:00:00') |
+--------------------------------+
| 5 |
+--------------------------------+
1 row in set