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 Creating Excerpts

Expecting reuslts like 'L Chalkley' not 'L Chalkley'. I need assistance please?

In an ecommerce database there's a customers table with id, username, first_name, last_name, password, email and phone columns.

Create a report from the customers table that shows their first initial of their first name and alias it as initial. Select their last name too.

2 Answers

Steven Parker
Steven Parker
218,812 Points

To facilitate an accurate analysis and answer, you need to show your query code. But here's a few hints:

  • be sure you're use the correct columns and alias
  • there should be 2 columns: "initial" and "last_name"
  • you'll need to use a function to get the first letter for "initial"
  • for this challenge, you won't need to use any concatenation

Thanks I was wondering is it any site that I could visit to practice SQL code?

Steven Parker
Steven Parker
218,812 Points

The "SQL Playground" in the course is good for practice. You don't have to stick to the suggested queries, you can make up your own. And you can create your own databases if you don't like the sample ones already loaded.

But you can also find some with a search, one example: W3Resource SQL Exercises