Databases Reporting with SQL Working with Text Creating Excerpts

Bryan Makle
Bryan Makle
4,531 Points

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
177,726 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
Bryan Makle
Bryan Makle
4,531 Points

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

Steven Parker
Steven Parker
177,726 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