Quantcast
Channel: Active questions tagged cte - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 213

Clients which have seen an impression of a product at least 3 times before purchasing it- most optimal answer for Billions-record table

$
0
0

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


Viewing all articles
Browse latest Browse all 213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>