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 trialMadhuri Maddala
Courses Plus Student 793 PointsCreate a report from the customers table that shows their first initial of their first name and alias it as initial. Sel
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.
3 Answers
Benjamin Larson
34,055 PointsMadhuri -
Your SUBSTR function is correct, but you don't need the concatenation operators (||) or the string (" ") in this example. Also, there are two column you are selecting: the first letter of the first_name, and the last_name. SQL syntax requires you to put a comma between each column you are selecting. The way you have it written now, SQL doesn't understand because it's missing the comma and your alias to "intial" (which needs to be "initial"), is being associated with last_name, not the substring of the first_name.
Hopefully this makes sense and you can take another stab at it. If not, feel free to ask more questions.
Manuel Alvarez
5,383 PointsSELECT SUBSTR(first_name, 1, 1), last_name AS "initial" FROM customers;. Can someone please help with this one. I can't seem to get it.
mazen akkari
19,861 PointsIt asks to make the first_name an alias, then add the last_name
SELECT SUBSTR(first_name, 1, 1) AS initial , last_name AS last_name FROM customers;
Madhuri Maddala
Courses Plus Student 793 PointsMadhuri Maddala
Courses Plus Student 793 Points