Need to create a function
Hands‐On Assignment 6‐4 with modifications: Identifying the day of the week for the order date
The day of the week that baskets are created is quite often analyzed to determine consumer shopping patterns. Create a function named DAY_ORD_SF that accepts an order date and returns the day of the week for those orders that have actually been placed. Use the function in a SELECT statement to display each basket id and the day of the week the order was created. Do a second SELECT statement using this function to display the total number of orders for each day of the week that has orders. (Hint: Call the TO_CHAR Function to retrieve the day of week from a date.)
This what I have so far would you be able to send some tweaks?
CREATE OR REPLACE FUNCTION day_ord_sf
(p_order_date IN DATE)
SELECT TO_CHAR(p_order_date)'fmdD' , "DAY")
WHERE idBasket ;