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

Databases

Kamran Ismayilov
Kamran Ismayilov
5,753 Points

Creating Excerpts

Please help to solve this problem, I can not understand what I am doing wrong.

Steven Parker
Steven Parker
231,261 Points

It would help to know what you're working on. In future, be sure to share a link to the quiz/challenge/video page. And remember to share your code and/or a workspace snapshot!

2 Answers

Steven Parker
Steven Parker
231,261 Points

Normally, I'd give you some hints instead of an explicit spoiler, but since you didn't share your code, it's impossible to know what you were doing wrong. But the challenge wants you to extract the first initial from the first name, so you would use the SUBSTR function to get a string from index 1 with a length of 1. Then, selecting that with an alias and including the last name your query would be something like this:


:warning: SPOILER ALERT


SELECT SUBSTR(first_name, 1, 1) AS initial, last_name FROM customers;
Kamran Ismayilov
Kamran Ismayilov
5,753 Points

Oh thanks you a lot! I think the compiler was confusing me.