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 trialZachary Wheeler
1,157 PointsReporting to SQL Challenge 3 Task 1
https://teamtreehouse.com/library/reporting-with-sql/working-with-text/concatenating-text
I'm having a hard time understanding the instructions on this challenge. I'm not sure what it is asking me to alias? Am i simply using SELECT and FROM commands like in the video or the others also?
2 Answers
Steven Parker
231,271 PointsThis query will use a SELECT
and a FROM
clause.
But the SELECT
will be a bit involved, requiring the concatenation of a mix of data fields with literal strings, plus a column alias for the completed string.
This will be a chance to apply things you learned in the last few videos to a practical situation that's a bit different from any of the video examples. But the instructor and I are both betting you can figure it out.
Aananya Vyas
20,157 PointsSELECT first_name || " " || last_name || " <" || email || ">" AS "to_field" FROM patrons;
try this
Steven Parker
231,271 PointsAananya Vyas, I think most folks get a better learning experience by solving an issue themselves with a few hints than just being shown the answer. After 23 days, I'd hope Zachary has solved this (even though he did not select a "best answer"), but it might be a bit of a "spoiler" for others who have not completed this task themselves yet.
Zachary Wheeler
1,157 PointsZachary Wheeler
1,157 PointsSELECT first_name AS "Andrew" || last_name AS "Chalkley" || email AS "andrew@teamtreehouse.com" FROM patrons AS to_field;
Here is what I have down currently. 1. Do I have the concatenations in the right spot and 2. Are the to_field it's asking for in the right area? I wasn't sure which column I was supposed to alias as to_field. was it each one within the selection like name, and email?
Let me know what needs to be fixed.
Thanks!
Steven Parker
231,271 PointsSteven Parker
231,271 PointsOk, here's a few more hints:
AS
name) must follow the field(s) or literal(s) it is being applied toSELECT
clause will come before theFROM
clause