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

Courtney Artis
Courtney Artis
3,229 Points

Changing the cases of text of strings code challenge 2

I keep getting this same error :

SELECT LOWER(first_name) as "library_id" UPPER(last_name) as "full_name" ,from patrons SQL Error: near "UPPER": syntax error

1 Answer

Benjamin Larson
Benjamin Larson
34,055 Points

The reason for the warning given is that you don't have a comma separating the two columns. You should remove the comma before FROM patrons and put it before UPPER(last_name).

You'll also need to concatenate first_name and last_name (with a space in between) an alias that result as a single column: full_name. The first_name should not be lowercase nor should it be aliased to library_id. The library_id itself needs no alias.

This would remove the given warning, but you'll have to fix the other problems mentioned as well:

SELECT LOWER(first_name) AS "library_id", UPPER(last_name) AS "full_name" FROM patrons;