Syntax
DAYOFWEEK(date)
Purpose
You can call this function to return the ordinal number of the day in the week of date, starting with Sunday.
Examples
obclient> SELECT DAYOFWEEK('2021-07-15');
+-------------------------+
DAYOFWEEK('2021-07-15')
+-------------------------+
5
+-------------------------+
1 row in set (0.01 sec)