6 kyu
Current Age Distribution of Employees
Loading description...
SQL
Databases
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Hi! I believe that there might be an error in the 'Edge Test Case'. The only employee present in that data set is above 40 (born Aug. 2/1983) but the solution seems to require the employee to be between 26 and 40. Could you please look into this?
Hi! I clearly mentioned it in the description, "Ensure the age ranges include the entire span (e.g., up to but not including 21 years for the 18-20 bracket)." And the test that you mentioned checks exactly it: that person who is 40.5 would be a part of -40 bracket
Thank you for the prompt response - the error was in my query not in tests!
here was a question but I found where I've misread the description =)
nice trap
Reference solution is wrong: it does not count employees by age 18-20, but rather
18 year 0 days <= age <= 20 years 0 days
, which excludes all the age range in20 years 0 days < age < 21 years 0 days
.This only rarely occurs in test cases, so solutions with this difference can still pass the tests after a few submissions. See this
thanks for pointing this out! not the first time that I fell in the trap of
between
operator :) Updated ref solution, tests and description.