<s>[INST] Write a SQL code to count the number of orders for each unique current state (e.g., processing, delivered, canceled).  [/INST] SELECT order_current_state, COUNT(*) AS total_orders FROM order_transaction.transaction_detail_deprecated GROUP BY order_current_state; </s>