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 Changing Cases of Strings

Why do we not use 'SELECT FROM' in this query case?

I have done some research and have found the answer to be "SELECT LOWER(title) AS lower_case_title, UPPER(author) AS upper_case_author FROM books;"

But I'm confused to why in other circumstances with SQL we have always said 'SELECT *' or 'SELECT title FROM books' etc to get column and or value information.

Is this because we are editting the results by using UPPER and LOWER to modify information from the table?

1 Answer

SELECT * FROM books; Return all columns in the books table.

SELECT title FROM books; Returns the column title from the books table.

SELECT LOWER(title) AS lower_case_title, UPPER(author) AS upper_case_author FROM books; Returns the column title shown as lower_case_title with the results in lower case and the column author shown as upper_case_author with the results in upper case from the books table.