solidH2O / sql-scratch-capstone-turn-in

0 stars 0 forks source link

Campaign and Source #1

Open kaymarie opened 6 years ago

kaymarie commented 6 years ago

https://github.com/solidH2O/sql-scratch-capstone-turn-in/blob/1c903b3e13648443a187d3380a22f0682bc64246/Codeacademy%20SQL%20From%20Scratch%20CoolTShirts%20Capstone/CoolTShirts%20SQL%20Capstone%20sql%20file%20prep%20version.sql#L3-L5

The first question was as follows: 1.1 How many campaigns and sources does CoolTShirts use and how are they related? Be sure to explain the difference between utm_campaign and utm_source.

I'm am not seeing in your code or report where you tell me the number of campaigns and sources or the names of these. In your project I should have seen a table that shows me all of the different campaigns and their sources. I can see that you understand what you are querying, however the question was not answered.

The correct code to give the number of campaigns and sources would be this:

SELECT COUNT(DISTINCT utm_campaign)
FROM page_visits;

SELECT COUNT(DISTINCT utm_source)
FROM page_visits;

The correct code to show the different campaigns and sources would be this:

SELECT DISTINCT utm_campaign,
       utm_source
FROM page_visits;