7 kyu
BASICS: Length based SELECT with LIKE
10,475 of 10,477baaart
Loading description...
Fundamentals
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.
Nice little Kata to go back to basics. It may help to explain that LEN can't be used, or possibly an 8kyu.
I didn't understand the description. "You will need to create a SELECT statement in conjunction with LIKE.". LIKE what?
upd: This means that the relevant string must be larger than 6 characters and the LENGHT function MUST NOT BE USED in the solution. What was the problem with writing a clear description?
Honestly a very stupid question. It's asking you to USE Like and Len in the instructions which makes no sense at all.
Please find someone who's first language is English if you are targeting an English speaking audience
This comment has been hidden.
It is great challange, love it, just not very clear what is expected until I have run it first time. I would suggst to state using LENGHT fuction is not allowed - just for a clarity.
Every time I test the code, everything is passed, but when I attempt, it says its grouped wrong. The 'expected' and 'got' values are the same, am I missing how to order it or something?
Your query is wrong, count how many _ it has.
This comment has been hidden.
This comment has been hidden.
Please mark your post as having spoiler content next time. Your code is wrong (it matches 6 chars exactly), and sample tests don't test for all the requirements.
Please provide table name to the exercise
They're already in the description
Check the test code, please, it seems to be broken. Some issue with library imports. Also, correct solutions (even the ones copy-pasted from accepted solutions) don't work
It works fine for me, what's the error message you're seeing?
I got the error, that the columns couldn't be shown because the table name wasn´t shown. As jgberth said, the table name is "names".
It's already there
It took me forever, to find the correct table name. Can you add the table name
names
explicitly?It's already there
This comment has been hidden.
Ok. I did it. But, be careful with the comments when you attempt your query. An alternate solution that I had commented was preventing me from success
The author says below that "user does not need to care about ordering", but for me this passes all Tests but then fails due to the ordering. Can you please advise?
Your query is wrong in the like part.
why would this in practice ever be used ? wouldn't you just use LENGTH instead of trying to do this with LIKE ?
This is a bad kata...promoting bad practice
I feel like this should probably be an 8 kyu
This comment has been hidden.
what is the name of the table? PG::UndefinedTable: ERROR: relation "people" does not exist
The table is named names
Having the same error about keys
Check your code.
Unfortunately it spams with (for columns test):
undefined method `keys' for nil:NilClass Simplified backtrace: block (3 levels) in
Check your code.
This comment has been hidden.
Right, I just realized it was because I used "" instead of ''...
The description for this kata is still wrong!
It talks about a
producers
table, that doesn't exist and aname
colum which also doesn't exist.Instead the actual table is called
names
and the columns here arefirst_name
andlast_name
.Sorry for that, when I was fixing test, there was some old cache in the Kata editor, and I didn't notice that. I've already fixed your remarks.
Ok.
The ordering of the result is not specified. Test comparisons are order-sensitive so this will fail statements that return the results in a different order.
You should either sort the results in your test assertion, or specify a total ordering for the
SELECT
statement.Ok, I've check the docs, and the order is indeed not guaranteed - I just assumed that without ORDER BY is for lower kyu,i think that in most 8kyu and 7kyu there is no ORDER BY. If there are already some people who solve the proble, can I change the solution by adding SORT BY ?
This comment has been hidden.
Yes it is but postgres does not guarantee ordering from what I have read, but I'm not and expert in that matter, I will add sort in the test to preserve solutions. Next time I will add ordering in the problem description
Ok, fixed, now it is sorting results in tests, so user does not need to care about ordering
Approved ;-)
people
have name with at least 6 character long
What do you mean by
name
? A. first_name B. last_name C. full name. (eg. 'Rainbow Dash' if first_name = 'Rainbow' and last_name = 'Dash'?)Thank you for that, I've fixed the description. I've changed table name in desc to names and first_name as where parameter