6 kyu
Customers with Urgently Expiring Certificates
139bornForThis
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.
Nitpick: using a real-life value which is
ssn
as a technical identifier, and, even worse, as a key, is (in general) not a good thing. Customers already have a synthetic ID, and it's the best thing to use as a key.Also, many countries have regulations how to store ssn, if even allowed. This is personal data, even if it's somewhat publicly available.
I don't understand your kata. What is 'customer_id' doing in table 'certs'?
I thought 'ssn' was used as foreign key between these tables.
oops, again leftover from the initial phase of kata creation :) Made foreign key correct
then
and then in expected:
How is it even possible to get '777-77-7776' in the expected results, if it's not even being added to the input to begin with ..
That's the issue I raised below, maybe you need to reload the test cases
That is wrong from my side.
cert_num
should be unique, while I somehow made duplicate code names which resulted in a wrong expected output. Sorry, not my day :/ I fixed tests and madecert_num
unique in DB schemaPotentially interesting fact: IIRC, for X.509 certificates, serial numbers have to be unique per issuer, and it is possible to have two certificates, issued by different CAs, with the same serial nuber. This could potentially add an interesting twist to your kata :)
Random test is using the wrong order:
The fixed test in text fixture is wrong too (it contains 1 more row). The sample test is correct, however.
I updated the description - made initially as by date but then understood that better to have SNN as a second criterion, forgot to update. Also made fixed tests consistent. Thanks for the feedback!
Spec not clear:
Does this mean "only if" or do you just want to say there could be one or more of such certificates per customer?
Tried to make a clearer spec, updated the description