Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Joel Rivera
29,401 PointsSQL Calculating, Aggregating and Other Functions String Functions Challenge 3
I am stuck.
Here is the question.
Select the first letter of the "first_name", add a period after it, followed by a space and add the "last_name". Also, uppercase the "last_name". Call it "name". Example "A. CHALKLEY".
MY answer
SELECT CONCAT(SUBSTRING(first_name),1,"." , " " , UPPER(last_name)) AS name FROM users;
I then tried:
SELECT CONCAT(SUBSTRING(first_name, 1), ".", " " , UPPER(last_name)) AS name FROM users;
FINALLY GOT IT:
SELECT CONCAT(SUBSTRING(first_name, 1, 1),".", " " , UPPER(last_name)) AS name FROM users;
2 Answers

Miriam Tocino
14,201 PointsGreat point! But I still don't understand why this was not valid:
SELECT CONCAT(SUBSTRING(first_name, 1, 1),". " , UPPER(last_name)) AS name FROM users;
Can't you join the period and space together in one string? Just works separately?

Joel Rivera
29,401 PointsMy code: SELECT CONCAT(SUBSTRING(first_name, 1, 1),".", " " , UPPER(last_name)) AS name FROM users;
Your Code: SELECT CONCAT(SUBSTRING(first_name, 1, 1),". " , UPPER(last_name)) AS name FROM users;
I am no expert and this challenge broke my brain for a while. The only thing I can say is when you concatenated the . you had an extra space and you didn't add the extra white space with an extra set of " " with a space in between. I probably tried your version also, can't remember cause its a blur. I would have assumed your way would have added the same white space as mines just differently but I guess the challenge was looking for something specific. I myself get lost in all the . and ' and " etc. This stuff is not easy. Good luck.
Benjamin Lim
17,880 PointsThe code above should work. This is what I coded that worked. Looks similar to yours.
select concat(substring(first_name,1,1),". ",upper(last_name)) as name from users;

Mawel Mirabal
14,289 PointsThis code below should pass too...
SELECT CONCAT(SUBSTRING(first_name, 1, 1), ".", " ", UPPER(last_name) ) AS name FROM users;
lyonel scapino
14,191 Pointslyonel scapino
14,191 PointsI had this : SELECT CONCAT(SUBSTRING(first_name,1,1),”.”,” “, UPPER(last_name)) AS name FROM users; AND it wasn't working....How come?