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 Reporting with SQL Working with Text Finding the Length of Text

Previous exercise - Concatenate text and place <> around email address - your examples and teaching are very unclear.

Your explanation and examples as to how to concatenate a first name, last name, and email address with brackets around it are very unclear. Our DBA could not figure out what it is you wanted in the example, even after trying a dozen or more times.

Steven Parker
Steven Parker
229,657 Points

Your DBA couldn't figure it out? But this is a Beginner level course!

Seriously, the challenges can sometimes be a bit tricky, but I doubt most beginners taking the course need more than a few tries to pass the challenge.

The most common causes for people asking for help is they either forget to include a space between the name and the open angle, or they don't realize they can mix literal strings and fields when concatenating.

If you couldn't solve it yourself, and the above issues don't resolve it, feel free to post your code here for some specific help.

3 Answers

Diana Ci
Diana Ci
18,672 Points

It works like this: SELECT first_name || " " || last_name || " <" || email || ">" AS to_field FROM patrons;

Your DBA might want to consider going through the classes. The answer, while challenging, wasn't particularly difficult after a try or two.

Coding, even in SQL, is about problem solving. So it's natural and makes sense that the questions are going to require you to problem solve a bit more than what is given.

SELECT to_field AS "To", first_name || "" "" || last_name || " " || "<" || email || ">" FROM patrons;

I couldn't get this to work but not sure why. The "Alias it to the to_field" didn't make sense wince there is no to_field in the example. Error kept saying syntax error with "||"..> triple checked the spaces but still can't solve it.

Ololo Olololo
Ololo Olololo
Courses Plus Student 1,816 Points

The correct one is: SELECT first_name || " " || last_name || " " || "<" || email || ">" AS to_field FROM patrons;