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.
done by B4B ~~
No, there's only one optimization you can do. Maybe there's a difference between using
INNER JOIN
andCROSS JOIN + WHERE
, but it's not likely to be significant (at least, not in this kata).Not an issue
Works for me: what is your error?
Every query of currency table results in the below:
PG::UndefinedTable: ERROR: relation "currency" does not exist
LINE 1: SELECT count(*) AS "count" FROM (SELECT * FROM CURRENCY) AS ...
I have the same error than CapedHero. Is there any problem?
You can use the keyword argument
key
to pass a function tosorted
. That function is then called for each element and the result is used to determine the sort order (https://docs.python.org/3/library/functions.html#sorted) E.g. to sort a list of strings by their length you could writesorted(strings, key=len)
. Internallysorted
will then calllen(s)
for each strings
instrings
.As
key
you can pass everything that is callable with one argument and returns something sortable. To sort a list of strings case-insensitively you can writesorted(strings, key=lambda s: s.lower())
or (shorter)sorted(strings, key=str.lower)
. You could even create your own classMyClass
with a__call__(self, arg)
method and use that:sorted(sequence, key=MyClass())
(becauseMyClass()
creates a new instance, and sort will call (pseudo-code)instance(element)
which translates toMyClass.__call__(instance, element)
).In your case
seq.index(element)
is a function that returns the index ofelement
inseq
. If you callsorted(seq_a, key=seq_b.index)
, internallysorted
will callseq_b.index(element)
for eachelement
and use that index for sorting.This comment is hidden because it contains spoiler information about the solution
fixed typo.
tablenames are case insensitive and i'm not creating table names in snake case.
there are no desc/asc requirements.
This comment is hidden because it contains spoiler information about the solution
Thank
Thank
It's problem with server, try to do it in another time, i had the same problem when i did another kata but the next day all worked good.
I wrote name table in description in capital letters because i wanted pay attention of user to name of table, in the solution you can write name table how you want(i tried "CurRenCY" and its worked)