Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases Reporting with SQL Working with Text Changing Cases of Strings

Ash Mitchell
Ash Mitchell
6,034 Points

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.