You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In SQL,(customer_id, visited_on) is the primary key for this table.
19
+
This table contains data about customer transactions in a restaurant.
20
+
visited_on is the dateon which the customer with ID (customer_id) has visited the restaurant.
21
+
amount is the total paid by a customer.
22
+
23
+
24
+
You are the restaurant owner and you want to analyze a possible expansion (there will be at least one customer every day).
25
+
26
+
Compute the moving average of how much the customer paid in a seven days window (i.e., current day +6 days before). average_amount should be rounded to two decimal places.
27
+
28
+
Return the result table ordered by visited_on in ascending order.
0 commit comments