31 Years of Python | 48 Hour Sale Extension!!!

Substring instead of replace

Screen Link:

My Code:

SELECT REPLACE(race_group,'g', 'G') FROM performance

What I expected to happen:
Correct answer

What actually happened:

The query result table is missing a column named upper(substring(race_group, 1, 1)) || substring(race_group, 2, 7).

While I get the solution I think mine was much simpler. But I know I am missing something but I can’t seem to figure it out because when I run the query it is showing as per the result

This is an issue with their Grader.

They expected learners to complete this using their thought out way, so the expected answer is supposed to be the one in the solution. That’s why the column names don’t match and it doesn’t pass for you.

Please use the ? button in the top-right of the Classroom to report this to them. Let them know that the grader is only accepting that specific column name and nothing else. The latter can be quickly tested by including an alias for that column.

Also, do note that your approach is technically correct. The instructions state -

capitalizes only the first letter of each string in the column

They ask us to capitalize the first letter of each string. You are assuming that all rows have the first string as group and the second string as a capitalized letter (which, based on a quick look by me, seems to be a correct assumption for this data).

If there was any variation to that pattern in the data anywhere, then your solution won’t be correct. It’s probably better to have a solution that focuses on the intended output irrespective of what knowledge we have of the data so far in this case.