ROUND aggregate function

Hello! I was doing this exercise as part of Aggregate Functions in SQL.

In the last exercise, we were able to get the average price of an app ($2.02365) using this query:
SELECT AVG(price)FROM fake_apps;
Now, let’s edit this query so that it rounds this result to 2 decimal places.
This is a tricky one!

I first typed in a query where I wrote
SELECT AVG(price)
SELECT ROUND (AVG(price), 2)
FROM fake_apps;

The query didn’t return any results. I’ve understood the second line of the query. I’m confused as to why defining the average in the first won’t help or fetch any results. Can someone please help me understand why my line of thinking is incorrect? Am I double defining something?

You can’t have two SELECT statements. Delete the first one and see what happens.

1 Like

Got it! I did get the result when I deleted the first select statement. Thank you!

2 Likes