Databases SQL Basics Getting Data from a Database Categorizing Your Output with 'AS'

shiny peanut
shiny peanut
4,223 Points

AS Keyword in SQL

I'm a little stuck on this last question. Went through it a few times thinking I might have a typo somewhere. Do you guys see the issue with this answer?

3 Answers

William Li
William Li
7,934 Points
SELECT name AS 'Product Name', description AS 'Product Description' FROM products

The above works for me

btw you're pretty cute ;)

shiny peanut
shiny peanut
4,223 Points

The one I'm stuck on is actually this one:

In this sports team database there's a results table with the columns of id, home_team, home_score, away_team, away_score and played_on.

Alias "Home Team", "Home Score", "Away Team", "Away Score" and "Date Played" to the appropriate columns.

So for that I put:

SELECT home_team AS "Home Team", home_score AS "Home Score", away_team AS "Away Team", away_score AS "Away Score", date_played AS "Date Played" FROM results;

And I'm not sure why it doesn't work since it follows the same premise as the others in that code challenge

William Li
William Li
7,934 Points

There is no column called date_played its name is played_on

SELECT home_team AS "Home Team", home_score AS "Home Score", away_team AS "Away Team", away_score AS "Away Score", played_on AS "Date Played" FROM results