jadler23 / sql-scratch-capstone-turn-in

0 stars 0 forks source link

Double Counting Users #2

Open miraydamartinez opened 6 years ago

miraydamartinez commented 6 years ago

https://github.com/jadler23/sql-scratch-capstone-turn-in/blob/6308c5fe96c38bbde1f525d67ba0aabfa418cdaf/SQL%2BCapstone.CoolTShirts.Justin.Adler-Swanberg.08.13.18/Capstone%20Queries.CoolTShirts.JAS.08.13.18.sql#L70-L71

In this query, you want to count how many users visit the page, but what if one user visits the page multiple times? Instead of counting all visits, try:

COUNT(DISTINCT pv.user_id ) AS users

This will ensure that you are not over-counting visits to the page.

jadler23 commented 6 years ago

Thank you for the guidance on this as well... do I need to revise and resubmit the presentation as per previous comment?