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 Practice Session

Remi Vledder
Remi Vledder
14,144 Points

Is it possible to UPPER(<column>) a single column, and returning all other columns without having to specify them?

In the course example the following query:

SELECT * from movies;

would return:

id  title   year_released   genre
1   Alien   1979    Sci Fi
2   Aliens  1986    Sci Fi
3   Moulin Rouge    2001    Musical
4   Guys and Dolls  1955    Musical
5   Mama Mia    2008    Musical
6   Starman 1984    Sci Fi
7   Tron    1982    Sci Fi
8   Die Hard    1988    Action

Then to make the title column uppercase you could do:

SELECT UPPER(title) AS title FROM movies;

Now if you'd like to return the entire table, you could do something like this:

SELECT id, UPPER(title) AS title, year_released, genre FROM movies;

This would mean you'd have to add all the columns with the name in the query.

Now, would it also be possible to somehow shorten this using the * wildcard or something?

i.e.

-- this doesn't work, but something similar perhaps
SELECT *, UPPER(title) AS title FROM movies;