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 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
231,268 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
231,268 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