title: How many customers view the blog after their purchase?
body: <p>Need to obtain # of customer views on blog after purchase (commented on some of the lines to show my thinking), not sure if its the right approach (finding # customers and views) open to any feedback, thanks in advance!</p>
  <p>Desired Results: # of customers, # of views made by customers on blogs</p>
  <p><em>Tables:</em></p>
  <p>Purchases
  <a href="https://i.stack.imgur.com/FJQ2P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FJQ2P.jpg" alt="enter image description here" /></a></p>
  <p>Traffic_events_atl
  <a href="https://i.stack.imgur.com/z1gLv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z1gLv.jpg" alt="enter image description here" /></a></p>
  <p>How many customers view the blog after their purchase?</p>
  <pre><code>SELECT
    COUNT(DISTINCT p.customer_id) as num_cust, -- number of customers
    COUNT(t.visit_id) as page_views -- views made by customers
  FROM
    traffic_events_atl t
  JOIN
    purchases p
  ON
    t.visitor_id = p.visitor_id
  WHERE t.property ilike '%blog%'; -- blog specific websites;
  
  </code></pre>
  <p>Including output:
  <a href="https://i.stack.imgur.com/MVXIq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MVXIq.jpg" alt="enter image description here" /></a></p>