oi oi oi
I must say I found it very frustrating at some point, I knew I was 95% there but the last bit would just not work as expected
but sure enough I learned quite a bit...
so thanks!
The specification doesn't say which way the cycles should go. If they were reversed, that would also be a correct solution, yet probably failing the tests.
What @Dmitry-k42 described is actually an issue. Category names are used in the tests not only for tie breaking at the last (5th) places, but also for ordering the otherwise tied rows in the result. See my solution. The description (updated after @Volie's issue) requires the "name" in the inner ORDER BY clause, but not the outer. Yet, the order of such rows is arbitrary without it, which may fail your tests.
The description of kata is ambiguous - it says: "return a list of users and their pet names, but only for users who have at least one pet whose name starts with the letter 'M'." It doesn't say that we should exclude all pet names which doesn't start with 'M'. According to description we should return all users and all their pet names in case if at least one pet name starts with 'M' for a giver user.
list should be sorted by the quantity of rentals from higher to lower and if number of rentals is the same - then by last name of a customer
In the random tests, it is possible for two persosn to be tied by number of rentals AND by last name. The bug can be easily replicated by adding random() as a third sorting criterion (which normally should not change the results if the first two criteria were enough).
the link to the DVD rental database in the description is dead. postgresqltutorial.com now redirects to neon.tech which is a commercial website, though you can still download the DB for free from there
the link to the DVD rental database in the description is dead. postgresqltutorial.com now redirects to neon.tech which is a commercial website, though you can still download the DB for free from there
THANK YOU
oi oi oi
I must say I found it very frustrating at some point, I knew I was 95% there but the last bit would just not work as expected
but sure enough I learned quite a bit...
so thanks!
The specification doesn't say which way the cycles should go. If they were reversed, that would also be a correct solution, yet probably failing the tests.
What @Dmitry-k42 described is actually an issue. Category names are used in the tests not only for tie breaking at the last (5th) places, but also for ordering the otherwise tied rows in the result. See my solution. The description (updated after @Volie's issue) requires the
"name"
in the innerORDER BY
clause, but not the outer. Yet, the order of such rows is arbitrary without it, which may fail your tests.The description of kata is ambiguous - it says: "return a list of users and their pet names, but only for users who have at least one pet whose name starts with the letter 'M'." It doesn't say that we should exclude all pet names which doesn't start with 'M'. According to description we should return all users and all their pet names in case if at least one pet name starts with 'M' for a giver user.
OP solved the kata
This comment is hidden because it contains spoiler information about the solution
In the random tests, it is possible for two persosn to be tied by number of rentals AND by last name. The bug can be easily replicated by adding
random()
as a third sorting criterion (which normally should not change the results if the first two criteria were enough).the link to the DVD rental database in the description is dead.
postgresqltutorial.com
now redirects toneon.tech
which is a commercial website, though you can still download the DB for free from therethe link to the DVD rental database in the description is dead.
postgresqltutorial.com
now redirects toneon.tech
which is a commercial website, though you can still download the DB for free from therethanks for the kata
This comment has been reported as abusive
Thank you, this helped
thank you bornForThis!
your katas feel always a bit more challenging, but I seem to always learn smth. new
Seems your account_name is not just empty words!
The other katas made by bornForThis DO have the highlighted table names, plus I also had a slight trouble to find the table name as well.
So, by a voluntaristic decision, I highlighted that in the just-merged fork :)
Loading more items...