question 296 Packaging & Databases · medium
The repeat-customers report
repeat_customers(conn, city, min_orders) should list the customers in a city with at least min_orders orders. Support reports two problems: for the city Coeur d'Alene the report crashes, and customers with exactly min_orders orders are missing. Fix both.
Function
repeat_customers(conn, city, min_orders)Tables
customers (customer_id, last_name, city), orders (order_id, customer_id, total)Returns
[(customer_id, order_count), …] ordered by customer_id