# Manipulation 7/10 - CROSS JOIN Logic Error?

The instructions for this task says that we’re looking for the COUNT(*) of customers who were subscribed to the newspaper during March (3). And the logic we are instructed to use returns a quantity of 8. (start_month < 3, end_month > 3)

However, I contend that this logic is flawed, and that we should be using:
start_month > 4 or start_month >= 3
end_month > 2 or end_month >= 3

That way, new customers who began their subscriptions in March, or those who will be receiving a newspaper in March but not in April are included. My argument returns a count of 13.

“Logic” is my greatest hurdle in coding. So I’m curious which version is most accurate.

SQL MANIPULATION 7/10 CROSS JOIN

Hello

If I would be assigned to the implementation of this task in a normal job I would definitely ask product owner or an analyst to make sure that this is what they want. You have good instinct

But I don’t think that instructions are flawed. “Let’s start by counting the number of customers who were subscribed to the newspaper during March” may mean that we are insterested in customers who stay subscribed throughout whole month.

I know that this is likely a typo, but just to clarify this for other readers. This condition:

``````start_month > 4 or start_month >= 3
``````

does not make sense (these customers started subscription after March). This is what you probably meant:

``````start_month < 4 or start_month <= 3
``````
1 Like

I can’t figure out this question also and can’t move forward.

In case it’s of some help:

Q1:

``````select count(*)
from newspaper
where start_month < 3 and end_month >3;
``````

Q2:

``````select *
from newspaper
CROSS JOIN months;
``````

Q3:

``````select *
from newspaper
CROSS JOIN months
WHERE month > start_month and month < end_month;
``````

Q4:

``````SELECT month,
COUNT(*) as subscribers
FROM newspaper
CROSS JOIN months
WHERE month > start_month
AND month < end_month
GROUP BY month;
``````
2 Likes

Hmmm…
Well, it’s nice to see the answer and thereby be able to move on. Thank you, @ldouchy