#705

Daily product turnover at the bank

Gazprombank builds a daily turnover mart for corporate products. Each operation is tied to a client (UUID), a product category (bank_product), and an amount in RUB. Roll the data up to the product-plus-day grain: how many operations there were, the total amount, and the average amount rounded to two decimals.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

txn_cnttxn_dayavg_amountproduct_codetotal_amount
22024-04-014000.00CARD8000.00
22024-04-029250.00CARD18500.00
22024-04-035100.00CARD10200.00
Gazprombank

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid