The following query uses the WEEKDAY function
to indicate which day of the week calls are received and resolved
(0 represents Sunday, 1 is Monday,
and so on), and the expression columns are labeled. Figure 1: Query
SELECT customer_num,
WEEKDAY (call_dtime) called,
WEEKDAY (res_dtime) resolved
FROM cust_calls
ORDER BY resolved;
The following query uses the COUNT and WEEKDAY functions
to count how many calls were received on a weekend. This kind of statement
can give you an idea of customer-call patterns or indicate whether
overtime pay might be required. Figure 3: Query
SELECT COUNT(*)
FROM cust_calls
WHERE WEEKDAY (call_dtime) IN (0,6);