Menu
Coddy logo textTech

Recap - Traffic Sources

Part of the Beyond the Basics section of Coddy's SQL journey — lesson 15 of 27.

challenge icon

Challenge

Easy

Available 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:

  • day
  • visits: total rows that day
  • organic: visits with source = 'organic'
  • paid: visits with source = 'paid'
  • signups: total converted that day

Order by day.

Try it yourself

SELECT day,
       COUNT(*) AS visits,
       -- organic, paid, signups
FROM visits
GROUP BY day
ORDER BY day

All lessons in Beyond the Basics