FAQ: Code Challenge: Multiple Tables - Code Challenge 6

This community-built FAQ covers the “Code Challenge 6” exercise from the lesson “Code Challenge: Multiple Tables”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

FAQs on the exercise Code Challenge 6

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

This isn’t actually showing anything for me. what am I doing wrong?

I have the same issue, with exactly the same code. What do I miss, or is this a bug in CodeCademy?

@cyraneika @masakudamatsu

You need to add a comma before CASE.

Thank you for your quick answer! The CASE operator and its subsequent WHEN THEN ELSE END operators as a whole is essentially a column. Thinking this way, it’s natural to put a comma before it. It completely escaped from my mind. Thank you for reminding us of it!

1 Like

Awesome wrap-up! :slight_smile:

You’re welcome.

i get the “Unable to connect to codecademy” message on this particular challenge. what can i do?

pu.cancel_date >= m.months can anyone explain this part of the code to me? How is this restricting other months?

Hi all,
can anyone explain further the use of brackets in the case statement?
I assume because the 1st WHEN has multiple conditions (X) AND (Y OR Z)
But looks a bit strange for the first part (before AND) to have its won bracket.
Any thoughts very welcome guys :smiley:

won = own… typo

Hmm - why do we do <= AND >= instead of just =?

I think this is wrong, wrong in the sense that it is incomplete and not accurate.

Your solution for instance says that userid: e9005106-b5d3-49d8-bb80-c6dac246140b was NOT active in january see SS

however this is not he case, the user id in question actually signed up jan 30 so they would have been active for two days in january - see below

what i think the solution should read based on the question is whether their purchase MONTH is before or equal to the month column month value or if their cancel month is equal to or before the month column month value or is null

because the question is asking which users were active during the month not for the WHOLE month.

Can you please provide comment?

@factoradic i only @ you because you seem to be the CodeAcademy rep on this thread

1 Like

This I believe is much more accurate

1 Like

I am not a codecademy employee or any sort of a codecademy rep.

I agree with you. To the point that in 2019 I reported this exact problem as a bug, but from a bit different perspective - I think that confusion and all the user problems come from the fact that table named months stores specific dates, not months. And this creates a whole dimension of ambiguity.

This problem was also mentioned here → How does this statement tell us if a user is active or not active? - #2 by board3405145664, in the reply to the FAQ, FAQ that supposedly should provide disambiguation and explanation to the problem we are discussing here. Unfortunately it fails to do so.

There are only two hard things in Computer Science: cache invalidation and naming things.


1 Like

I will say that I’m glad that we had this exercise so that for the first time I could actually understand a cross join for the first time. That being said, I wish we had been put through the wringer to try to figure it out instead of copy/paste. At least I get how they work now and why they can be helpful in niche use cases.