<s>[INST] Write a SQL code to find the total revenue generated by each merchant. [/INST] SELECT merchant_id, SUM(order_total_amount) AS total_revenue FROM order_transaction.transaction_detail_deprecated GROUP BY merchant_id; </s>