Back to problems

Compute paid subscriber YoY counts by month

SQL · Intuit · Medium

You are given two PostgreSQL tables, company and free_subs, holding subscription records. Write one single SQL query that reports, for each calendar month from 2019-06-01 (inclusive) up to the most recent month seen in the paid subscription data, how many companies started paying in that month. Each month's row must also carry the figure for the matching month one year earlier, together with the year-over-year difference in absolute terms and in percent. Rules that define…

Checking your access…