Question about Code Challenge: Aggregate Functions using AS operator


The instructions in 2/10 are to:

Use COUNT() and a LIKE operator to determine the number of users that have an email ending in ‘.com’.

My incorrect solution was:

FROM users
WHERE email LIKE ‘’;

After trying to figure it out, I check the solution provided which is:

FROM users
WHERE email LIKE ‘’;

I am still unclear why this query requires the use of AS. My understand so far is that the AS is used to rename a column, so is there a reason that is required in this case that I am missing?

1 Like

The column name normally takes the string you use for requesting data.

In this case the column name should be something like COUNT or COUNT(*) without the use of as.
Al tho it still gets the right information it is not very nice to look at.

This probably broke because Codecadamy asked to name the column. If not you should add a bug report from the lesson (found if you scroll down where the instructions are listed).