Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
So here's the rules that this kata's should have :-
please note that we need only those rows that have stock 2 or less than two and that FROM companyA
so the rule for this kata is that your solution should have :-
that's it
Your math made me smile :)
If your test fails, check two things:
Actually, it seems like it doesn't matter what order the columns are in the output. Looking at the tests, they should really just be rewritten from scratch
The output schema in instructions is wrong you need to have
name, price, price_per_kg, weight
main difference is weight is last not second.
Very good kata all in all.
DATABASE name would be nice.
.
.
.
Its "products"
nevermind, im too stupid to read :)
I think ROUND needs a
numerictype, not double precisionThis comment is hidden because it contains spoiler information about the solution
Satisfying Kata, thank you
Nice kata! A simple formula at its core, but a great opportunity to think recursively and iterate mentally. Clean, well-structured challenge. Thanks for creating this!
Your calculation of price_per_kg is wrong. Look at the table that your query generates. When I run your query, it tells me that for something that costs 2.44 and weighs 30 grams, the price_per_kg is 0.07. That doesn't make any sense, does it? If it costs 2.44 for less than 1kg, how would a kg cost 0.07? If you fix your calculation, I think you'll find that the kata is not bad and is not a waste of time.
I can't for the life of me figure how how my solution is different from the "correct" one. Even after fighting Postgres... this Kata is bad. Don't waste your time.
Hated it.
This is one of those exercises that’s more about fighting PostgreSQL's quirks than about actually understanding SQL concepts.
Loading more items...