There seems to be “gaps” in the curriculum. I’m working through the “warby parker” funnel project in the Data Science career path and I’m at the end going through some of the extra questions in step 6.
I’m watching Rob’s video (the help video provided: https://www.youtube.com/watch?time_continue=14&v=lM2Tr7A9W1E&feature=emb_title - time is at 15:08) and he enters the following code:
WITH q AS (
SELECT ‘1-quiz’ COUNT(DISTINCT user_id)
My question is specifically related to the SELECT clause where it appears that he grabs an already (not previously aliased as such) aliased column. At this point in the curriculum, we’re taught that we can alias columns in the below manner:
WITH q AS(
SELECT COUNT(DISTINCT user_id) AS ‘1-quiz’,
Are the two clauses essentially the same? Can we eliminate the need for the AS clause by simply putting the desired alias immediately following the SELECT clause? This was not covered anywhere previously in the curriculum.
It’s also in the video that I learned we can clean up our code by aliasing the table names.
Example, instead of:
SELECT home_try_on.user id
FROM home_try_on h;
Again, no where in the curriculum does it mention these tricks.
Regardless, help regarding the aliasing as requested in the first section of this question would be much appreciated.