or a project I am working on I was asked to solve this task:
Given the table
**events** event_id int (autoincrement) --10B distinct values event_ts datetime -- 10B event_type int (1 = impression, 2 = click, 3 = purchase...) --20 types product_id int --100K client_id int --10M client_type int --10
Q: Which clients have seen an impression of a product at least 3 times before purchasing it?
I need to not only create a query that would get the output but also it should also offer the best query-performance