Активность VIP-клиентов Казани, июл–сен 2025
Questions like this come up in interviews at Meta
Level: MiddleTopic: JOIN100 XP
Instructions
Для клиентов сегмента 'vip' из города «Казань» и их операций с tx_time не раньше 1 июля 2025 и строго раньше 1 октября 2025 посчитайте по каждому клиенту: accounts_cnt — число различных счетов, по которым были такие операции, tx_cnt — число операций и spent — сумму трат (операций с отрицательным amount), взятую как положительное число. Клиентов без операций за период не выводите. Выведите id, name, accounts_cnt, tx_cnt, spent. Порядок строк не важен.
not translated yetHints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Exactly oneZero or oneZero or more
Table relationships
- N:1Many-to-one
accounts.→client_id clients.id - N:1Many-to-one
transactions.→account_id accounts.id
Table data
PostgreSQL
Select a table in the diagram or list to view its rows.