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

Upper Case problem, want went wrong with my code?

In the library database there's a patrons table with the columns id, first_name, last_name, address, email, library_id, and zip_code. The library is generating new library cards that will display the full name and their library ID. The full name needs to have the last name in all caps. Create a report with two columns of results, one is an alias of full_name the second being the library_id.

My code : SELECT first_name || " " || UPPER (last_name) AS "full_name", library_id FROM patrons;

Nancy Melucci
Nancy Melucci
Courses Plus Student 35,157 Points

Is the UPPER supposed to transform both first and last name....? It looks like it is affecting only the last name here.

2 Answers

Steven Parker
Steven Parker
229,785 Points

:point_right: Your query works fine for me.

I tried pasting it directly into task 2 of this challenge and it passed. Unless it's the wrong challenge?

If it's still not working for you, please provide a link the the actual challenge you are working with.

Aananya Vyas
Aananya Vyas
20,157 Points

select LOWER(title) AS lowercase_title , UPPER(author) uppercase_author from books;

first part^

select first_name || " " || UPPER(last_name) AS "full_name" , library_id FROM patrons;

^for the second part^

the space between function name and argument is causing a problem it would be: UPPER(<argument>) hope it helps!