Recap - Traffic Sources
Part of the Beyond the Basics section of Coddy's SQL journey — lesson 15 of 27.
Challenge
EasyAvailable tables and columns:
<strong>visits</strong>:<strong>id</strong>,<strong>day</strong>,<strong>source</strong>,<strong>converted</strong>
converted is 1 when the visitor signed up, 0 otherwise. For each day return:
dayvisits: total rows that dayorganic: visits withsource = 'organic'paid: visits withsource = 'paid'signups: totalconvertedthat day
Order by day.
Try it yourself
SELECT day,
COUNT(*) AS visits,
-- organic, paid, signups
FROM visits
GROUP BY day
ORDER BY day