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.
I agree that it's not always good, but it's not always bad either. Just got to make sure it's clear, and you don't need to rewrite or change it later.
one line obssesive people >:(
It's hard to imagine a situation when one producer (because products should be grouped by a producer) sells different products with exactly the same name :) So DISTINCT is superfluous here I guess.
Done.
It doesn't seem right to me to run the code just to understand the task :)
Indeed, it didn't occur to me. In this case adding a comment about names or correcting examples block (change "time" to "hours" for SQL) would be useful I think. Thank you!
That means rounded down, not rounded up like you did.
That means rounded down.
No, I think that's Ruby highlighting some reserved words.
No, just running the default code, you see the column names.
Changing that now would render all SQL solutions invalid.
So, adding a comment about the column names or adding an specific code block in tha kata description is the best we can do I guess.
In SQL we have to guess column name in the original table. In description and examples we see "time", but this name can not be used in query because of
Instead of that we have to use "hours" not only for result (as it is said in the description for SQL), but for original column as well. It's confusing. It would be better to keep the original name ("time"), as in Python for example.
There is something wrong with the description:
should probably be
In addition to aesthetic aspects, description like this contains a little spoiler.
From PostgreSQL 14 documentation, 7.2.5:
Currently, window functions always require presorted data, and so the query output will be ordered according to one or another of the window functions' PARTITION BY/ORDER BY clauses. It is not recommended to rely on this, however. Use an explicit top-level ORDER BY clause if you want to be sure the results are sorted in a particular way.
https://www.postgresql.org/docs/14/queries-table-expressions.html
This solution is wrong when the number of the ending weekday is equal or greater than the number of the starting weekday (e.g. period from 2022-01-13 (Thursday, 4) to 2022-01-21 (Friday, 5): this solution gives 5 instead of 7). Now it doesn't pass the tests.
This comment is hidden because it contains spoiler information about the solution
Loading more items...