Databases Reporting with SQL Working with Text Creating Excerpts

Remi Vledder
Remi Vledder
14,143 Points

"Bummer: Expecting results like 'L Chalkley' not 'L Chalkley'." What's the difference here?

Tried these queries:

SELECT UPPER(SUBSTR(username, 1, 1)) AS initial, last_name FROM customers;
SELECT UPPER(SUBSTR(username, 1, 1)) || ' ' || last_name AS initial FROM customers;
SELECT SUBSTR(UPPER(username), 1, 1) || ' ' || last_name AS initial FROM customers;

Then I receive the error: Bummer: Expecting results like 'L Chalkley' not 'L Chalkley'.

What am I doing wrong?

2 Answers

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,281 Points

The task wants you to select the first initial of their first name. You are selecting the first initial of their username.

Remi Vledder
Remi Vledder
14,143 Points

Turns out it should be:

SELECT SUBSTR(first_name,1,1) AS initial, last_name FROM customers;