Session #20 HW#34
Conversation
| Group by p.PetType | ||
|
|
||
| --2)we need to see how many customers have multiple pets. | ||
| SELECT NumOfCustomers = Count(*) from ( |
There was a problem hiding this comment.
This can be done simply with a group by and having, no need for a subquery.
There was a problem hiding this comment.
When I do a simple group by/having, I get a list of the costumers who have more than 1 pet, which, to be honest, is more useful information, but the biz-scenario asks for "how many customers have multiple pets" not a "list of customers that have multiple pets". Am I missing something? Is there a way to get the count of customers who have multiple pets without a subquery?
There was a problem hiding this comment.
The question was asking that, show a list of customers that have multiple pets, sorry it wasn't so clear. Please fix
AvigailGellis
left a comment
There was a problem hiding this comment.
AS: Great job! 95% Please see minor comments and resubmit.
FCBernstein
left a comment
There was a problem hiding this comment.
I think I made all the necessary corrections, but please see my comment by the reports and explain, if possible.
Thank you
| Group by p.PetType | ||
|
|
||
| --2)we need to see how many customers have multiple pets. | ||
| SELECT NumOfCustomers = Count(*) from ( |
There was a problem hiding this comment.
When I do a simple group by/having, I get a list of the costumers who have more than 1 pet, which, to be honest, is more useful information, but the biz-scenario asks for "how many customers have multiple pets" not a "list of customers that have multiple pets". Am I missing something? Is there a way to get the count of customers who have multiple pets without a subquery?
|
I fixed the report. |
Please review/Comment. Thank you