SQL query to determine the average daily sales of each product from 2005-04-08 to 2023-02-24. (Hint: first,
Fantastic news! We've Found the answer you've been seeking!
Question:
SQL query to determine the average daily sales of each product from "2005-04-08" to "2023-02-24". (Hint: first, find out how many of each product have been sold from "2010-04-08" to "2023-02-24", then calculate the average. Functions DATEDIFF(date1,date2) calculates the number of days between two dates.)
In database_1 there is the following:
Orders(order_id(Primary, int), registered_date(date), user_id(MUL, int)
OrdersProducts(order_id(Primary, int), price(float), product_id(Primary, int), quantity(int)
Ratings(order_id(Primary, int), product_id(Primary, int), rate(int), comment(VARCHAR)
Users(email(UNIQUE, VARCHAR), name(VARCHAR), password(VARCHAR), registered_date(date), username(UNIQUE, VARCHAR), user_id(Primary, int)
Related Book For
Posted Date: