Syntax
WEEKDAY(date)
Purpose
You can call this function to return 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 (0.00 sec)