13.1 Day Retention 3


#1

https://www.codecademy.com/en/courses/sql-analyzing-business-metrics/lessons/common-metrics/exercises/1d-retention-i

Having trouble with the first section of this topic. I believe this is the answer, but I keep getting the error message 'Select date, user_id, user_id.'

select
  date(g1.created_at) as dt,
  g1.user_id
from gameplays as g1
 join gameplays as g2 on
    g1.user_id = g2.user_id
    and date(g1.created_at) = date(datetime(g2.created_at, '-1 day'))
order by 1
limit 100;


#2

This is what your table should look like:

dt 	retention
2015-08-04 	23.0
2015-08-05 	25.0
2015-08-06 	22.0
2015-08-07 	22.0
2015-08-08 	19.0
2015-08-09 	20.0
2015-08-10 	24.0
2015-08-11 	16.0
2015-08-12 	18.0
2015-08-13 	19.0
2015-08-14 	24.0
2015-08-15 	26.0
2015-08-16 	23.0
2015-08-17 	18.0
2015-08-18 	21.0
2015-08-19 	23.0
2015-08-20 	26.0
2015-08-21 	24.0
2015-08-22 	20.0
2015-08-23 	24.0
2015-08-24 	21.0
2015-08-25 	19.0
2015-08-26 	23.0
2015-08-27 	20.0
2015-08-28 	29.0
2015-08-29 	14.0
2015-08-30 	28.0
2015-08-31 	20.0
2015-09-01 	32.0
2015-09-02 	17.0
2015-09-03 	16.0
2015-09-04 	27.0
2015-09-05 	24.0
2015-09-06 	20.0
2015-09-07 	18.0
2015-09-08 	28.0
2015-09-09 	22.0
2015-09-10 	19.0
2015-09-11 	15.0
2015-09-12 	27.0
2015-09-13 	21.0
2015-09-14 	22.0
2015-09-15 	11.0
2015-09-16 	20.0
2015-09-17 	21.0
2015-09-18 	25.0
2015-09-19 	26.0
2015-09-20 	24.0
2015-09-21 	19.0
2015-09-22 	20.0
2015-09-23 	27.0
2015-09-24 	21.0
2015-09-25 	16.0
2015-09-26 	24.0
2015-09-27 	27.0
2015-09-28 	24.0
2015-09-29 	22.0
2015-09-30 	22.0
2015-10-01 	22.0
2015-10-02 	22.0
2015-10-03 	19.0
2015-10-04 	19.0
2015-10-05 	27.0
2015-10-06 	25.0
2015-10-07 	15.0
2015-10-08 	16.0
2015-10-09 	28.0
2015-10-10 	21.0
2015-10-11 	22.0
2015-10-12 	21.0
2015-10-13 	21.0
2015-10-14 	17.0
2015-10-15 	24.0
2015-10-16 	20.0
2015-10-17 	19.0
2015-10-18 	21.0
2015-10-19 	22.0
2015-10-20 	21.0
2015-10-21 	18.0
2015-10-22 	27.0
2015-10-23 	21.0
2015-10-24 	26.0
2015-10-25 	27.0
2015-10-26 	18.0
2015-10-27 	21.0
2015-10-28 	19.0
2015-10-29 	22.0
2015-10-30 	21.0
2015-10-31 	24.0
2015-11-01 	26.0
2015-11-02 	24.0
2015-11-03 	17.0
2015-11-04 	19.0
2015-11-05 	24.0
2015-11-06 	23.0
2015-11-07 	32.0
2015-11-08 	19.0
2015-11-09 	20.0
2015-11-10 	25.0
2015-11-11 	17.0

I have three lines that differ from yours but it is so long ago that I've lost sight of the context. Will need to completely review the module to give useful advice, so it's back to you to try to generate this table.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.