9. ARPU.2 Help?


#1

I'm not sure what I'm doing wrong for this part? I've copied all of their code (as I've noticed that often runs when mine doesn't despite being identical) and inserted the proper keywords, but it takes many minutes to run and yields no results with no errors.

with daily_revenue as (
select
date(created_at) as dt,
round(sum(price), 2) as rev
from purchases
where refunded_at is null
group by 1
),
daily_players as (
select
date(created_at) as dt,
count(distinct user_id) as players
from gameplays
group by 1
)
select
daily_revenue.dt,
daily_revenue.rev / daily_players.players
from daily_revenue
join daily_players using (dt);


#2

After leaving it for about an hour or so it ran fine. Does anyone know if there are still any errors or anything else going on in the above code? Or was it a bug on Codeacademy?


#3

I've found this is the buggiest codecademy class I've seen. Same code works for me!


#4

I've got same problem as captainjean.
It takes a lot of time to run but doesn't results anything :frowning:


#5

I'm experienced the same problem on this module. I ran my code once and it spun for 15 minutes. Refreshed browser and ran again and it worked.

If it doesn't work the first time, run it again.


#7

You did a very long query, the whole code is below

with daily_revenue as (
select
date(created_at) as dt,
round(sum(price), 2) as rev
from purchases
where refunded_at is null
group by 1
)
select * from daily_revenue order by dt;


#8

and this is second part of exercise just need to add "using" and "with"

with daily_revenue as (
select
date(created_at) as dt,
round(sum(price), 2) as rev
from purchases
where refunded_at is null
group by 1
),
daily_players as (
select date(created_at) as dt,
count(distinct user_id) as players
from gameplays
group by 1
)
select
daily_revenue.dt,
daily_revenue.rev / daily_players.players
from daily_revenue
join daily_players using (dt);


#9

I'm also having trouble passing this module. Even when I get the solution from Codecademy ("Having Trouble? Get Code") and run it, it still throws an error and won't let me pass. Has anyone actually gotten through this section?


#10

I finally passed it. For some reason, even though I passed Step 1 about 20 minutes ago, it was failing me back to that point when I clicked "Get Code." So you have to copy the final code, paste it somewhere, re-pass Step 1, then pass Step 2 with the pasted code. Not a great user experience on this one, even though I love SQL.


#11

Troubling thing is this exercise goes out of it's way to be complicated. Easier written without the extra var daily_revenue or using WITH:

SELECT DATE(created_at) AS dt,
ROUND(SUM(price), 2) AS rev
FROM purchases
WHERE refunded_at IS NULL
GROUP BY 1
ORDER BY dt;


#12

Even if the ARPU2's second part has a code as continuation of 1st part,copying of the remaining code and executing won't work because of some bugs.So for executing second part please copy the entire code again after deleting 1st and then make appropriate corrections.This works for me.Try it.


#13

Hi
could anyone please explain me why we have to use CTE, why can't we simply do

select date(created_at), sum(price)/(count(distinct(user_id)))
from purchases
join gameplays on date(created_at)
group by 1
order by 1;


#14

In our ARPU query, we used using instead of on in the join clause. This is a special case join.
from daily_revenue
join daily_players using (dt);

When the columns to join have the same name in both tables you can use using instead of on. Our use of the using keyword is in this case equivalent to this clause:
from daily_revenue
join daily_players on
daily_revenue.dt = daily_players.dt;


#15

I have the same question. Did you find out?
I have tried something similar but the table gives wrong result.


#16

what is the actual answer then?


#17

never mind i got the answer


#18

I was reading over your code and couldn't see a single difference between yours and mine! So I'm glad it worked for you an hour later.
I get regular bugs on this course too - for me I'll be reading the question (so I'll be pausing for 5 seconds to read) and it says "Are you still there?" and threatens to time-out. I get it all the time. Seriously - I need more than 2 seconds to read the question.


#19

Actually I have error with debugging :frowning:


#20

Hahaha! i Like this guy!! Same issues here.
Can’t even seem to get past this section as it were and added to it is the " Are, you still there?" and keep ticking it red while i am trying to think of a way to make the code work at the same time.

I seem like a late comer, this posts have been here for a long time and still experiencing the same issue and errors. i probably will just take a nap, refresh the browser and i hope it works fine this time around!!!


#21

I have a bug. I wrote correct query and after running I see result in Query Result section, But also I;ve got an error “Select Daily Players in a with clause.” and can’t continue with part 2 ((( What should I do?

P.S. I wrote query by myself and copypaste it from Instructions but still the same (((