Capitalize the symbol values - Build a Periodic Table Database

Tell us what’s happening:
Describe your issue in detail here.
Hello to everyone, I’m having trouble with the capitalize challenge, I can’t figure out how to capitalize the first letter of all the symbols in the elements table.
Your code so far
I have used this code:

UPDATE elements SET symbol = initcap(symbol) WHERE symbol ~ '^[a-z]'

It works, but it also changes the T to lower case of the mT symbol.

If anyone can help me, i would appreciate it.
Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32

Challenge: Periodic Table Database - Build a Periodic Table Database

Link to the challenge:

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like

I am not familiar with the details of the challenge but I was wondering why have this where clause?
Surely you can just capitalize all the symbols either way?

Yeah, I can, but idk i was trying different solutions.

The where clause looks okay. So does the initcap .

Does the command give any error?

No, the problem is that I need to capitalize only the first letter without changing any of the others. There is an element mT that when I use the function initcap it changes the element to Mt.

okay, you should look into some other functions then
here’s an interesting list. You can probably combine a few to get the result you want

Thank you very much!

1 Like