Task: Text to Code
Input (English): SQL: SELECT product_name , Count ( * ) FROM Products GROUP BY product_name ORDER BY Count ( * ) Asc
Feedback: product name in products table in step 1 is wrong , there should be product id in order items .
Output (English): SELECT T3.product_name ,  count(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id